Skip to content

Commit 559b2d1

Browse files
committed
cmake: further shuffle PIE args around
1 parent 1326d81 commit 559b2d1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# SOFTWARE.
2424
#
2525

26-
cmake_minimum_required(VERSION 3.13.4)
26+
cmake_minimum_required(VERSION 3.10.0)
2727

2828
if(NOT CMAKE_BUILD_TYPE)
2929
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug, Release, or MinSizeRel." FORCE)
@@ -112,7 +112,11 @@ if(POLICY CMP0083)
112112
check_pie_supported()
113113
else()
114114
if (CMAKE_POSITION_INDEPENDENT_CODE)
115-
target_link_options(flutter-pi PUBLIC -fPIE)
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)
116120
endif()
117121
endif()
118122

@@ -382,7 +386,12 @@ endif()
382386
# Sentry Plugin
383387
set(HAVE_BUNDLED_CRASHPAD_HANDLER OFF)
384388
if (BUILD_SENTRY_PLUGIN)
385-
set(SENTRY_PIC ${CMAKE_POSITION_INDEPENDENT_CODE})
389+
if (POLICY CMP0077)
390+
cmake_policy(SET CMP0077 NEW)
391+
set(SENTRY_PIC ${CMAKE_POSITION_INDEPENDENT_CODE})
392+
else()
393+
set(SENTRY_PIC ${CMAKE_POSITION_INDEPENDENT_CODE} CACHE BOOL)
394+
endif()
386395
add_subdirectory(third_party/sentry-native)
387396

388397
target_sources(flutterpi_module PRIVATE src/plugins/sentry/sentry.c)

0 commit comments

Comments
 (0)