mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Increase the link performance
Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
parent
2916948465
commit
140d841404
@ -247,6 +247,9 @@ else()
|
|||||||
message(STATUS "No support for C++11 detected. Compilation will most likely fail on your compiler")
|
message(STATUS "No support for C++11 detected. Compilation will most likely fail on your compiler")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Use GNU gold linker if available
|
||||||
|
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/LDGold.cmake)
|
||||||
|
|
||||||
# setup -rpath to search for shared libs in BINARY/../libs folder
|
# setup -rpath to search for shared libs in BINARY/../libs folder
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE)
|
||||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||||
|
17
cmake/LDGold.cmake
Normal file
17
cmake/LDGold.cmake
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
option(ENABLE_LDGOLD "Use GNU gold linker" ON)
|
||||||
|
|
||||||
|
set(LDGOLD_FOUND FALSE)
|
||||||
|
if(ENABLE_LDGOLD)
|
||||||
|
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_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||||
|
set(LDGOLD_FOUND TRUE)
|
||||||
|
message(STATUS "Linker: GNU gold")
|
||||||
|
else()
|
||||||
|
message(WARNING "GNU gold linker is not available, falling back to default system linker")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "Linker: Default system linker")
|
||||||
|
endif()
|
Loading…
Reference in New Issue
Block a user