Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue trying to fix x86 Linux build #2185

Open
redorav opened this issue Feb 17, 2024 · 1 comment
Open

Issue trying to fix x86 Linux build #2185

redorav opened this issue Feb 17, 2024 · 1 comment
Labels

Comments

@redorav
Copy link
Collaborator

redorav commented Feb 17, 2024

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?

@samsinsane
Copy link
Member

Yeah, this Win32 hack is a massive pain, here's how it was resolved in the Android module:

premake.override(vstudio, "archFromConfig", function (oldfn, cfg, win32)
-- Bypass that pesky Win32 hack by not passing win32 down
if cfg.system == premake.ANDROID and _ACTION >= "vs2015" then
return oldfn(cfg)
end
return oldfn(cfg, win32)
end)

I also resolved it in my VSLinux module in a similar way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants