comparison Resources/CMake/Compiler.cmake @ 2456:cbb8deaacdf7

Fix static build on CentOS 6
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 03 Jan 2018 20:25:35 +0100
parents ade8b4ddd8a6
children 2a211c0fc7ca
comparison
equal deleted inserted replaced
2455:6b3c0d5f65af 2456:cbb8deaacdf7
193 message(FATAL_ERROR "Don't know how to enable profiling on your configuration") 193 message(FATAL_ERROR "Don't know how to enable profiling on your configuration")
194 endif() 194 endif()
195 endif() 195 endif()
196 196
197 197
198 if (CMAKE_COMPILER_IS_GNUCXX)
199 # "When creating a static library using binutils (ar) and there
200 # exist a duplicate object name (e.g. a/Foo.cpp.o, b/Foo.cpp.o), the
201 # resulting static library can end up having only one of the
202 # duplicate objects. [...] This bug only happens if there are many
203 # objects." https://cmake.org/Bug/view.php?id=14874
204 set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> <LINK_FLAGS> q <TARGET> <OBJECTS>")
205 endif()
206
207
198 if (STATIC_BUILD) 208 if (STATIC_BUILD)
199 add_definitions(-DORTHANC_STATIC=1) 209 add_definitions(-DORTHANC_STATIC=1)
200 else() 210 else()
201 add_definitions(-DORTHANC_STATIC=0) 211 add_definitions(-DORTHANC_STATIC=0)
202 endif() 212 endif()