premake / premake/premake-core

Win32 configuration filter matches Win64 as well

Open
#1,302 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
3.6k
Forks
654
Avg merge
1d 1h
Merged PRs (30d)
13

Description

This passes (added to core\modules\vstudio\tests\vc2010\test_files.lua):

	function suite.excludedFromBuild_onConfigExcludedFile()
		configurations { "Debug", "Release" }
		platforms { "Win64", "Win32" }

		files { "hello.cpp" }
		configuration "Win64"
		removefiles { "hello.cpp" }

		prj = test.getproject(wks, 1)
		vc2010.files(prj)
		test.capture [[
<ItemGroup>
	<ClCompile Include="hello.cpp">
		<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Win64|x64'">true</ExcludedFromBuild>
		<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Win64|x64'">true</ExcludedFromBuild>
	</ClCompile>
</ItemGroup>
		]]
	End

However, if it's filtered for Win32, then hello.cpp is removed for both configs (generated block is empty). So, this fails:

	function suite.excludedFromBuild_onConfigExcludedFile()
		configurations { "Debug", "Release" }
		platforms { "Win64", "Win32" }

		files { "hello.cpp" }
		configuration "Win32"
		removefiles { "hello.cpp" }

		prj = test.getproject(wks, 1)
		vc2010.files(prj)
		test.capture [[
<ItemGroup>
	<ClCompile Include="hello.cpp">
		<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Win32|x64'">true</ExcludedFromBuild>
		<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Win32|x64'">true</ExcludedFromBuild>
	</ClCompile>
</ItemGroup>
		]]
	End

If however Win32 is substituted for, say, "Win33" (in config declarations too), then it filters fine for that, and only "Win33" configs are excluded.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core\modules\vstudio\tests\vc2010\test_files.lua and run the excludedFromBuild_onConfigExcludedFile cases through vc2010.files(prj). Compare the passing Win64 and Win33 captures with the failing Win32 capture; done means Win32 exclusions are emitted only for the matching Win32 configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.