diff options
author | Jason Perkins <starkos@industriousone.com> | 2013-07-03 16:59:05 +0400 |
---|---|---|
committer | Jason Perkins <starkos@industriousone.com> | 2013-07-03 16:59:05 +0400 |
commit | 17345d47a5201381c83db0e98a6e2d362738268d (patch) | |
tree | 64b7d4c8218797561ab75e3e068baab8338049e3 | |
parent | 5a3d708d319cf22e3acd9b426e8b298af6c6131b (diff) |
Stop stripping path from PCH headers in Visual Studio; first step in standardizing handling across tools
-rw-r--r-- | src/actions/vstudio/vs200x_vcproj.lua | 4 | ||||
-rw-r--r-- | src/actions/vstudio/vs2010_vcxproj.lua | 2 | ||||
-rw-r--r-- | tests/actions/vstudio/test_vs200x_vcproj.lua | 12 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index fae5900..ee69357 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -1,7 +1,7 @@ -- -- vs200x_vcproj.lua -- Generate a Visual Studio 2002-2008 C/C++ project. --- Copyright (c) 2009-2011 Jason Perkins and the Premake project +-- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- @@ -312,7 +312,7 @@ if not cfg.flags.NoPCH and cfg.pchheader then _p(4,'UsePrecompiledHeader="%s"', iif(_ACTION < "vs2005", 3, 2)) - _p(4,'PrecompiledHeaderThrough="%s"', path.getname(cfg.pchheader)) + _p(4,'PrecompiledHeaderThrough="%s"', cfg.pchheader) else _p(4,'UsePrecompiledHeader="%s"', iif(_ACTION > "vs2003" or cfg.flags.NoPCH, 0, 2)) end diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index 43bb2bf..2c9a14a 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -157,7 +157,7 @@ local function precompiled_header(cfg) if not cfg.flags.NoPCH and cfg.pchheader then _p(3,'<PrecompiledHeader>Use</PrecompiledHeader>') - _p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', path.getname(cfg.pchheader)) + _p(3,'<PrecompiledHeaderFile>%s</PrecompiledHeaderFile>', cfg.pchheader) else _p(3,'<PrecompiledHeader></PrecompiledHeader>') end diff --git a/tests/actions/vstudio/test_vs200x_vcproj.lua b/tests/actions/vstudio/test_vs200x_vcproj.lua index 5bc06af..68b2582 100644 --- a/tests/actions/vstudio/test_vs200x_vcproj.lua +++ b/tests/actions/vstudio/test_vs200x_vcproj.lua @@ -1,7 +1,7 @@ -- -- tests/test_vs200x_vcproj.lua -- Automated test suite for Visual Studio 2002-2008 C/C++ project generation. --- Copyright (c) 2009 Jason Perkins and the Premake project +-- Copyright (c) 2009-2013 Jason Perkins and the Premake project -- T.vs200x_vcproj = { } @@ -443,11 +443,15 @@ -- --- Test precompiled header handling +-- Test precompiled header handling; the header should be treated as +-- a plain string value, with no path manipulation applied, since it +-- needs to match the value of the #include statement used in the +-- project code. -- function suite.CompilerBlock_OnPCH() - pchheader "source/common.h" + location "build/MyProject" + pchheader "include/common.h" pchsource "source/common.cpp" prepare() vc200x.VCCLCompilerTool(premake.getconfig(prj, "Debug")) @@ -459,7 +463,7 @@ RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="2" - PrecompiledHeaderThrough="common.h" + PrecompiledHeaderThrough="include/common.h" WarningLevel="3" Detect64BitPortabilityProblems="true" ProgramDataBaseFileName="$(OutDir)\MyProject.pdb" |