mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-03-06 13:33:57 +01:00
cmake: fix link with lld and mold (#73)
This commit is contained in:
parent
7e78907829
commit
0634f87168
|
|
@ -52,6 +52,14 @@ function(add_precompiled_vulkan_spirv target)
|
|||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(target_base_address target address)
|
||||
if(CMAKE_CXX_COMPILER_LINKER_ID MATCHES "^(LLD|MOLD)$")
|
||||
target_link_options(${target} PUBLIC "LINKER:--image-base=${address}")
|
||||
else()
|
||||
target_link_options(${target} PUBLIC "LINKER:-Ttext-segment,${address}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_subdirectory(tools)
|
||||
|
||||
add_subdirectory(orbis-kernel)
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ add_executable(rpcsx-gpu
|
|||
target_include_directories(rpcsx-gpu PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(rpcsx-gpu PUBLIC amdgpu::bridge amdgpu::device glfw Vulkan::Vulkan rx)
|
||||
set_target_properties(rpcsx-gpu PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
target_link_options(rpcsx-os PUBLIC "LINKER:-Ttext-segment,0x0000060000000000")
|
||||
target_base_address(rpcsx-os 0x0000060000000000)
|
||||
install(TARGETS rpcsx-gpu RUNTIME DESTINATION bin)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ add_executable(rpcsx-os
|
|||
|
||||
target_include_directories(rpcsx-os PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(rpcsx-os PUBLIC orbis::kernel amdgpu::bridge rx libcrypto libunwind::unwind-x86_64 xbyak::xbyak)
|
||||
target_link_options(rpcsx-os PUBLIC "LINKER:-Ttext-segment,0x0000010000000000")
|
||||
target_base_address(rpcsx-os 0x0000010000000000)
|
||||
target_compile_options(rpcsx-os PRIVATE "-mfsgsbase")
|
||||
|
||||
set_target_properties(rpcsx-os PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
|
|
|||
Loading…
Reference in a new issue