summaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
authorImmanuel Haffner <haffner.immanuel@gmail.com>2019-11-27 02:20:59 +0100
committerAlon Zakai <azakai@google.com>2019-11-26 17:20:59 -0800
commit5c81d48c70e62e11d9a8fd0fd8231fac10c3bf29 (patch)
treefe92869eca3333c0cbfe1fa6283e160c292136e5 /src/support
parentec53d11e0792884e1125fe5a1a437a5eff260259 (diff)
downloadbinaryen-5c81d48c70e62e11d9a8fd0fd8231fac10c3bf29.tar.gz
binaryen-5c81d48c70e62e11d9a8fd0fd8231fac10c3bf29.tar.bz2
binaryen-5c81d48c70e62e11d9a8fd0fd8231fac10c3bf29.zip
Collect all object files from the object libraries in a CMake variable (#2477)
using the `$<TARGET_OBJECTS:objlib>` 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)
Diffstat (limited to 'src/support')
-rw-r--r--src/support/CMakeLists.txt3
1 files changed, 1 insertions, 2 deletions
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})