From 92180ffcb86b659ede4ef04c5d81395dab0609bf Mon Sep 17 00:00:00 2001 From: DH Date: Wed, 25 Sep 2024 22:18:04 +0300 Subject: [PATCH] Fix linkage if PIE is default --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8feb91be7..1553ffa9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,8 @@ function(add_precompiled_vulkan_spirv target) endfunction() function(target_base_address target address) + set_target_properties(${target} PROPERTIES POSITION_INDEPENDENT_CODE off) + if(CMAKE_CXX_COMPILER_LINKER_ID MATCHES "^(LLD|MOLD)$") target_link_options(${target} PUBLIC "LINKER:--image-base=${address}") else()