gold linker

This commit is contained in:
Erik Frojdh 2020-03-27 08:22:24 +01:00
parent 02d7381788
commit 58ab3c4123
2 changed files with 70 additions and 62 deletions

View File

@ -46,7 +46,17 @@ option(SLS_BUILD_DOCS "docs" OFF)
option(SLS_BUILD_EXAMPLES "examples" OFF)
option(SLS_TUNE_LOCAL "tune to local machine" OFF)
# Use ld.gold if it is available and isn't disabled explicitly
option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
if (SLS_USE_LD_GOLD)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if ("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
else ()
message(WARNING "GNU gold linker isn't available, using the default system linker.")
endif ()
endif ()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)

View File

@ -1,9 +1,9 @@
find_package(Doxygen)
find_package(Sphinx)
find_package(Doxygen REQUIRED)
find_package(Sphinx REQUIRED)
if (DOXYGEN_FOUND AND SPHINX_FOUND)
# message(${CMAKE_PROJECT_SORURCE_DIR}/slsDetectorSoftware/src)
# Utility to generate command line documentation
add_executable(gendoc src/gendoc.cpp)
# This is a bit hacky, but better than exposing stuff?
@ -66,6 +66,4 @@ if (DOXYGEN_FOUND AND SPHINX_FOUND)
${SPHINX_BUILD}/html
COMMENT "Generating documentation with Sphinx")
else (DOXYGEN_FOUND AND SPHINX_FOUND)
message("Doxygen and Sphinx are needed to build documentation")
endif (DOXYGEN_FOUND AND SPHINX_FOUND)