From 0fa221a3110e58362efe81f2691e2bcbd03a9a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Sat, 21 May 2016 20:09:20 +0200 Subject: [PATCH] Build library object instead of executable when compiling with clang in CI. --- src/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 86bf961..682cbda 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -137,12 +137,16 @@ else() endif() include_directories(${global_includes}) -add_executable(${project_name} ${project_files}) -target_link_libraries(${project_name} ${global_libraries}) -install(TARGETS ${project_name} - RUNTIME DESTINATION bin -) +if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") AND (NOT $ENV{distribution} STREQUAL "")) + add_library(${project_name} OBJECT ${project_files}) +else() + add_executable(${project_name} ${project_files}) + target_link_libraries(${project_name} ${global_libraries}) + install(TARGETS ${project_name} + RUNTIME DESTINATION bin + ) +endif() # add a target to generate API documentation with Doxygen find_package(Plantuml)