Skip to content

Commit d06a8a3

Browse files
authored
[windows] Switch to GN for library build (#262)
Eliminates the VS-based embedder library build and updates the example to use the GN build. As part of the change, moves build output to example/build/windows_fde to match the recent change for Linux. Also eliminates the 'Dynamic Library' portion of the configuration names since they are relics of a distinction that was removed in an earlier change.
1 parent bb1319b commit d06a8a3

25 files changed

+214
-929
lines changed

.appveyor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ install:
2121
# of FDE, so for now clone master instead.
2222
#- ps: build\ci\install_flutter.ps1 $env:APPVEYOR_BUILD_FOLDER\..
2323
- git clone -b master https://github.com/flutter/flutter.git %APPVEYOR_BUILD_FOLDER%\..\flutter
24+
- ps: build\ci\windows\install_gn.ps1 "$env:APPVEYOR_BUILD_FOLDER\bin"
25+
- tools\run_dart_tool.bat fetch_jsoncpp %APPVEYOR_BUILD_FOLDER%\third_party\jsoncpp\src
2426

2527
build_script:
28+
- set "PATH=%APPVEYOR_BUILD_FOLDER%\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\;%PATH%"
29+
# With the GN build done, build the example.
2630
- msbuild "example\windows_fde\Example Embedder.sln"

build/ci/windows/install_gn.ps1

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
$GN_URI = 'https://chrome-infra-packages.appspot.com/dl/gn/gn/windows-amd64/+/latest'
16+
$NINJA_URI = 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip'
17+
$TEMP_LOCATION = '{0}\tool.zip' -f $env:temp
18+
19+
if (!(Test-Path $env:temp)) {
20+
New-Item -ItemType Directory -Path $env:temp | Out-Null
21+
}
22+
23+
Write-Output ('Installing GN tools to {0}' -f $args[0])
24+
25+
# Ninja download requires TLS 1.2
26+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
27+
28+
Write-Output ('Downloading {0}' -f $GN_URI)
29+
(New-Object System.Net.WebClient).DownloadFile($GN_URI, $TEMP_LOCATION)
30+
Expand-Archive $TEMP_LOCATION -DestinationPath $args[0]
31+
32+
Write-Output ('Downloading {0}' -f $NINJA_URI)
33+
(New-Object System.Net.WebClient).DownloadFile($NINJA_URI, $TEMP_LOCATION)
34+
Expand-Archive $TEMP_LOCATION -DestinationPath $args[0]

example/README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,14 @@ to a XIB in your own project:
6666

6767
### Windows
6868

69-
Open the `Example Embedder` Visual Studio solution file under `windows_fde\` and
70-
build the GLFW Example project.
69+
Open the `Example Embedder` Visual Studio solution file under `windows_fde\` to
70+
build and run the GLFW Example project.
7171

72-
The resulting binary will be in `bin\x64\$(Configuration)\GLFW Example\`. It
73-
currently uses relative paths so must be run from the `windows_fde\` directory:
72+
The resulting binary will be in
73+
`example\build\windows_fde\x64\$(Configuration)\GLFW Example\`. It currently
74+
uses relative paths so if you run it manually it must be run from the
75+
`example\windows_fde\` directory. E.g.:
7476

7577
```
76-
> ".\bin\x64\$(Configuration)\GLFW Example\GLFW Example.exe"
78+
> "..\build\windows_fde\x64\Debug\GLFW Example\GLFW Example.exe"
7779
```
78-
79-
e.g.:
80-
81-
```
82-
> ".\bin\x64\Debug Dynamic Library\GLFW Example\GLFW Example.exe"
83-
```
84-
85-
Or you can use Visual Studio's inbuilt debugger to build and run the
86-
example application automatically.
Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27703.2026
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLFW Example", "GLFW Example.vcxproj", "{5A827760-CF8B-408A-99A3-B6C0AD2271E7}"
7-
ProjectSection(ProjectDependencies) = postProject
8-
{90057FD8-9460-43A6-8CDF-3AAC1C4255E5} = {90057FD8-9460-43A6-8CDF-3AAC1C4255E5}
9-
EndProjectSection
10-
EndProject
11-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLFW Library", "..\..\library\windows\GLFW Library.vcxproj", "{90057FD8-9460-43A6-8CDF-3AAC1C4255E5}"
12-
EndProject
13-
Global
14-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15-
Debug Dynamic Library|x64 = Debug Dynamic Library|x64
16-
Release Dynamic Library|x64 = Release Dynamic Library|x64
17-
EndGlobalSection
18-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19-
{90057FD8-9460-43A6-8CDF-3AAC1C4255E5}.Debug Dynamic Library|x64.ActiveCfg = Debug Dynamic Library|x64
20-
{90057FD8-9460-43A6-8CDF-3AAC1C4255E5}.Debug Dynamic Library|x64.Build.0 = Debug Dynamic Library|x64
21-
{90057FD8-9460-43A6-8CDF-3AAC1C4255E5}.Release Dynamic Library|x64.ActiveCfg = Release Dynamic Library|x64
22-
{90057FD8-9460-43A6-8CDF-3AAC1C4255E5}.Release Dynamic Library|x64.Build.0 = Release Dynamic Library|x64
23-
{5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug Dynamic Library|x64.ActiveCfg = Debug Dynamic Library|x64
24-
{5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug Dynamic Library|x64.Build.0 = Debug Dynamic Library|x64
25-
{5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release Dynamic Library|x64.ActiveCfg = Release Dynamic Library|x64
26-
{5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release Dynamic Library|x64.Build.0 = Release Dynamic Library|x64
27-
EndGlobalSection
28-
GlobalSection(SolutionProperties) = preSolution
29-
HideSolutionNode = FALSE
30-
EndGlobalSection
31-
GlobalSection(ExtensibilityGlobals) = postSolution
32-
SolutionGuid = {6C8A8041-10D8-4BEB-B73D-C02BCE62120B}
33-
EndGlobalSection
34-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27703.2026
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLFW Example", "GLFW Example.vcxproj", "{5A827760-CF8B-408A-99A3-B6C0AD2271E7}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Release|x64 = Release|x64
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.ActiveCfg = Debug|x64
15+
{5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.Build.0 = Debug|x64
16+
{5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.ActiveCfg = Release|x64
17+
{5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.Build.0 = Release|x64
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {6C8A8041-10D8-4BEB-B73D-C02BCE62120B}
24+
EndGlobalSection
25+
EndGlobal

example/windows_fde/GLFW Example.vcxproj

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
4-
<ProjectConfiguration Include="Debug Dynamic Library|x64">
5-
<Configuration>Debug Dynamic Library</Configuration>
4+
<ProjectConfiguration Include="Debug|x64">
5+
<Configuration>Debug</Configuration>
66
<Platform>x64</Platform>
77
</ProjectConfiguration>
8-
<ProjectConfiguration Include="Release Dynamic Library|x64">
9-
<Configuration>Release Dynamic Library</Configuration>
8+
<ProjectConfiguration Include="Release|x64">
9+
<Configuration>Release</Configuration>
1010
<Platform>x64</Platform>
1111
</ProjectConfiguration>
1212
</ItemGroup>
@@ -17,13 +17,13 @@
1717
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
1818
</PropertyGroup>
1919
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
20-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Dynamic Library|x64'" Label="Configuration">
20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
2121
<ConfigurationType>Application</ConfigurationType>
2222
<UseDebugLibraries>true</UseDebugLibraries>
2323
<PlatformToolset>v141</PlatformToolset>
2424
<CharacterSet>MultiByte</CharacterSet>
2525
</PropertyGroup>
26-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Dynamic Library|x64'" Label="Configuration">
26+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
2727
<ConfigurationType>Application</ConfigurationType>
2828
<UseDebugLibraries>false</UseDebugLibraries>
2929
<PlatformToolset>v141</PlatformToolset>
@@ -35,54 +35,56 @@
3535
</ImportGroup>
3636
<ImportGroup Label="Shared">
3737
</ImportGroup>
38-
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug Dynamic Library|x64'">
38+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
3939
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
4040
</ImportGroup>
41-
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release Dynamic Library|x64'">
41+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
4242
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
4343
</ImportGroup>
4444
<PropertyGroup Label="UserMacros" />
45-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Dynamic Library|x64'">
46-
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
47-
<IntDir>$(SolutionDir)bin\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
48-
<IncludePath>$(ProjectDir)..\..\library\windows\dependencies\;$(ProjectDir)..\..\;$(IncludePath);$(ProjectDir)..\..\library\windows\;$(ProjectDir)..\..\library\include\;$(ProjectDir)..\..\library\common\client_wrapper\include\</IncludePath>
49-
<LibraryPath>$(ProjectDir)..\..\library\windows\dependencies\GLFW\;$(SolutionDir)bin\$(Platform)\$(Configuration)\GLFW Library\;$(LibraryPath)</LibraryPath>
45+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
46+
<OutDir>$(ProjectDir)..\build\windows_fde\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
47+
<IntDir>$(ProjectDir)..\build\windows_fde\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
48+
<IncludePath>$(ProjectDir)..\..\;$(IncludePath);$(ProjectDir)..\..\out\include\;$(ProjectDir)..\..\out\fde_cpp_wrapper\include</IncludePath>
49+
<LibraryPath>$(ProjectDir)..\..\out;$(ProjectDir)..\..\out\gen\glfw\GLFW\;$(LibraryPath)</LibraryPath>
5050
</PropertyGroup>
51-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Dynamic Library|x64'">
52-
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
53-
<IntDir>$(SolutionDir)bin\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
54-
<IncludePath>$(ProjectDir)..\..\library\windows\dependencies\;$(ProjectDir)..\..\;$(IncludePath);$(ProjectDir)..\..\library\windows\;$(ProjectDir)..\..\library\include\;$(ProjectDir)..\..\library\common\client_wrapper\include\</IncludePath>
55-
<LibraryPath>$(ProjectDir)..\..\library\windows\dependencies\GLFW\;$(SolutionDir)bin\$(Platform)\$(Configuration)\GLFW Library\;$(LibraryPath)</LibraryPath>
51+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
52+
<OutDir>$(ProjectDir)..\build\windows_fde\$(Platform)\$(Configuration)\$(ProjectName)\</OutDir>
53+
<IntDir>$(ProjectDir)..\build\windows_fde\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
54+
<IncludePath>$(ProjectDir)..\..\;$(IncludePath);$(ProjectDir)..\..\out\include\;$(ProjectDir)..\..\out\fde_cpp_wrapper\include</IncludePath>
55+
<LibraryPath>$(ProjectDir)..\..\out;$(ProjectDir)..\..\out\gen\glfw\GLFW\;$(LibraryPath)</LibraryPath>
5656
</PropertyGroup>
57-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Dynamic Library|x64'">
57+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
5858
<ClCompile>
5959
<WarningLevel>Level3</WarningLevel>
6060
<Optimization>Disabled</Optimization>
6161
<SDLCheck>true</SDLCheck>
6262
<ConformanceMode>true</ConformanceMode>
6363
<AdditionalIncludeDirectories>
6464
</AdditionalIncludeDirectories>
65-
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);USE_FDE_TREE_PATHS</PreprocessorDefinitions>
65+
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
6666
</ClCompile>
6767
<Link>
68-
<AdditionalDependencies>flutter_embedder.lib;glfw3.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
68+
<AdditionalDependencies>flutter_embedder.dll.lib;glfw3.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
6969
</Link>
7070
<PreBuildEvent>
71-
<Command>$(ProjectDir)scripts\build_example_app</Command>
72-
<Message>Build the example app</Message>
71+
<Command>$(ProjectDir)scripts\run_gn_build</Command>
72+
<Message>Run the embedder library's GN build</Message>
7373
</PreBuildEvent>
7474
<PreLinkEvent>
75-
<Command>xcopy /y /d /q "$(OutputPath)..\GLFW Library\flutter_engine.dll" "$(OutputPath)"</Command>
76-
<Message>Get the flutter_engine.dll file from GLFW Library bin folder</Message>
75+
<Command>
76+
</Command>
77+
<Message>
78+
</Message>
7779
</PreLinkEvent>
7880
<PostBuildEvent>
79-
<Command>xcopy /y /d /q "$(OutputPath)..\GLFW Library\flutter_embedder.dll" "$(OutputPath)"</Command>
81+
<Command>$(ProjectDir)scripts\build_example_app "$(OutputPath)"</Command>
8082
</PostBuildEvent>
8183
<PostBuildEvent>
82-
<Message>Copy flutter_embedder.dll from library out to example out dir</Message>
84+
<Message>Construct a runnable example from the various outputs</Message>
8385
</PostBuildEvent>
8486
</ItemDefinitionGroup>
85-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Dynamic Library|x64'">
87+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8688
<ClCompile>
8789
<WarningLevel>Level3</WarningLevel>
8890
<Optimization>MaxSpeed</Optimization>
@@ -92,39 +94,36 @@
9294
<ConformanceMode>true</ConformanceMode>
9395
<AdditionalIncludeDirectories>
9496
</AdditionalIncludeDirectories>
95-
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions);USE_FDE_TREE_PATHS</PreprocessorDefinitions>
97+
<PreprocessorDefinitions>_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
9698
</ClCompile>
9799
<Link>
98100
<EnableCOMDATFolding>true</EnableCOMDATFolding>
99101
<OptimizeReferences>true</OptimizeReferences>
100-
<AdditionalDependencies>flutter_embedder.lib;glfw3.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
102+
<AdditionalDependencies>flutter_embedder.dll.lib;glfw3.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
101103
</Link>
102104
<PreBuildEvent>
103-
<Command>$(ProjectDir)scripts\build_example_app</Command>
104-
<Message>Build the example app</Message>
105+
<Command>$(ProjectDir)scripts\run_gn_build</Command>
106+
<Message>Run the embedder library's GN build</Message>
105107
</PreBuildEvent>
106108
<PreLinkEvent>
107-
<Command>xcopy /y /d /q "$(OutputPath)..\GLFW Library\flutter_engine.dll" "$(OutputPath)"</Command>
108-
<Message>Get the flutter_engine.dll file from GLFW Library bin folder</Message>
109+
<Command>
110+
</Command>
111+
<Message>
112+
</Message>
109113
</PreLinkEvent>
110114
<PostBuildEvent>
111-
<Command>xcopy /y /d /q "$(OutputPath)..\GLFW Library\flutter_embedder.dll" "$(OutputPath)"</Command>
115+
<Command>$(ProjectDir)scripts\build_example_app "$(OutputPath)"</Command>
112116
</PostBuildEvent>
113117
<PostBuildEvent>
114-
<Message>Copy flutter_embedder.dll from library out to example out dir</Message>
118+
<Message>Construct a runnable example from the various outputs</Message>
115119
</PostBuildEvent>
116120
</ItemDefinitionGroup>
117121
<ItemGroup>
118-
<ClCompile Include="..\..\library\common\client_wrapper\src\engine_method_result.cc" />
119-
<ClCompile Include="..\..\library\common\client_wrapper\src\glfw\flutter_window_controller.cc" />
120-
<ClCompile Include="..\..\library\common\client_wrapper\src\plugin_handler.cc" />
122+
<ClCompile Include="..\..\out\fde_cpp_wrapper\engine_method_result.cc" />
123+
<ClCompile Include="..\..\out\fde_cpp_wrapper\flutter_window_controller.cc" />
124+
<ClCompile Include="..\..\out\fde_cpp_wrapper\plugin_handler.cc" />
121125
<ClCompile Include="flutter_embedder_example.cpp" />
122126
</ItemGroup>
123-
<ItemGroup>
124-
<ProjectReference Include="..\..\library\windows\GLFW Library.vcxproj">
125-
<Project>{90057fd8-9460-43a6-8cdf-3aac1c4255e5}</Project>
126-
</ProjectReference>
127-
</ItemGroup>
128127
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
129128
<ImportGroup Label="ExtensionTargets">
130129
</ImportGroup>

example/windows_fde/GLFW Example.vcxproj.filters

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,14 @@
2121
<ClCompile Include="flutter_embedder_example.cpp">
2222
<Filter>Source Files</Filter>
2323
</ClCompile>
24-
<ClCompile Include="..\..\library\common\client_wrapper\src\engine_method_result.cc">
24+
<ClCompile Include="..\..\out\fde_cpp_wrapper\engine_method_result.cc">
2525
<Filter>Source Files\Client Wrapper</Filter>
2626
</ClCompile>
27-
<ClCompile Include="..\..\library\common\client_wrapper\src\glfw\flutter_window_controller.cc">
27+
<ClCompile Include="..\..\out\fde_cpp_wrapper\flutter_window_controller.cc">
2828
<Filter>Source Files\Client Wrapper</Filter>
2929
</ClCompile>
30-
<ClCompile Include="..\..\library\common\client_wrapper\src\json_message_codec.cc">
31-
<Filter>Source Files\Client Wrapper</Filter>
32-
</ClCompile>
33-
<ClCompile Include="..\..\library\common\client_wrapper\src\json_method_codec.cc">
34-
<Filter>Source Files\Client Wrapper</Filter>
35-
</ClCompile>
36-
<ClCompile Include="..\..\library\common\client_wrapper\src\plugin_handler.cc">
30+
<ClCompile Include="..\..\out\fde_cpp_wrapper\plugin_handler.cc">
3731
<Filter>Source Files\Client Wrapper</Filter>
3832
</ClCompile>
3933
</ItemGroup>
40-
</Project>
34+
</Project>

example/windows_fde/flutter_embedder_example.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
#include <string>
1717
#include <vector>
1818

19-
#include "flutter_desktop_embedding/glfw/flutter_window_controller.h"
19+
#include "flutter_desktop_embedding/flutter_window_controller.h"
2020

2121
int main(int argc, char **argv) {
2222
// TODO: Make paths relative to the executable so it can be run from anywhere.
2323
std::string assets_path = "..\\build\\flutter_assets";
24-
std::string icu_data_path =
25-
"..\\..\\library\\windows\\dependencies\\engine\\icudtl.dat";
24+
std::string icu_data_path = "..\\build\\windows_fde\\icudtl.dat";
2625

2726
// Arguments for the Flutter Engine.
2827
std::vector<std::string> arguments;

example/windows_fde/scripts/build_example_app.bat

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,28 @@
1212
:: See the License for the specific language governing permissions and
1313
:: limitations under the License.
1414
@echo off
15-
%~dp0..\..\..\tools\build_flutter_assets %~dp0..\..
15+
16+
set FDE_ROOT=%~dp0..\..\..
17+
set FLUTTER_APP_DIR=%~dp0..\..
18+
set RUNNER_OUT_DIR=%FLUTTER_APP_DIR%\build\windows_fde
19+
set TOOLS_DIR=%FDE_ROOT%\tools
20+
set GN_OUT_DIR=%FDE_ROOT%\out
21+
for /f "delims=" %%i in ('%TOOLS_DIR%\flutter_location') do set FLUTTER_DIR=%%i
22+
23+
:: Build the Flutter assets.
24+
call %TOOLS_DIR%\build_flutter_assets %FLUTTER_APP_DIR%
25+
if %errorlevel% neq 0 exit /b %errorlevel%
26+
27+
:: TODO: Change the paths below, and add the exe, to make a self-contained bundle,
28+
:: as is done on Linux.
29+
30+
:: Copy the icudtl.dat file from the Flutter tree to the runner directory.
31+
call xcopy /y /d /q %FLUTTER_DIR%\bin\cache\artifacts\engine\windows-x64\icudtl.dat %RUNNER_OUT_DIR%
32+
if %errorlevel% neq 0 exit /b %errorlevel%
33+
34+
:: Copy the embedder DLLs to the target location provided to the script.
35+
call xcopy /y /d /q %GN_OUT_DIR%\flutter_engine.dll %*
36+
if %errorlevel% neq 0 exit /b %errorlevel%
37+
call xcopy /y /d /q %GN_OUT_DIR%\flutter_embedder.dll %*
38+
if %errorlevel% neq 0 exit /b %errorlevel%
39+

0 commit comments

Comments
 (0)