From 5ef5682c94cf80dbd14cd6acd678480d01643fcf Mon Sep 17 00:00:00 2001 From: Liam Devine Date: Thu, 8 Sep 2011 14:24:05 +0100 Subject: [PATCH] * Bug 3381149: Path of PCH source file in VS10 not being translated (intyuh) Re- added unit test removed in 53abc69ab87c Applied patch from intyuh --- CHANGES.txt | 2 +- src/actions/vstudio/vs2010_vcxproj.lua | 5 +++-- tests/actions/vstudio/test_vs2010_vcxproj.lua | 7 +++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a1dcdc85..402440d7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -29,7 +29,7 @@ * Added debug environment variable support for Visual Studio * Bug 3277343: SM_SERVERR2 is not always defined by default (Martin Ridgers) * Added debug environment variable support for Codeblocks using gdb - +* Bug 3381149: Path of PCH source file in VS10 not being translated (intyuh) ------- 4.3 ------- diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index 0706e8cf..45684280 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -515,9 +515,10 @@ _p(1,'') for _, file in ipairs(files) do - _p(2,'', path.translate(file.name, "\\")) + local translatedpath = path.translate(file.name, "\\") + _p(2,'', translatedpath) for _, cfginfo in ipairs(configs) do - if config_mappings[cfginfo] and file.name == config_mappings[cfginfo] then + if config_mappings[cfginfo] and translatedpath == config_mappings[cfginfo] then _p(3,'Create', premake.esc(cfginfo.name)) config_mappings[cfginfo] = nil --only one source file per pch end diff --git a/tests/actions/vstudio/test_vs2010_vcxproj.lua b/tests/actions/vstudio/test_vs2010_vcxproj.lua index c28402fc..42a5a4ce 100644 --- a/tests/actions/vstudio/test_vs2010_vcxproj.lua +++ b/tests/actions/vstudio/test_vs2010_vcxproj.lua @@ -335,6 +335,13 @@ test.string_does_not_contain(buffer,debug_config_pch_string) end + function vs10_vcxproj.pchHeaderAndPchSourceSet_bufferContainPchCreate() + configuration("Debug") + pchheader "foo/dummyHeader.h" + pchsource "foo/dummySource.cpp" + local buffer = get_buffer() + test.string_contains(buffer,debug_config_pch_string) + end function vs10_vcxproj.wholeProgramOptimizationIsNotSetByDefault_bufferDoesNotContainWholeProgramOptimization() local buffer = get_buffer()