From b3e28e0993e76312d4c0573d86f6459f9a11a0d0 Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Mon, 30 Dec 2024 14:43:50 +0100 Subject: [PATCH 1/3] [hlc] Add jumbo build for vs template --- other/haxelib/Run.hx | 2 ++ other/haxelib/templates/vs2015/__file__.vcxproj | 15 ++++++++++----- other/haxelib/templates/vs2017/__file__.vcxproj | 15 ++++++++++----- other/haxelib/templates/vs2019/__file__.vcxproj | 15 ++++++++++----- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/other/haxelib/Run.hx b/other/haxelib/Run.hx index 6f0fe346f..e21244262 100644 --- a/other/haxelib/Run.hx +++ b/other/haxelib/Run.hx @@ -46,6 +46,7 @@ class Build { tpl = "vs2015"; var srcDir = tpl; var targetDir = config.defines.get("hlgen.makefilepath"); + var jumboBuild = config.defines.get("hlgen.nojumbo") == null; var relDir = ""; if( targetDir == null ) targetDir = this.targetDir; @@ -133,6 +134,7 @@ class Build { directories : directories, cfiles : [for( f in files ) if( StringTools.endsWith(f.path,".c") ) f], hfiles : [for( f in files ) if( StringTools.endsWith(f.path,".h") ) f], + jumboBuild : jumboBuild, },{ makeUID : function(_,s:String) { var sha1 = haxe.crypto.Sha1.encode(s); diff --git a/other/haxelib/templates/vs2015/__file__.vcxproj b/other/haxelib/templates/vs2015/__file__.vcxproj index 46d4f8904..32773afb6 100644 --- a/other/haxelib/templates/vs2015/__file__.vcxproj +++ b/other/haxelib/templates/vs2015/__file__.vcxproj @@ -95,7 +95,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -115,7 +115,7 @@ Level3 Disabled - _DEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -137,7 +137,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -161,7 +161,7 @@ MaxSpeed true true - NDEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -180,12 +180,17 @@ Create - ::foreach cfiles:: + + ::if jumboBuild:: + ::end:: + ::if jumboBuild::::end:: diff --git a/other/haxelib/templates/vs2017/__file__.vcxproj b/other/haxelib/templates/vs2017/__file__.vcxproj index 283fb14a5..c64894d43 100644 --- a/other/haxelib/templates/vs2017/__file__.vcxproj +++ b/other/haxelib/templates/vs2017/__file__.vcxproj @@ -97,7 +97,7 @@ Level3 Disabled true - WIN32;_DEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -118,7 +118,7 @@ Level3 Disabled true - _DEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -141,7 +141,7 @@ true true true - WIN32;NDEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -166,7 +166,7 @@ true true true - NDEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -185,12 +185,17 @@ Create - ::foreach cfiles:: + + ::if jumboBuild:: + ::end:: + ::if jumboBuild::::end:: diff --git a/other/haxelib/templates/vs2019/__file__.vcxproj b/other/haxelib/templates/vs2019/__file__.vcxproj index 373be5454..1ab0044b9 100644 --- a/other/haxelib/templates/vs2019/__file__.vcxproj +++ b/other/haxelib/templates/vs2019/__file__.vcxproj @@ -95,7 +95,7 @@ Level3 Disabled true - WIN32;_DEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -116,7 +116,7 @@ true true true - WIN32;NDEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -137,7 +137,7 @@ Level3 Disabled true - _DEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -158,7 +158,7 @@ true true true - NDEBUG;_CONSOLE;HL_MAKE;%(PreprocessorDefinitions) + NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -177,12 +177,17 @@ Create - ::foreach cfiles:: + + ::if jumboBuild:: + ::end:: + ::if jumboBuild::::end:: From 3804ae2f882c7e3df9177be28e890daa0e89924d Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Wed, 8 Jan 2025 16:59:00 +0100 Subject: [PATCH 2/3] Use -D hlgen.makefile.jumbo = true/false --- other/haxelib/Run.hx | 14 +++++++--- .../haxelib/templates/vs2015/__file__.vcxproj | 27 ++++++++++--------- .../haxelib/templates/vs2017/__file__.vcxproj | 27 ++++++++++--------- .../haxelib/templates/vs2019/__file__.vcxproj | 27 ++++++++++--------- 4 files changed, 52 insertions(+), 43 deletions(-) diff --git a/other/haxelib/Run.hx b/other/haxelib/Run.hx index e21244262..aa30b646f 100644 --- a/other/haxelib/Run.hx +++ b/other/haxelib/Run.hx @@ -46,7 +46,7 @@ class Build { tpl = "vs2015"; var srcDir = tpl; var targetDir = config.defines.get("hlgen.makefilepath"); - var jumboBuild = config.defines.get("hlgen.nojumbo") == null; + var jumboBuild = config.defines.get("hlgen.makefile.jumbo"); var relDir = ""; if( targetDir == null ) targetDir = this.targetDir; @@ -126,7 +126,7 @@ class Build { } var content = sys.io.File.getContent(srcPath); var tpl = new haxe.Template(content); - content = tpl.execute({ + var context = { name : this.name, libraries : [for( l in config.libs ) if( l != "std" ) { name : l }], files : files, @@ -135,7 +135,8 @@ class Build { cfiles : [for( f in files ) if( StringTools.endsWith(f.path,".c") ) f], hfiles : [for( f in files ) if( StringTools.endsWith(f.path,".h") ) f], jumboBuild : jumboBuild, - },{ + }; + var macros = { makeUID : function(_,s:String) { var sha1 = haxe.crypto.Sha1.encode(s); sha1 = sha1.toUpperCase(); @@ -149,7 +150,12 @@ class Build { }, winPath : function(_,s:String) return s.split("/").join("\\"), getEnv : function(_,s:String) return Sys.getEnv(s), - }); + setDefaultJumboBuild: function(_, b:String) { + context.jumboBuild ??= b; + return ""; + } + }; + content = tpl.execute(context, macros); var prevContent = try sys.io.File.getContent(targetPath) catch( e : Dynamic ) null; if( prevContent != content ) sys.io.File.saveContent(targetPath, content); diff --git a/other/haxelib/templates/vs2015/__file__.vcxproj b/other/haxelib/templates/vs2015/__file__.vcxproj index 32773afb6..974b4b0d5 100644 --- a/other/haxelib/templates/vs2015/__file__.vcxproj +++ b/other/haxelib/templates/vs2015/__file__.vcxproj @@ -1,4 +1,5 @@ - +$$setDefaultJumboBuild(true) + @@ -95,7 +96,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -115,7 +116,7 @@ Level3 Disabled - _DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -137,7 +138,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -161,7 +162,7 @@ MaxSpeed true true - NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -180,17 +181,17 @@ Create - - ::if jumboBuild:: + ::if (jumboBuild == "true"):: + ::end:: - - ::if jumboBuild::::end:: + ::if (jumboBuild == "true"):: + ::end:: + ::if (jumboBuild == "true"):: + -->::end:: diff --git a/other/haxelib/templates/vs2017/__file__.vcxproj b/other/haxelib/templates/vs2017/__file__.vcxproj index c64894d43..cdad146d5 100644 --- a/other/haxelib/templates/vs2017/__file__.vcxproj +++ b/other/haxelib/templates/vs2017/__file__.vcxproj @@ -1,4 +1,5 @@ - +$$setDefaultJumboBuild(true) + @@ -97,7 +98,7 @@ Level3 Disabled true - WIN32;_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -118,7 +119,7 @@ Level3 Disabled true - _DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -141,7 +142,7 @@ true true true - WIN32;NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -166,7 +167,7 @@ true true true - NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -185,17 +186,17 @@ Create - - ::if jumboBuild:: + ::if (jumboBuild == "true"):: + ::end:: - - ::if jumboBuild::::end:: + ::if (jumboBuild == "true"):: + ::end:: + ::if (jumboBuild == "true"):: + -->::end:: diff --git a/other/haxelib/templates/vs2019/__file__.vcxproj b/other/haxelib/templates/vs2019/__file__.vcxproj index 1ab0044b9..e7c81517c 100644 --- a/other/haxelib/templates/vs2019/__file__.vcxproj +++ b/other/haxelib/templates/vs2019/__file__.vcxproj @@ -1,4 +1,5 @@ - +$$setDefaultJumboBuild(true) + @@ -95,7 +96,7 @@ Level3 Disabled true - WIN32;_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -116,7 +117,7 @@ true true true - WIN32;NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -137,7 +138,7 @@ Level3 Disabled true - _DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -158,7 +159,7 @@ true true true - NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions) + NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions) true $(IntDir)\%(RelativeDir) true @@ -177,17 +178,17 @@ Create - - ::if jumboBuild:: + ::if (jumboBuild == "true"):: + ::end:: - - ::if jumboBuild::::end:: + ::if (jumboBuild == "true"):: + ::end:: + ::if (jumboBuild == "true"):: + -->::end:: From c811951d841a098daedd2be6995c18205830fa15 Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Thu, 9 Jan 2025 11:05:43 +0100 Subject: [PATCH 3/3] Fix +$$setDefaultJumboBuild(true) diff --git a/other/haxelib/templates/vs2017/__file__.vcxproj b/other/haxelib/templates/vs2017/__file__.vcxproj index cdad146d5..7f5dff64a 100644 --- a/other/haxelib/templates/vs2017/__file__.vcxproj +++ b/other/haxelib/templates/vs2017/__file__.vcxproj @@ -1,5 +1,4 @@ -$$setDefaultJumboBuild(true) - +$$setDefaultJumboBuild(true) diff --git a/other/haxelib/templates/vs2019/__file__.vcxproj b/other/haxelib/templates/vs2019/__file__.vcxproj index e7c81517c..9b78d2c08 100644 --- a/other/haxelib/templates/vs2019/__file__.vcxproj +++ b/other/haxelib/templates/vs2019/__file__.vcxproj @@ -1,5 +1,4 @@ -$$setDefaultJumboBuild(true) - +$$setDefaultJumboBuild(true)