Check if PIE is supported on MSVC too in the CMakeLists.txt file.
This commit is contained in:
parent
11ea331d89
commit
b21c2ae643
|
@ -20,15 +20,18 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
|||
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
||||
set(CMAKE_CXX_FLAGS "-Wall")
|
||||
|
||||
if (NOT MSVC)
|
||||
if (CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
include(CheckPIESupported)
|
||||
if (CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
include(CheckPIESupported)
|
||||
if (NOT MSVC)
|
||||
add_link_options("-pie")
|
||||
check_pie_supported()
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||
endif ()
|
||||
check_pie_supported()
|
||||
endif()
|
||||
|
||||
if (NOT MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
|
||||
|
||||
if ((${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) OR (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang))
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0)
|
||||
|
|
Loading…
Reference in New Issue