File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -80,9 +80,8 @@ option(SENTRY_PLUGIN_BUNDLE_CRASHPAD_HANDLER "Bundle the crashpad_handler with t
8080
8181set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
8282
83- include (ExternalProject)
8483include (CheckCCompilerFlag)
85- include (FetchContent )
84+ include (CheckPIESupported )
8685
8786# Those libraries we definitely need.
8887include (FindPkgConfig)
@@ -97,11 +96,23 @@ pkg_check_modules(LIBUDEV REQUIRED IMPORTED_TARGET libudev)
9796set (THREADS_PREFER_PTHREAD_FLAG ON )
9897find_package (Threads REQUIRED)
9998
99+ # flutter-pi executable
100100add_executable (
101101 flutter-pi
102102 src/main.c
103103)
104104
105+ # disable PIE for the main executable
106+ check_pie_supported(OUTPUT_VARIABLE CHECK_PIE_SUPPORTED_OUTPUT LANGUAGES CXX)
107+ set_property (TARGET flutter-pi PROPERTY POSITION_INDEPENDENT_CODE TRUE )
108+ if (NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
109+ message (WARNING "PIE is not supported at link time: ${CHECK_PIE_SUPPORTED_OUTPUT} .\n "
110+ "PIE link options will not be passed to linker." )
111+ endif ()
112+
113+ # flutterpi_module
114+ # We separate the actual flutter-pi code into a separate object library
115+ # so we can link against it in the tests.
105116add_library (
106117 flutterpi_module OBJECT
107118 src/flutter-pi.c
@@ -130,6 +141,9 @@ add_library(
130141 src/plugins/services.c
131142)
132143
144+ # Disable PIC again just to make sure.
145+ set_property (TARGET flutterpi_module PROPERTY POSITION_INDEPENDENT_CODE OFF )
146+
133147target_link_libraries (flutterpi_module PUBLIC
134148 PkgConfig::DRM
135149 PkgConfig::GBM
You can’t perform that action at this time.
0 commit comments