summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2021-02-11 00:51:33 +0800
committerruki <[email protected]>2021-02-11 00:51:33 +0800
commitb3596005c375c35063bb2cd0ef9b93b71ed85992 (patch)
treee08f681cee487a33491845784074be4a4bfb23f9 /xmake/plugins
parent97809015891f39e4bb5d0dd180a5835c0f3dee2c (diff)
support pcheader for vsxmake
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua1
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.props3
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/Xmake.targets1
-rw-r--r--xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch)1
4 files changed, 6 insertions, 0 deletions
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 17131d391..435f1f3f6 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -149,6 +149,7 @@ function _make_targetinfo(mode, arch, target)
targetinfo.includedirs = _make_dirs(table.join(_get_values_from_target(target, "includedirs") or {}, _get_values_from_target(target, "sysincludedirs")))
targetinfo.linkdirs = _make_dirs(_get_values_from_target(target, "linkdirs"))
targetinfo.sourcedirs = _make_dirs(_get_values_from_target(target, "values.project.vsxmake.sourcedirs"))
+ targetinfo.pcheaderfile = target:pcheaderfile("cxx") or target:pcheaderfile("c")
-- save defines
targetinfo.defines = _make_arrs(_get_values_from_target(target, "defines"))
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.props b/xmake/plugins/project/vsxmake/vsproj/Xmake.props
index eaa8472c4..a783c8ebc 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.props
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.props
@@ -100,6 +100,9 @@
<LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx1z'))">stdcpp17</LanguageStandard>
<LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx20'))">stdcpplatest</LanguageStandard>
<LanguageStandard Condition="'%(LanguageStandard)' == '' And $(XmakeLanguages.Contains('gnuxx2a'))">stdcpplatest</LanguageStandard>
+ <PrecompiledHeader Condition="'%(PrecompiledHeader)' == '' And $(XmakePrecompiledHeader.Contains('.h'))">Use</PrecompiledHeader>
+ <PrecompiledHeaderFile Condition="'%(PrecompiledHeaderFile)' == '' And $(XmakePrecompiledHeader.Contains('.h'))">$(XmakeProjectDir)\$(XmakePrecompiledHeader)</PrecompiledHeaderFile>
+ <ForcedIncludeFiles Condition="'%(ForcedIncludeFiles)' == '' And $(XmakePrecompiledHeader.Contains('.h'))">$(XmakeProjectDir)\$(XmakePrecompiledHeader);%(ForcedIncludeFiles)</ForcedIncludeFiles>
</ClCompile>
<Link>
diff --git a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
index 6ec266f11..78b6e5bca 100644
--- a/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
+++ b/xmake/plugins/project/vsxmake/vsproj/Xmake.targets
@@ -139,6 +139,7 @@ MSBuild Properties:
XmakeIncludeDirs: $(XmakeIncludeDirs)
XmakeLinkDirs: $(XmakeLinkDirs)
XmakeSourceDirs: $(XmakeSourceDirs)
+ XmakePrecompiledHeader: $(XmakePrecompiledHeader)
XmakeRunEnvs: $(XmakeRunEnvs)
Xmake Path:
XmakeProgramDir: $(XmakeProgramDir)
diff --git a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch) b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch)
index 8e1279b37..0d6eb3dd5 100644
--- a/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch)
+++ b/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj/XmakeConfig(mode,arch)
@@ -16,4 +16,5 @@
<XmakeIncludeDirs>#includedirs#</XmakeIncludeDirs>
<XmakeLinkDirs>#linkdirs#</XmakeLinkDirs>
<XmakeSourceDirs>#sourcedirs#</XmakeSourceDirs>
+ <XmakePrecompiledHeader>#pcheaderfile#</XmakePrecompiledHeader>
</PropertyGroup>