np . Libraries . Add ( c = > IsWindows ( c ) , new BagOfObjectFilesLibrary (
new NPath [ ] {
skia Root + "/third_party/externals /icu/flutter/icudtl.o"
flutter Root + "/third_party/icu/flutter/icudtl.o"
} ) ) ;
np . CompilerSettings ( ) . Add ( c = > c . WithCppLanguageVersion ( CppLanguageVersion . Cpp17 ) ) ;
np . CompilerSettings ( ) . Add ( c = > IsMac ( c ) , c = > c . WithCustomFlags ( new [ ] { "-Wno-c++11-narrowing" } ) ) ;
return np ;
}
static void SetupFml ( NativeProgram np )
{
np . Defines . Add ( c = > IsWindows ( c ) , new [ ]
{
// gn desc out\host_debug_unopt\ //flutter/fml:fml_lib defines
"USE_OPENSSL=1" ,
"__STD_C" ,
"_CRT_RAND_S" ,
"_CRT_SECURE_NO_DEPRECATE" ,
"_HAS_EXCEPTIONS=0" ,
"_SCL_SECURE_NO_DEPRECATE" ,
"WIN32_LEAN_AND_MEAN" ,
"NOMINMAX" ,
"_ATL_NO_OPENGL" ,
"_WINDOWS" ,
"CERT_CHAIN_PARA_HAS_EXTRA_FIELDS" ,
"NTDDI_VERSION=0x06030000" ,
"PSAPI_VERSION=1" ,
"WIN32" ,
"_SECURE_ATL" ,
"_USING_V110_SDK71_" ,
"_UNICODE" ,
"UNICODE" ,
"_WIN32_WINNT=0x0603" ,
"WINVER=0x0603" ,
"_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS" ,
"_DEBUG" ,
"FLUTTER_RUNTIME_MODE_DEBUG=1" ,
"FLUTTER_RUNTIME_MODE_PROFILE=2" ,
"FLUTTER_RUNTIME_MODE_RELEASE=3" ,
"FLUTTER_RUNTIME_MODE_JIT_RELEASE=4" ,
"FLUTTER_RUNTIME_MODE=1" ,
"FLUTTER_JIT_RUNTIME=1" ,
} ) ;
np . Defines . Add ( c = > IsMac ( c ) , new [ ]
{
"USE_OPENSSL=1" ,
"__STDC_CONSTANT_MACROS" ,
"__STDC_FORMAT_MACROS" ,
"_FORTIFY_SOURCE=2" ,
"_LIBCPP_DISABLE_AVAILABILITY=1" ,
"_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS" ,
"_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS" ,
"_DEBUG" ,
"FLUTTER_RUNTIME_MODE_DEBUG=1" ,
"FLUTTER_RUNTIME_MODE_PROFILE=2" ,
"FLUTTER_RUNTIME_MODE_RELEASE=3" ,
"FLUTTER_RUNTIME_MODE_JIT_RELEASE=4" ,
"FLUTTER_RUNTIME_MODE=1" ,
"FLUTTER_JIT_RUNTIME=1"
} ) ;
np . IncludeDirectories . Add ( flutterRoot ) ;
var fmlLibPath = flutterRoot + "/out/host_debug_unopt" ;
np . Libraries . Add ( c = > IsWindows ( c ) , c = > {
return new PrecompiledLibrary [ ]
{
new StaticLibrary ( fmlLibPath + "/obj/flutter/fml/fml_lib.lib" ) ,
new SystemLibrary ( "Rpcrt4.lib" ) ,
} ;
} ) ;
np . Libraries . Add ( c = > IsMac ( c ) , c = > {
return new PrecompiledLibrary [ ]
{
new StaticLibrary ( fmlLibPath + "/obj/flutter/fml/libfml_lib.a" ) ,
new SystemFramework ( "Foundation" ) ,
} ;
} ) ;
}
var ignoreWarnigs = new string [ ] { "4244" , "4267" , "5030" , "4101" , "4996" , "4359" , "4018" , "4091" , "4722" , "4312" , "4838" , "4172" , "4005" , "4311" , "4477" } ; // todo comparing the list with engine
np . CompilerSettings ( ) . Add ( c = > IsWindows ( c ) , s = > s . WithWarningPolicies ( ignoreWarnigs . Select ( ( code ) = > new WarningAndPolicy ( code , WarningPolicy . Silent ) ) . ToArray ( ) ) ) ;
np . Defines . Add ( c = > IsMac ( c ) , new [ ]
{
"ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC"
} ) ;
np . IncludeDirectories . Add ( c = > IsWindows ( c ) , new NPath [ ] {
"." ,
"third_party" ,
"src" ,
flutterRoot ,
flutterRoot + "/third_party/rapidjson/include" ,
flutterRoot + "/third_party/angle/include" ,
skiaRoot ,
flutterRoot + "/flutter/third_party/txt/src" ,
flutterRoot + "/third_party/harfbuzz/src" ,
skiaRoot + "/third_party/externals/icu/source/common" ,
flutterRoot + "/third_party/icu/source/common" ,
flutterRoot + "/third_party/icu/source/i18n" ,
} ) ;
np . CompilerSettings ( ) . Add ( c = > IsWindows ( c ) , c = > c . WithCustomFlags ( new [ ] {
"-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING" ,
"-DUSE_OPENSSL=1" ,
"-D__STD_C" ,
"-D_CRT_RAND_S" ,
"-D_CRT_SECURE_NO_DEPRECATE" ,
"-D_HAS_EXCEPTIONS=0" ,
"-D_SCL_SECURE_NO_DEPRECATE" ,
"-DWIN32_LEAN_AND_MEAN" ,
"-DNOMINMAX" ,
"-D_ATL_NO_OPENGL" ,
"-D_WINDOWS" ,
"-DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS" ,
"-DNTDDI_VERSION=0x06030000" ,
"-DPSAPI_VERSION=1" ,
"-DWIN32" ,
"-D_SECURE_ATL" ,
"-D_USING_V110_SDK71_" ,
"-D_UNICODE" ,
"-DUNICODE" ,
"-D_WIN32_WINNT=0x0603" ,
"-DWINVER=0x0603" ,
"-D_DEBUG" ,
"-DU_USING_ICU_NAMESPACE=0" ,
"-DU_ENABLE_DYLOAD=0" ,
"-DUSE_CHROMIUM_ICU=1" ,
"-DU_STATIC_IMPLEMENTATION" ,
"-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ,
"-DUCHAR_TYPE=wchar_t" ,
"-DFLUTTER_RUNTIME_MODE_DEBUG=1" ,
"-DFLUTTER_RUNTIME_MODE_PROFILE=2" ,
"-DFLUTTER_RUNTIME_MODE_RELEASE=3" ,
"-DFLUTTER_RUNTIME_MODE_JIT_RELEASE=4" ,
"-DFLUTTER_RUNTIME_MODE=1" ,
"-DFLUTTER_JIT_RUNTIME=1" ,
"-DSK_ENABLE_SPIRV_VALIDATION" ,
"-D_CRT_SECURE_NO_WARNINGS" ,
"-D_HAS_EXCEPTIONS=0" ,
"-DWIN32_LEAN_AND_MEAN" ,
"-DNOMINMAX" ,
"-DSK_GAMMA_APPLY_TO_A8" ,
"-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1" ,
"-DGR_TEST_UTILS=1" ,
"-DSKIA_IMPLEMENTATION=1" ,
"-DSK_GL" ,
"-DSK_ENABLE_DUMP_GPU" ,
"-DSK_SUPPORT_PDF" ,
"-DSK_CODEC_DECODES_JPEG" ,
"-DSK_ENCODE_JPEG" ,
"-DSK_SUPPORT_XPS" ,
"-DSK_ENABLE_ANDROID_UTILS" ,
"-DSK_USE_LIBGIFCODEC" ,
"-DSK_HAS_HEIF_LIBRARY" ,
"-DSK_CODEC_DECODES_PNG" ,
"-DSK_ENCODE_PNG" ,
"-DSK_ENABLE_SKSL_INTERPRETER" ,
"-DSK_CODEC_DECODES_WEBP" ,
"-DSK_ENCODE_WEBP" ,
"-DSK_XML" ,
"-DLIBEGL_IMPLEMENTATION" ,
"-D_CRT_SECURE_NO_WARNINGS" ,
"-D_HAS_EXCEPTIONS=0" ,
"-DWIN32_LEAN_AND_MEAN" ,
"-DNOMINMAX" ,
"-DANGLE_ENABLE_ESSL" ,
"-DANGLE_ENABLE_GLSL" ,
"-DANGLE_ENABLE_HLSL" ,
"-DANGLE_ENABLE_OPENGL" ,
"-DEGL_EGLEXT_PROTOTYPES" ,
"-DGL_GLEXT_PROTOTYPES" ,
"-DANGLE_ENABLE_D3D11" ,
"-DANGLE_ENABLE_D3D9" ,
"-DGL_APICALL=" ,
"-DGL_API=" ,
"-DEGLAPI=" ,
//"-I../..",
//"-Igen",
//"-I../../third_party/icu/source/common",
//"-I../../third_party/icu/source/i18n",
//"-I../..",
//"-I../../third_party/dart/runtime",
//"-I../../third_party/dart/runtime/include",
"/GS" ,
"/FS" ,
//"/wd4091",
//"/wd4722",
//"/wd4312",
//"/wd4838",
//"/wd4172",
//"/wd4005",
//"/wd4311",
//"/wd4477",
"/MTd" ,
"/Od" ,
"/Ob0" ,
"/RTC1" ,
"/Zi" ,
"/WX" ,
"/std:c++17" ,
"/GR-" ,
} ) ) ;
np . CompilerSettings ( ) . Add ( c = > IsMac ( c ) , c = > c . WithCustomFlags ( new [ ] {
"-MD" ,
"-MF" ,
"-fvisibility-inlines-hidden" ,
} ) ) ;
np . Libraries . Add ( IsWindows , c = >
{
var basePath = skiaRoot + "/out/Debug" ;
return new PrecompiledLibrary [ ]
{
new StaticLibrary ( flutterRoot + "/out/host_debug_unopt/obj/flutter/third_party/txt/txt_lib.lib" ) ,
//new StaticLibrary("e:/flutter_engine/src/third_party/swiftshader/third_party/PowerVR_SDK/Builds/Windows/x86_64/Lib/libEGL.lib"),
//new StaticLibrary("e:/flutter_engine/src/third_party/swiftshader/third_party/PowerVR_SDK/Builds/Windows/x86_64/Lib/libGLESv2.lib"),
new StaticLibrary ( "e:/code/skia_repo/skia/out/Debug/libEGL.dll.lib" ) ,
new StaticLibrary ( "e:/code/skia_repo/skia/out/Debug/libGLESv2.dll.lib" ) ,
//new StaticLibrary(basePath + "/skia.lib"),
//new StaticLibrary(basePath + "/skottie.lib"),
//new StaticLibrary(basePath + "/sksg.lib"),
//new StaticLibrary(basePath + "/skshaper.lib"),
//new StaticLibrary(basePath + "/harfbuzz.lib"),
//new StaticLibrary(basePath + "/libEGL.dll.lib"),
//new StaticLibrary(basePath + "/libGLESv2.dll.lib"),
new SystemLibrary ( "Opengl32.lib" ) ,
new SystemLibrary ( "User32.lib" ) ,
new SystemLibrary ( "rpcrt4.lib" ) ,
//new SystemLibrary("D3D12.lib"),
//new SystemLibrary("DXGI.lib"),
//new SystemLibrary("d3dcompiler.lib"),
// new SystemLibrary(basePath + "/obj/tools/trace/trace.ChromeTracingTracer.obj"),
// new SystemLibrary(basePath + "/obj/tools/trace/trace.EventTracingPriv.obj"),
// new SystemLibrary(basePath + "/obj/tools/trace/trace.SkDebugfTracer.obj"),
// new SystemLibrary(basePath + "/obj/tools/flags/flags.CommandLineFlags.obj"),
} ;
} ) ;
np . Libraries . Add ( IsMac , c = > {
return new PrecompiledLibrary [ ]