Browse Source
This makes sure we add the lockstep_scheduler_test even if the ENABLE_LOCKSTEP_SCHEDULER is not set to yes. This means the lockstep_scheduler is not used for SITL but the CMakeLists.txt file still used and the test added.sbg
2 changed files with 11 additions and 40 deletions
@ -1,41 +1,13 @@ |
|||||||
cmake_minimum_required(VERSION 2.8.12) |
cmake_minimum_required(VERSION 2.8.12) |
||||||
|
|
||||||
if(NOT PROJECT_NAME STREQUAL "px4") |
# We want to test the lockstep schedule even if it is not used otherwise. |
||||||
|
add_library(lockstep_scheduler |
||||||
project(lockstep_scheduler) |
|
||||||
|
|
||||||
set (CMAKE_CXX_STANDARD 11) |
|
||||||
|
|
||||||
add_definitions(-DUNIT_TESTS) |
|
||||||
|
|
||||||
add_library(lockstep_scheduler |
|
||||||
src/lockstep_scheduler.cpp |
src/lockstep_scheduler.cpp |
||||||
) |
) |
||||||
|
|
||||||
target_include_directories(lockstep_scheduler |
|
||||||
PUBLIC |
|
||||||
$<INSTALL_INTERFACE:include> |
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> |
|
||||||
PRIVATE |
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src |
|
||||||
) |
|
||||||
|
|
||||||
target_link_libraries(lockstep_scheduler |
target_include_directories(lockstep_scheduler |
||||||
pthread |
|
||||||
) |
|
||||||
|
|
||||||
target_compile_options(lockstep_scheduler PRIVATE -Wall -Wextra -Werror -O2) |
|
||||||
|
|
||||||
add_subdirectory(test) |
|
||||||
|
|
||||||
else() |
|
||||||
|
|
||||||
add_library(lockstep_scheduler |
|
||||||
src/lockstep_scheduler.cpp |
|
||||||
) |
|
||||||
target_include_directories(lockstep_scheduler |
|
||||||
PUBLIC |
PUBLIC |
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include |
${CMAKE_CURRENT_SOURCE_DIR}/include |
||||||
) |
) |
||||||
|
|
||||||
endif() |
px4_add_gtest(SRC test/src/lockstep_scheduler_test.cpp LINKLIBS lockstep_scheduler) |
||||||
|
Loading…
Reference in new issue