On 01/11/2016 09:42 AM, Alan Burlison wrote: > The "-m64" flag is used to tell the compiler/linker to create 64-bit > executables and is set via the following CMake variables: > > CMAKE_EXE_LINKER_FLAGS > CMAKE_SHARED_LINKER_FLAGS > CMAKE_STATIC_LINKER_FLAGS
What is adding -m64 to CMAKE_STATIC_LINKER_FLAGS? That value is indeed meant to be used to pass flags to "ar" because CMake (for historical reasons) abuses the term "linker" to refer to the archiver used for a static library. > set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cq <TARGET> <LINK_FLAGS> > <OBJECTS>") > > But I'm struggling to understand when passing in linker flags to ar > *ever* makes sense, at least on *nix platforms. The name "LINK_FLAGS" is used as a placeholder there to share the implementation with similar substitutions done in actual link line generation. See above about the naming. The question here is what changed between 2.8.6 and 3.3.2 that causes -m64 to start showing up in CMAKE_STATIC_LINKER_FLAGS. -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
