mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
CMake: Use CMAKE_LINKER_TYPE on CMake >= 3.29
This commit is contained in:
parent
18abd54247
commit
1af9e44130
Notes:
sideshowbarker
2024-07-17 06:40:35 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/1af9e44130 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/105
1 changed files with 10 additions and 4 deletions
|
@ -19,8 +19,14 @@ if (NOT APPLE AND NOT LAGOM_USE_LINKER)
|
|||
endif()
|
||||
|
||||
if (LAGOM_USE_LINKER)
|
||||
set(LINKER_FLAG "-fuse-ld=${LAGOM_USE_LINKER}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAG}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAG}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAG}")
|
||||
# FIXME: Move to only setting CMAKE_LINKER_TYPE once we drop support for CMake < 3.29
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)
|
||||
string(TOUPPER ${LAGOM_USE_LINKER} linker_type)
|
||||
set(CMAKE_LINKER_TYPE ${linker_type})
|
||||
else()
|
||||
set(LINKER_FLAG "-fuse-ld=${LAGOM_USE_LINKER}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAG}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAG}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAG}")
|
||||
endif()
|
||||
endif()
|
||||
|
|
Loading…
Reference in a new issue