diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-02-14 22:47:20 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-02-14 22:47:20 +0100 |
commit | a9c0ea0e07329520f62141f74021d74684d0c6d0 (patch) | |
tree | b4a256fd21f8233625210ebc614412123b7a9f05 | |
parent | af193ef483ff94d90c8ced43294a5dee28630a5b (diff) | |
download | termo-a9c0ea0e07329520f62141f74021d74684d0c6d0.tar.gz termo-a9c0ea0e07329520f62141f74021d74684d0c6d0.tar.xz termo-a9c0ea0e07329520f62141f74021d74684d0c6d0.zip |
Fix static linking into a shared library
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bac446..f89bab6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,14 @@ set_target_properties (termo-static PROPERTIES VERSION ${project_VERSION} SOVERSION ${project_API_VERSION}) +# A fix for: relocation R_X86_64_32 against `a local symbol' can not be +# used when making a shared object; recompile with -fPIC +# See http://www.cmake.org/pipermail/cmake/2007-May/014350.html +# This should enable linking the static library into a shared one. +if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set_target_properties (termo-static PROPERTIES COMPILE_FLAGS "-fPIC") +endif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + # Demos add_executable (demo-async EXCLUDE_FROM_ALL demo-async.c) target_link_libraries (demo-async termo-static ${lib_libraries}) |