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 compile options for example applications and tests #41

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

Conversation

adriaan-niess
Copy link
Member

@adriaan-niess adriaan-niess commented Sep 8, 2024

Default build is now without example applications and tests. They must be enabled explicitely

cmake -DOPEN1722_BUILD_TESTS=ON -DOPEN1722_BUILD_EXAMPLES=ON <open1722-directory>

It's now also possible to choose whether to build a static or dynamic library using CMake's BUILD_SHARED_LIBS variable. A static library can be build like this:

cmake -BUILD_SHARED_LIBS=OFF <open1722-directory>

The last CMake command shown (no tests, examples and static lib) can be used to cross-compile for microcontrollers. In a Zephyr project you can simply add the following snippet to the CMakeLists.txt to include Open1722 (make sure to set a valid commit ID or tag)

include(FetchContent)
FetchContent_Declare(open1722
    GIT_REPOSITORY git@github.com:COVESA/Open1722.git
    GIT_TAG <tag or commit ID>
FetchContent_MakeAvailable(open1722)

Signed-off-by: Adriaan Nieß <mail@adriaan-niess.com>
Signed-off-by: Adriaan Nieß <mail@adriaan-niess.com>
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.

1 participant