CMakeLists.txt: Don't set CMAKE_POSITION_INDEPENDENT_CODE to TRUE if it is already defined
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
efe7d8ca57
commit
510e7a24f3
|
@ -24,7 +24,9 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
include(CheckPIESupported)
|
include(CheckPIESupported)
|
||||||
check_pie_supported(LANGUAGES CXX)
|
check_pie_supported(LANGUAGES CXX)
|
||||||
if (CMAKE_CXX_LINK_PIE_SUPPORTED)
|
if (CMAKE_CXX_LINK_PIE_SUPPORTED)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(NOTICE "Position-Independent Code (PIC) is not supported by the current toolchain")
|
message(NOTICE "Position-Independent Code (PIC) is not supported by the current toolchain")
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue