Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cmake support #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add cmake support #27

wants to merge 2 commits into from

Conversation

glebm
Copy link

@glebm glebm commented Nov 6, 2024

Adds modern CMake support, allowing SheenBidi to be used as a subproject from a CMake project (e.g. via FetchContent), with support for installation, the test suite, and a GitHub Actions workflow.

Fixes #26

Installation

Allows installing the library via CMake, which also installs CMake package definitions, enabling the use of find_package(SheenBidi):

cmake -S. -Bbuild-rel -DCMAKE_BUILD_TYPE=Release
cmake --build build-rel -j $(getconf _NPROCESSORS_ONLN)
sudo cmake --install build-rel
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libsheenbidi.so
-- Installing: /usr/local/include/SheenBidi/SBAlgorithm.h
-- Installing: /usr/local/include/SheenBidi/SBBase.h
-- Installing: /usr/local/include/SheenBidi/SBBidiType.h
-- Installing: /usr/local/include/SheenBidi/SBCodepoint.h
-- Installing: /usr/local/include/SheenBidi/SBCodepointSequence.h
-- Installing: /usr/local/include/SheenBidi/SBGeneralCategory.h
-- Installing: /usr/local/include/SheenBidi/SBLine.h
-- Installing: /usr/local/include/SheenBidi/SBMirrorLocator.h
-- Installing: /usr/local/include/SheenBidi/SBParagraph.h
-- Installing: /usr/local/include/SheenBidi/SBRun.h
-- Installing: /usr/local/include/SheenBidi/SBScript.h
-- Installing: /usr/local/include/SheenBidi/SBScriptLocator.h
-- Installing: /usr/local/include/SheenBidi/SheenBidi.h
-- Installing: /usr/local/lib/cmake/SheenBidi/SheenBidiTargets.cmake
-- Installing: /usr/local/lib/cmake/SheenBidi/SheenBidiTargets-release.cmake
-- Installing: /usr/local/lib/cmake/SheenBidi/SheenBidiConfig.cmake
-- Installing: /usr/local/lib/cmake/SheenBidi/SheenBidiConfigVersion.cmake

Additionally, this also allows testing via CMake and adds a GitHub Actions workflow.

Testing

Enables sanitizers in Debug build by default. Sanitizers run in the test suite and can catch undefined behaviour and memory errors.

The test suite can be run via CTest (the CMake test runner):

cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target test
ctest --test-dir build --output-on-failure -j $(getconf _NPROCESSORS_ONLN)
Internal ctest changing into directory: /home/gleb/SheenBidi/build
Test project /home/gleb/SheenBidi/build
    Start 1: tests
1/1 Test #1: tests ............................   Passed   17.07 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =  17.07 sec

GitHub Actions

A GitHub Action builds all targets and runs the tests.

/cc @BLooperZ @AJenbo

@glebm glebm mentioned this pull request Nov 6, 2024
@glebm glebm force-pushed the cmake branch 6 times, most recently from bfb659a to cc40d09 Compare November 6, 2024 23:34
Adds modern CMake support, allowing SheenBidi to be used as a subproject
from a CMake project (e.g. via `FetchContent`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMake support
1 participant