Skip to content

Commit

Permalink
Use -D hlgen.makefile.jumbo = true/false
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Jan 8, 2025
1 parent b3e28e0 commit 3804ae2
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 43 deletions.
14 changes: 10 additions & 4 deletions other/haxelib/Run.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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();
Expand All @@ -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);
Expand Down
27 changes: 14 additions & 13 deletions other/haxelib/templates/vs2015/__file__.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
$$setDefaultJumboBuild(true)
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
Expand Down Expand Up @@ -95,7 +96,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -115,7 +116,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -137,7 +138,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -161,7 +162,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -180,17 +181,17 @@
<ItemGroup>
<ClCompile Include="stdafx.c">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
::if jumboBuild::<ClCompile Include="::relDir::::name::.c" />
</ClCompile>::if (jumboBuild == "true")::
<ClCompile Include="::relDir::::name::.c" />
<!--::end::::foreach cfiles::
<ClCompile Include="::relDir::::path::" />::end::
::if jumboBuild::-->::end::
</ItemGroup>
::if jumboBuild::<!--::end::
<ClCompile Include="::relDir::::path::" />::end::::if (jumboBuild == "true")::
-->::end::
</ItemGroup>::if (jumboBuild == "true")::
<!--::end::
<ItemGroup>::foreach hfiles::
<ClInclude Include="::relDir::::path::" />::end::
</ItemGroup>
::if jumboBuild::-->::end::
</ItemGroup>::if (jumboBuild == "true")::
-->::end::
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
27 changes: 14 additions & 13 deletions other/haxelib/templates/vs2017/__file__.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
$$setDefaultJumboBuild(true)
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
Expand Down Expand Up @@ -97,7 +98,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -118,7 +119,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -141,7 +142,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -166,7 +167,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -185,17 +186,17 @@
<ItemGroup>
<ClCompile Include="stdafx.c">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
::if jumboBuild::<ClCompile Include="::relDir::::name::.c" />
</ClCompile>::if (jumboBuild == "true")::
<ClCompile Include="::relDir::::name::.c" />
<!--::end::::foreach cfiles::
<ClCompile Include="::relDir::::path::" />::end::
::if jumboBuild::-->::end::
</ItemGroup>
::if jumboBuild::<!--::end::
<ClCompile Include="::relDir::::path::" />::end::::if (jumboBuild == "true")::
-->::end::
</ItemGroup>::if (jumboBuild == "true")::
<!--::end::
<ItemGroup>::foreach hfiles::
<ClInclude Include="::relDir::::path::" />::end::
</ItemGroup>
::if jumboBuild::-->::end::
</ItemGroup>::if (jumboBuild == "true")::
-->::end::
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
27 changes: 14 additions & 13 deletions other/haxelib/templates/vs2019/__file__.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
$$setDefaultJumboBuild(true)
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
Expand Down Expand Up @@ -95,7 +96,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -116,7 +117,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -137,7 +138,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -158,7 +159,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;::if !jumboBuild::HL_MAKE;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;::if (jumboBuild != "true")::HL_MAKE;::end::%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -177,17 +178,17 @@
<ItemGroup>
<ClCompile Include="stdafx.c">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
::if jumboBuild::<ClCompile Include="::relDir::::name::.c" />
</ClCompile>::if (jumboBuild == "true")::
<ClCompile Include="::relDir::::name::.c" />
<!--::end::::foreach cfiles::
<ClCompile Include="::relDir::::path::" />::end::
::if jumboBuild::-->::end::
</ItemGroup>
::if jumboBuild::<!--::end::
<ClCompile Include="::relDir::::path::" />::end::::if (jumboBuild == "true")::
-->::end::
</ItemGroup>::if (jumboBuild == "true")::
<!--::end::
<ItemGroup>::foreach hfiles::
<ClInclude Include="::relDir::::path::" />::end::
</ItemGroup>
::if jumboBuild::-->::end::
</ItemGroup>::if (jumboBuild == "true")::
-->::end::
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down

0 comments on commit 3804ae2

Please sign in to comment.