aboutsummaryrefslogtreecommitdiff
path: root/ports/windows
diff options
context:
space:
mode:
authorstijn2018-07-24 13:29:03 +0200
committerDamien George2018-08-14 15:07:19 +1000
commit3f9d3e120b31401f5f48f311a76e070979ea9889 (patch)
tree8ddbf248f93a2a30c3aaff5276df8f2c584bfa28 /ports/windows
parentcbec17f2cd2712772bc57f3530d6d16f8552e155 (diff)
windows/msvc: Support custom compiler for header generation.
Use overrideable properties instead of hardcoding the use of the default cl executable used by msvc toolsets. This allows using arbitrary compiler commands for qstr header generation. The CLToolExe and CLToolPath properties are used because they are, even though absent from any official documentation, the de-facto standard as used by the msvc toolsets themselves.
Diffstat (limited to 'ports/windows')
-rw-r--r--ports/windows/msvc/genhdr.targets6
1 files changed, 4 insertions, 2 deletions
diff --git a/ports/windows/msvc/genhdr.targets b/ports/windows/msvc/genhdr.targets
index ee030c906..fa3e95e41 100644
--- a/ports/windows/msvc/genhdr.targets
+++ b/ports/windows/msvc/genhdr.targets
@@ -15,6 +15,8 @@
<QstrDefsCollected>$(DestDir)qstrdefscollected.h</QstrDefsCollected>
<QstrGen>$(DestDir)qstrdefs.generated.h</QstrGen>
<PyPython Condition="'$(PyPython)' == ''">python</PyPython>
+ <CLToolExe Condition="'$(CLToolExe)' == ''">cl.exe</CLToolExe>
+ <PyClTool>$([System.IO.Path]::Combine(`$(CLToolPath)`, `$(CLToolExe)`))</PyClTool>
</PropertyGroup>
<Target Name="MakeDestDir">
@@ -73,7 +75,7 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
</PropertyGroup>
<MakeDir Directories="@(PyQstrSourceFiles->'%(OutDir)')"/>
- <Exec Command="cl /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D') /Fi%(PyQstrSourceFiles.OutFile) /P %(PyQstrSourceFiles.Identity)"
+ <Exec Command="$(PyClTool) /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D') /Fi%(PyQstrSourceFiles.OutFile) /P %(PyQstrSourceFiles.Identity)"
Condition="'%(PyQstrSourceFiles.Changed)' == 'True' Or '$(ForceQstrRebuild)' == 'True'"/>
<ConcatPreProcFiles InputFiles="@(PyQstrSourceFiles->'%(OutFile)')" OutputFile="$(DestDir)qstr.i.last"
Condition="'$(RunPreProcConcat)' == 'True' Or '$(ForceQstrRebuild)' == 'True'"/>
@@ -85,7 +87,7 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
<PropertyGroup>
<TmpFile>$(QstrGen).tmp</TmpFile>
</PropertyGroup>
- <Exec Command="cl /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D') /E $(PyQstrDefs) $(QstrDefs) > $(DestDir)qstrdefspreprocessed.h"/>
+ <Exec Command="$(PyClTool) /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D') /E $(PyQstrDefs) $(QstrDefs) > $(DestDir)qstrdefspreprocessed.h"/>
<Exec Command="$(PyPython) $(PySrcDir)makeqstrdata.py $(DestDir)qstrdefspreprocessed.h $(QstrDefsCollected) > $(TmpFile)"/>
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="CopyFileIfDifferent" Properties="SourceFile=$(TmpFile);DestFile=$(QstrGen)"/>
</Target>