diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c187eff3..e5d0cf0e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,6 +241,19 @@ add_check_c_cxx_flag("-Wimplicit-fallthrough") add_check_cxx_flag("-Wno-class-memaccess") #-----------------------------------------------------------------------------# +# Use ld.gold if available + +execute_process(COMMAND ${CMAKE_C_COMPILER} + -fuse-ld=gold + -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION) +if ("${LD_VERSION}" MATCHES "GNU gold") + string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=gold") + string(APPEND CMAKE_SHARED_LINKER_FLAGS " -fuse-ld=gold") + string(APPEND CMAKE_MODULE_LINKER_FLAGS " -fuse-ld=gold") + message(STATUS "Using GNU gold linker.") +endif () + +#-----------------------------------------------------------------------------# # Option defaults (three-valued options (cvc4_option(...))) # # These options are only set if their value is IGNORE. Otherwise, the user |