# HG changeset patch # User Sebastien Jodogne # Date 1515054436 -3600 # Node ID 2a211c0fc7cae9675ce0282589279236c22e7b56 # Parent cbb8deaacdf7aed7d4db067ab256546e9a74192b note about ar diff -r cbb8deaacdf7 -r 2a211c0fc7ca Resources/CMake/Compiler.cmake --- a/Resources/CMake/Compiler.cmake Wed Jan 03 20:25:35 2018 +0100 +++ b/Resources/CMake/Compiler.cmake Thu Jan 04 09:27:16 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()