Skip to content

Commit 501579e

Browse files
committed
cmake: disable PIE for older cmake
1 parent 559b2d1 commit 501579e

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

CMakeLists.txt

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,30 +98,21 @@ pkg_check_modules(LIBUDEV REQUIRED IMPORTED_TARGET libudev)
9898
set(THREADS_PREFER_PTHREAD_FLAG ON)
9999
find_package(Threads REQUIRED)
100100

101-
# flutter-pi executable
102-
add_executable(
103-
flutter-pi
104-
src/main.c
105-
)
106-
107-
# If position independent code is selected, set it for the executable.
108101
if(POLICY CMP0083)
109102
cmake_policy(SET CMP0083 NEW)
110103

111104
include(CheckPIESupported)
112105
check_pie_supported()
113-
else()
114-
if (CMAKE_POSITION_INDEPENDENT_CODE)
115-
target_compile_options(flutter-pi PUBLIC -fPIE)
116-
target_link_options(flutter-pi PUBLIC -fPIE LINKER:-pie)
117-
else()
118-
target_compile_options(flutter-pi PUBLIC -fno-PIE)
119-
target_link_options(flutter-pi PUBLIC -fno-PIE LINKER:-no-pie)
120-
endif()
121106
endif()
122107

123108
message(STATUS "PIE .................... ${CMAKE_POSITION_INDEPENDENT_CODE}")
124109

110+
# flutter-pi executable
111+
add_executable(
112+
flutter-pi
113+
src/main.c
114+
)
115+
125116
# flutterpi_module
126117
# We separate the actual flutter-pi code into a separate object library
127118
# so we can link against it in the tests.

0 commit comments

Comments
 (0)