premake / premake-core

Premake

Home Page:https://premake.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue trying to fix x86 Linux build

redorav opened this issue · comments

I'm trying to fix the x86 Linux build as was reported here, as well as some other small issues I have. I found the bit of code that does the remapping, it's a function archFromConfig that looks like this:

function vstudio.archFromConfig(cfg, win32)
	local isnative = project.isnative(cfg.project)

	local arch = architecture(cfg.system, cfg.architecture)
		
	if not arch then
		arch = iif(isnative, "x86", "Any CPU")
	end

	if win32 and isnative and arch == "x86" then
		arch = "Win32"
	end

	return arch
end

It looked like it should be pretty easy to change, but it turns out it's more complicated for some reason. I tried doing

if win32 and isnative and arch == "x86" and cfg.system ==p.WINDOWS then

and also tried

if win32 and isnative and arch == "x86" and cfg.system ~=p.LINUX then

but neither of those work, they break the windows platform that appears as x86 instead of the current Win32

I notice that this function function vstudio.archFromConfig(cfg, win32) gets called with win32 set to true in many places, and I'm not sure what it means or why the system doesn't match what I'm trying to do. Any advice on how to move forward?