COVESA / Open1722

Open-source implementation of the IEEE 1722 protocol, for streaming audio/video, tunneling CAN/LIN messages and enabling remote access to peripheral bus systems.
BSD 3-Clause "New" or "Revised" License
24 stars 6 forks source link

Add compile options for example applications and tests #41

Open adriaan-niess opened 2 months ago

adriaan-niess commented 2 months ago

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)