Skip to content

Commit c1dd764

Browse files
committed
cmake: always set SENTRY_PIC as cache
1 parent 38798ba commit c1dd764

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

CMakeLists.txt

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@
2525

2626
cmake_minimum_required(VERSION 3.10.0)
2727

28-
if(NOT CMAKE_BUILD_TYPE)
29-
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug, Release, or MinSizeRel." FORCE)
30-
message(STATUS "CMAKE_BUILD_TYPE not set, defaulting to Release.")
31-
endif()
32-
33-
project(flutter-pi LANGUAGES C CXX ASM VERSION "1.0.0")
34-
35-
message(STATUS "Generator .............. ${CMAKE_GENERATOR}")
36-
message(STATUS "Build Type ............. ${CMAKE_BUILD_TYPE}")
37-
3828
# configure options
3929
option(BUILD_TEXT_INPUT_PLUGIN "Include the text input plugin in the finished binary. Enables text input (to flutter text fields, for example) via attached keyboards." ON)
4030
option(BUILD_RAW_KEYBOARD_PLUGIN "Include the raw keyboard plugin in the finished binary. Enables raw keycode listening in flutter via the flutter RawKeyboard interface." ON)
@@ -82,6 +72,22 @@ option(SENTRY_PLUGIN_BUNDLE_CRASHPAD_HANDLER "Bundle the crashpad_handler with t
8272

8373
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
8474

75+
if(NOT CMAKE_BUILD_TYPE)
76+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug, Release, or MinSizeRel." FORCE)
77+
message(STATUS "CMAKE_BUILD_TYPE not set, defaulting to Release.")
78+
endif()
79+
80+
if (BUILD_SENTRY_PLUGIN)
81+
set(flutterpi_languages C CXX ASM)
82+
else()
83+
set(flutterpi_languages C ASM)
84+
endif()
85+
86+
project(flutter-pi LANGUAGES ${flutterpi_languages} VERSION "1.0.0")
87+
88+
message(STATUS "Generator .............. ${CMAKE_GENERATOR}")
89+
message(STATUS "Build Type ............. ${CMAKE_BUILD_TYPE}")
90+
8591
include(CheckCCompilerFlag)
8692

8793
# Those libraries we definitely need.
@@ -376,12 +382,7 @@ endif()
376382
# Sentry Plugin
377383
set(HAVE_BUNDLED_CRASHPAD_HANDLER OFF)
378384
if (BUILD_SENTRY_PLUGIN)
379-
if (POLICY CMP0077)
380-
cmake_policy(SET CMP0077 NEW)
381-
set(SENTRY_PIC ${CMAKE_POSITION_INDEPENDENT_CODE})
382-
else()
383-
set(SENTRY_PIC ${CMAKE_POSITION_INDEPENDENT_CODE} CACHE BOOL)
384-
endif()
385+
set(SENTRY_PIC ${CMAKE_POSITION_INDEPENDENT_CODE} CACHE BOOL "")
385386
add_subdirectory(third_party/sentry-native)
386387

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

0 commit comments

Comments
 (0)