Skip to content

Commit 38a507e

Browse files
committed
Fix test build: use PRIVATE include scope and find Unity headers correctly
The test CMakeLists used INTERFACE instead of PRIVATE for target_include_directories, which meant the Unity include path was not applied to test_runner itself. Also replaced the incorrect ${UNITY} variable (a library path from find_library) with a proper find_path call that locates unity.h under the unity/ subdirectory where Unity's cmake install places it.
1 parent 22ac108 commit 38a507e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ target_link_libraries (test_runner LINK_PUBLIC
1010
${CJSON}
1111
unity
1212
)
13-
target_include_directories(test_runner INTERFACE ${UNITY})
13+
find_path(UNITY_INCLUDE_DIR unity.h PATH_SUFFIXES unity)
14+
target_include_directories(test_runner PRIVATE ${UNITY_INCLUDE_DIR})
1415

1516
add_test(test_phev_core test_runner)

0 commit comments

Comments
 (0)