1
- cmake_minimum_required (VERSION 3.15)
1
+ # Project-level configuration.
2
+ cmake_minimum_required (VERSION 3.14)
2
3
project (sentry_flutter_example LANGUAGES CXX)
3
4
5
+ # The name of the executable created for the application. Change this to change
6
+ # the on-disk name of your application.
4
7
set (BINARY_NAME "sentry_flutter_example" )
5
8
6
- cmake_policy (SET CMP0063 NEW)
9
+ # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10
+ # versions of CMake.
11
+ cmake_policy (VERSION 3.14...3.25)
7
12
8
- set (CMAKE_INSTALL_RPATH "$ORIGIN/lib" )
9
-
10
- # Configure build options.
13
+ # Define build configuration option.
11
14
get_property (IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
12
15
if (IS_MULTICONFIG)
13
16
set (CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
20
23
"Debug" "Profile" "Release" )
21
24
endif ()
22
25
endif ()
23
-
26
+ # Define settings for the Profile build mode.
24
27
set (CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} " )
25
28
set (CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} " )
26
29
set (CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} " )
@@ -30,6 +33,10 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
30
33
add_definitions (-DUNICODE -D_UNICODE)
31
34
32
35
# Compilation settings that should be applied to most targets.
36
+ #
37
+ # Be cautious about adding new options here, as plugins use this function by
38
+ # default. In most cases, you should add new options to specific targets instead
39
+ # of modifying this function.
33
40
function (APPLY_STANDARD_SETTINGS TARGET )
34
41
target_compile_features (${TARGET} PUBLIC cxx_std_17)
35
42
target_compile_options (${TARGET} PRIVATE /W4 /WX /wd"4100" )
@@ -38,14 +45,14 @@ function(APPLY_STANDARD_SETTINGS TARGET)
38
45
target_compile_definitions (${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>" )
39
46
endfunction ()
40
47
41
- set (FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR} /flutter" )
42
-
43
48
# Flutter library and tool build rules.
49
+ set (FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR} /flutter" )
44
50
add_subdirectory (${FLUTTER_MANAGED_DIR} )
45
51
46
- # Application build
52
+ # Application build; see runner/CMakeLists.txt.
47
53
add_subdirectory ("runner" )
48
54
55
+
49
56
# Generated plugin build rules, which manage building the plugins and adding
50
57
# them to the application.
51
58
include (flutter/generated_plugins.cmake)
@@ -80,6 +87,12 @@ if(PLUGIN_BUNDLED_LIBRARIES)
80
87
COMPONENT Runtime)
81
88
endif ()
82
89
90
+ # Copy the native assets provided by the build.dart from all packages.
91
+ set (NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR} native_assets/windows/" )
92
+ install (DIRECTORY "${NATIVE_ASSETS_DIR} "
93
+ DESTINATION "${INSTALL_BUNDLE_LIB_DIR} "
94
+ COMPONENT Runtime)
95
+
83
96
# Fully re-copy the assets directory on each build to avoid having stale files
84
97
# from a previous install.
85
98
set (FLUTTER_ASSET_DIR_NAME "flutter_assets" )
0 commit comments