compat BUILD provide source instead of an object
Because it allows for hiding its symbols.
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 690a1df..692ddda 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -17,7 +17,7 @@
cmake_parse_arguments(ADDTEST "" "NAME;WRAP" "SOURCES" ${ARGN})
set(TEST_NAME utest_${ADDTEST_NAME})
- add_executable(${TEST_NAME} ${TEST_SOURCES} $<TARGET_OBJECTS:yangobj> $<TARGET_OBJECTS:compat>)
+ add_executable(${TEST_NAME} ${TEST_SOURCES} $<TARGET_OBJECTS:yangobj>)
foreach(TEST_SOURCE ${ADDTEST_SOURCES})
target_sources(${TEST_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_SOURCE})
endforeach()
diff --git a/tests/style/CMakeLists.txt b/tests/style/CMakeLists.txt
index 05c09ce..dd4285e 100644
--- a/tests/style/CMakeLists.txt
+++ b/tests/style/CMakeLists.txt
@@ -6,7 +6,7 @@
endif()
# just compile
-add_executable(cpp_compat cpp_compat.c $<TARGET_OBJECTS:yangobj> $<TARGET_OBJECTS:compat>)
+add_executable(cpp_compat cpp_compat.c $<TARGET_OBJECTS:yangobj>)
target_include_directories(cpp_compat BEFORE PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(cpp_compat ${CMAKE_THREAD_LIBS_INIT} ${PCRE2_LIBRARIES} ${CMAKE_DL_LIBS} m)
target_compile_options(cpp_compat PUBLIC "-Werror=c++-compat")