Skip to content

Don't set -pie on shared objects #2660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ function(add_ur_target_link_options name)
if (UR_DEVELOPER_MODE)
target_link_options(${name} PRIVATE -Werror -Wextra)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_link_options(${name} PRIVATE
$<$<CXX_COMPILER_ID:GNU>:-pie>
)
endif()
endif()
elseif(MSVC)
target_link_options(${name} PRIVATE
Expand All @@ -176,7 +171,15 @@ function(add_ur_target_link_options name)
endfunction()

function(add_ur_target_exec_options name)
if(MSVC)
if(NOT MSVC)
if(NOT APPLE)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
target_link_options(${name} PRIVATE
$<$<CXX_COMPILER_ID:GNU>:-pie>
)
endif()
endif()
elseif(MSVC)
target_link_options(${name} PRIVATE
LINKER:/ALLOWISOLATION
)
Expand Down