# HG changeset patch # User Sebastien Jodogne # Date 1515055804 -3600 # Node ID 8fe42ddf0807bed27074c4eb82ede9801eb78cd8 # Parent 6547e6941b15e17af96004c44b125bc81610d6ae sync diff -r 6547e6941b15 -r 8fe42ddf0807 Orthanc/Resources/CMake/Compiler.cmake --- a/Orthanc/Resources/CMake/Compiler.cmake Thu Jan 04 09:49:10 2018 +0100 +++ b/Orthanc/Resources/CMake/Compiler.cmake Thu Jan 04 09:50:04 2018 +0100 @@ -200,7 +200,12 @@ # exist a duplicate object name (e.g. a/Foo.cpp.o, b/Foo.cpp.o), the # resulting static library can end up having only one of the # duplicate objects. [...] This bug only happens if there are many - # objects." https://cmake.org/Bug/view.php?id=14874 + # objects." The trick consists in replacing the "r" argument + # ("replace") provided to "ar" (as used in CMake < 3.1) by the "q" + # argument ("quick append"). This is because of the fact that CMake + # will invoke "ar" several times with several batches of ".o" + # objects, and using "r" would overwrite symbols defined in + # preceding batches. https://cmake.org/Bug/view.php?id=14874 set(CMAKE_CXX_ARCHIVE_APPEND " q ") endif()