Skip to content

Commit 8d374d7

Browse files
committed
Removed CMake test targets when building static libraries
1 parent 112e2fe commit 8d374d7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Release/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,17 @@ function(add_casablanca_test NAME SOURCES_VAR)
9494
message("-- Added test library ${NAME}")
9595
if (NOT TEST_LIBRARY_TARGET_TYPE STREQUAL "OBJECT")
9696
target_link_libraries(${NAME}
97-
${LIB}unittestpp
9897
${LIB}httptest_utilities
9998
${LIB}common_utilities
99+
${LIB}unittestpp
100100
${Casablanca_LIBRARIES}
101101
)
102-
103-
add_test(NAME ${NAME}
104-
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
105-
COMMAND test_runner lib${NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
106-
)
102+
if (BUILD_SHARED_LIBS)
103+
add_test(NAME ${NAME}
104+
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
105+
COMMAND test_runner lib${NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
106+
)
107+
endif()
107108
endif()
108109
endfunction()
109110

0 commit comments

Comments
 (0)