Skip to content

Commit 5b1047c

Browse files
committed
fix: support osal without config options
Not all ports set compile options on the files, so we should support empty lists on all of these files.
1 parent dcb17df commit 5b1047c

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

test/CMakeLists.txt

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,23 @@
1616
# Get osal properties
1717
get_target_property(OSAL_SOURCES osal SOURCES)
1818
get_target_property(OSAL_OPTIONS osal COMPILE_OPTIONS)
19+
get_target_property(OSAL_COMPILE_DEFINITIONS osal COMPILE_DEFINITIONS)
1920
get_target_property(OSAL_INCLUDES osal INCLUDE_DIRECTORIES)
2021
get_target_property(OSAL_LIBS osal LINK_LIBRARIES)
2122

22-
if (OSAL_LIBS STREQUAL "OSAL_LIBS-NOTFOUND")
23+
if (NOT OSAL_OPTIONS)
24+
set(OSAL_OPTIONS "")
25+
endif()
26+
27+
if (NOT OSAL_COMPILE_DEFINITIONS)
28+
set(OSAL_COMPILE_DEFINITIONS "")
29+
endif()
30+
31+
if (NOT OSAL_INCLUDES)
32+
set(OSAL_INCLUDES "")
33+
endif()
34+
35+
if (NOT OSAL_LIBS)
2336
set(OSAL_LIBS "")
2437
endif()
2538

@@ -43,9 +56,14 @@ target_sources(osal_test PRIVATE
4356
osal_test.cpp
4457
)
4558

59+
target_compile_definitions(osal_test
60+
PRIVATE
61+
UNIT_TEST
62+
${OSAL_COMPILE_DEFINITIONS}
63+
)
64+
4665
target_compile_options(osal_test
4766
PRIVATE
48-
-DUNIT_TEST
4967
${OSAL_OPTIONS}
5068
)
5169

0 commit comments

Comments
 (0)