Skip to content

Enable Windows linker optimizations in Release #3241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion native/windows/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Task("libSkiaSharp")
var clang = string.IsNullOrEmpty(LLVM_HOME.FullPath) ? "" : $"clang_win='{LLVM_HOME}' ";
var win_vcvars_version = string.IsNullOrEmpty(VC_TOOLSET_VERSION) ? "" : $"win_vcvars_version='{VC_TOOLSET_VERSION}' ";
var d = CONFIGURATION.ToLower() == "release" ? "" : "d";
var linker_opt = CONFIGURATION.ToLower() == "release" ? "" : "NO";

GnNinja($"{VARIANT}/{arch}", "SkiaSharp",
$"target_os='win'" +
Expand All @@ -59,7 +60,7 @@ Task("libSkiaSharp")
clang +
win_vcvars_version +
$"extra_cflags=[ '-DSKIA_C_DLL', '/MT{d}', '/EHsc', '/Z7', '-D_HAS_AUTO_PTR_ETC=1' ] " +
$"extra_ldflags=[ '/DEBUG:FULL', '/DEBUGTYPE:CV,FIXUP' ] " +
$"extra_ldflags=[ '/DEBUG:FULL', '/DEBUGTYPE:CV,FIXUP', '/OPT:{linker_opt}REF', '/OPT:{linker_opt}ICF' ] " +
ADDITIONAL_GN_ARGS);

var outDir = OUTPUT_PATH.Combine($"{VARIANT}/{dir}");
Expand Down