Skip to content

Commit 45e4d63

Browse files
committed
recreate windows example project.
1 parent a13be4e commit 45e4d63

19 files changed

+453
-320
lines changed

example/.metadata

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,42 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 67826bdce54505760fe83b7ead70bdb5af6fe9f2
8-
channel: dev
7+
revision: "a402d9a4376add5bc2d6b1e33e53edaae58c07f8"
8+
channel: "stable"
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
17+
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
18+
- platform: android
19+
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
20+
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
21+
- platform: ios
22+
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
23+
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
24+
- platform: linux
25+
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
26+
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
27+
- platform: macos
28+
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
29+
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
30+
- platform: web
31+
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
32+
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
33+
- platform: windows
34+
create_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
35+
base_revision: a402d9a4376add5bc2d6b1e33e53edaae58c07f8
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/pubspec.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
path: ".."
88
relative: true
99
source: path
10-
version: "1.0.0+1"
10+
version: "1.0.0+2"
1111
argon2_ffi_base:
1212
dependency: "direct main"
1313
description:
@@ -86,26 +86,26 @@ packages:
8686
dependency: transitive
8787
description:
8888
name: leak_tracker
89-
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
89+
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
9090
url: "https://pub.dev"
9191
source: hosted
92-
version: "10.0.9"
92+
version: "11.0.2"
9393
leak_tracker_flutter_testing:
9494
dependency: transitive
9595
description:
9696
name: leak_tracker_flutter_testing
97-
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
97+
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
9898
url: "https://pub.dev"
9999
source: hosted
100-
version: "3.0.9"
100+
version: "3.0.10"
101101
leak_tracker_testing:
102102
dependency: transitive
103103
description:
104104
name: leak_tracker_testing
105-
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
105+
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
106106
url: "https://pub.dev"
107107
source: hosted
108-
version: "3.0.1"
108+
version: "3.0.2"
109109
logging:
110110
dependency: transitive
111111
description:
@@ -195,18 +195,18 @@ packages:
195195
dependency: transitive
196196
description:
197197
name: test_api
198-
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
198+
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
199199
url: "https://pub.dev"
200200
source: hosted
201-
version: "0.7.4"
201+
version: "0.7.6"
202202
vector_math:
203203
dependency: transitive
204204
description:
205205
name: vector_math
206-
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
206+
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
207207
url: "https://pub.dev"
208208
source: hosted
209-
version: "2.1.4"
209+
version: "2.2.0"
210210
vm_service:
211211
dependency: transitive
212212
description:
@@ -216,5 +216,5 @@ packages:
216216
source: hosted
217217
version: "15.0.0"
218218
sdks:
219-
dart: ">=3.7.0 <4.0.0"
219+
dart: ">=3.8.0-0 <4.0.0"
220220
flutter: ">=3.18.0-18.0.pre.54"

example/windows/CMakeLists.txt

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
# Project-level configuration.
2+
cmake_minimum_required(VERSION 3.14)
23
project(argon2_ffi_example LANGUAGES CXX)
34

5+
# The name of the executable created for the application. Change this to change
6+
# the on-disk name of your application.
47
set(BINARY_NAME "argon2_ffi_example")
58

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)
712

8-
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
9-
10-
# Configure build options.
13+
# Define build configuration option.
1114
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
1215
if(IS_MULTICONFIG)
1316
set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
@@ -20,7 +23,7 @@ else()
2023
"Debug" "Profile" "Release")
2124
endif()
2225
endif()
23-
26+
# Define settings for the Profile build mode.
2427
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
2528
set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
2629
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
@@ -30,6 +33,10 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
3033
add_definitions(-DUNICODE -D_UNICODE)
3134

3235
# 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.
3340
function(APPLY_STANDARD_SETTINGS TARGET)
3441
target_compile_features(${TARGET} PUBLIC cxx_std_17)
3542
target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
@@ -38,14 +45,14 @@ function(APPLY_STANDARD_SETTINGS TARGET)
3845
target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")
3946
endfunction()
4047

41-
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
42-
4348
# Flutter library and tool build rules.
49+
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
4450
add_subdirectory(${FLUTTER_MANAGED_DIR})
4551

46-
# Application build
52+
# Application build; see runner/CMakeLists.txt.
4753
add_subdirectory("runner")
4854

55+
4956
# Generated plugin build rules, which manage building the plugins and adding
5057
# them to the application.
5158
include(flutter/generated_plugins.cmake)
@@ -80,6 +87,12 @@ if(PLUGIN_BUNDLED_LIBRARIES)
8087
COMPONENT Runtime)
8188
endif()
8289

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+
8396
# Fully re-copy the assets directory on each build to avoid having stale files
8497
# from a previous install.
8598
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")

example/windows/flutter/.template_version

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/windows/flutter/CMakeLists.txt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
# This file controls Flutter-level build steps. It should not be edited.
2+
cmake_minimum_required(VERSION 3.14)
23

34
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
45

@@ -9,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
910
# https://github.com/flutter/flutter/issues/57146.
1011
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
1112

13+
# Set fallback configurations for older versions of the flutter tool.
14+
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
15+
set(FLUTTER_TARGET_PLATFORM "windows-x64")
16+
endif()
17+
1218
# === Flutter Library ===
1319
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
1420

@@ -23,6 +29,7 @@ list(APPEND FLUTTER_LIBRARY_HEADERS
2329
"flutter_windows.h"
2430
"flutter_messenger.h"
2531
"flutter_plugin_registrar.h"
32+
"flutter_texture_registrar.h"
2633
)
2734
list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
2835
add_library(flutter INTERFACE)
@@ -34,15 +41,16 @@ add_dependencies(flutter flutter_assemble)
3441

3542
# === Wrapper ===
3643
list(APPEND CPP_WRAPPER_SOURCES_CORE
37-
"engine_method_result.cc"
38-
"standard_codec.cc"
44+
"core_implementations.cc"
45+
"standard_codec.cc"
3946
)
4047
list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
4148
list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
4249
"plugin_registrar.cc"
4350
)
4451
list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
4552
list(APPEND CPP_WRAPPER_SOURCES_APP
53+
"flutter_engine.cc"
4654
"flutter_view_controller.cc"
4755
)
4856
list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
@@ -79,15 +87,18 @@ add_dependencies(flutter_wrapper_app flutter_assemble)
7987
# _phony_ is a non-existent file to force this command to run every time,
8088
# since currently there's no way to get a full input/output list from the
8189
# flutter tool.
90+
set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
91+
set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
8292
add_custom_command(
8393
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
8494
${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
8595
${CPP_WRAPPER_SOURCES_APP}
86-
${CMAKE_CURRENT_BINARY_DIR}/_phony_
96+
${PHONY_OUTPUT}
8797
COMMAND ${CMAKE_COMMAND} -E env
8898
${FLUTTER_TOOL_ENVIRONMENT}
8999
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
90-
windows-x64 $<CONFIG>
100+
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
101+
VERBATIM
91102
)
92103
add_custom_target(flutter_assemble DEPENDS
93104
"${FLUTTER_LIBRARY}"
Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
cmake_minimum_required(VERSION 3.14)
22
project(runner LANGUAGES CXX)
33

4+
# Define the application target. To change its name, change BINARY_NAME in the
5+
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6+
# work.
7+
#
8+
# Any new source files that you add to the application should be added here.
49
add_executable(${BINARY_NAME} WIN32
510
"flutter_window.cpp"
611
"main.cpp"
7-
"run_loop.cpp"
812
"utils.cpp"
913
"win32_window.cpp"
10-
"window_configuration.cpp"
1114
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
1215
"Runner.rc"
1316
"runner.exe.manifest"
1417
)
18+
19+
# Apply the standard set of build settings. This can be removed for applications
20+
# that need different build settings.
1521
apply_standard_settings(${BINARY_NAME})
22+
23+
# Add preprocessor definitions for the build version.
24+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28+
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29+
30+
# Disable Windows macros that collide with C++ standard library functions.
31+
target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
32+
33+
# Add dependency libraries and include directories. Add any application-specific
34+
# dependencies here.
1635
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36+
target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
1737
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
38+
39+
# Run the Flutter tool portions of the build. This must not be removed.
1840
add_dependencies(${BINARY_NAME} flutter_assemble)

0 commit comments

Comments
 (0)