CMakeLists.txt: Notify the user about position-independent code being unsupported only when it has been manually enabled

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-08-08 12:52:44 +02:00
parent fec8a2c4bd
commit 3e6b6f9560
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 2 deletions

View File

@ -28,8 +28,8 @@ if (CMAKE_CXX_LINK_PIE_SUPPORTED)
if (NOT USER_DEFINED_PIE)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
endif()
else()
message(NOTICE "Position-Independent Code (PIC) is not supported by the current toolchain")
elseif(USER_DEFINED_PIE AND CMAKE_POSITION_INDEPENDENT_CODE)
message(NOTICE "-- Could NOT manually enable Position-Independent Code (PIC) because it is not supported by the current toolchain")
endif()
set(CMAKE_CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS_RELEASE "-Os")