Skip to content

Commit

Permalink
fixup! cmake: Add position independent code support
Browse files Browse the repository at this point in the history
PIC/PIE is not a thing in Windows PE format. Therefore, warnings are
rather making noise than providing valuable feedback.
  • Loading branch information
hebasto committed Dec 11, 2023
1 parent 2af94fb commit 52447c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ include(CheckPIESupported)
check_pie_supported(OUTPUT_VARIABLE check_pie_output LANGUAGES CXX)
if(CMAKE_CXX_LINK_PIE_SUPPORTED)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
else()
elseif(NOT WIN32)
# The warning is superfluous for Windows.
message(WARNING "PIE is not supported at link time: ${check_pie_output}")
list(APPEND configure_warnings "Position independent code disabled.")
endif()
Expand Down

0 comments on commit 52447c3

Please sign in to comment.