From 5c81d48c70e62e11d9a8fd0fd8231fac10c3bf29 Mon Sep 17 00:00:00 2001 From: Immanuel Haffner Date: Wed, 27 Nov 2019 02:20:59 +0100 Subject: Collect all object files from the object libraries in a CMake variable (#2477) using the `$` syntax. Use this variable when adding `libbinaryen` as static or shared library. Additionally, use the variable with the object files to simplify the `TARGET_LINK_LIBRARIES` commands: add the object libraries to the sources of executables and drop the use of our libraries in `TARGET_LINK_LIBRARIES`. (Object libraries cannot be linked but must be used as sources. See https://cmake.org/pipermail/cmake/2018-June/067721.html) --- src/support/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/support') diff --git a/src/support/CMakeLists.txt b/src/support/CMakeLists.txt index b3373d076..c8d7632e4 100644 --- a/src/support/CMakeLists.txt +++ b/src/support/CMakeLists.txt @@ -8,5 +8,4 @@ SET(support_SOURCES safe_integer.cpp threads.cpp ) -ADD_LIBRARY(support STATIC ${support_SOURCES}) -TARGET_LINK_LIBRARIES(support ${CMAKE_THREAD_LIBS_INIT}) +ADD_LIBRARY(support OBJECT ${support_SOURCES}) -- cgit v1.2.3