Fix for Clang lld in cmake

This commit is contained in:
ptitSeb 2021-07-30 15:00:18 +02:00
parent 9f50a19856
commit 5a3316b872

View File

@ -425,7 +425,7 @@ endif()
if(${CMAKE_VERSION} VERSION_LESS "3.13")
if(NOT NOLOADADDR)
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-Wl,--image_base=${BOX64_ELF_ADDRESS}")
set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-Wl,--image-base=${BOX64_ELF_ADDRESS}")
else()
set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-Wl,-Ttext-segment,${BOX64_ELF_ADDRESS}")
endif()
@ -434,7 +434,7 @@ else()
# If symbols are missing, try this: target_link_options(${BOX64} PUBLIC -rdynamic)
if(NOT NOLOADADDR)
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
target_link_options(${BOX64} PUBLIC LINKER:--image_base=${BOX64_ELF_ADDRESS})
target_link_options(${BOX64} PUBLIC LINKER:--image-base=${BOX64_ELF_ADDRESS})
else()
target_link_options(${BOX64} PUBLIC LINKER:-Ttext-segment,${BOX64_ELF_ADDRESS})
endif()