Open Pycorax opened 1 year ago
Does using x86_64
for the architecture
instead of x64
work?
@samsinsane Nope, that doesn't seem to work either
I've had a look into this and it looks like we don't support the platforms
/architecture
APIs for the new .NET project format. As a workaround, you can inject the element using:
require "vstudio"
local platformsElement(cfg)
_p(2,'<Platforms>x64</Platforms')
end
premake.override(premake.vstudio.cs2005.elements, "projectProperties", function (oldfn, cfg)
return table.join(oldfn(cfg), {
platformsElement,
})
end)
@samsinsane Thanks! I looked into overrides and I got an idea of what you're suggesting here. I've appended it to the bottom of my file but, it is indicating that _p
inside platformsElement()
seems to be undefined?
The error:
premake5.lua:40: syntax error near 'p'
After looking into it further, I managed to fix it by replacing the local
keyword for platformsElement()
's definition with function
. I'm not sure if this is the correct way though.
Any idea if it will be implemented? @samsinsane
@Pycorax Sorry about that, looks like I made a typo while typing up the snippet - I think I meant to do local function
which limits the function to the current .lua
file. Glad you were able to figure out the problem with it and get it working.
@JohnathanRvT It's been awhile since I've looked at this, but I think #1899 fixes this. So, should be "soon".
What seems to be the problem? Generating a C# project using premake does not specify the "Platform Targets" property for the project when an architecture is specified. This results in projects being still marked as "AnyCPU" regardless of the specified architecture.
What did you expect to happen? The generated csproj should contain a "Platforms" tag in the condition-less
PropertyGroup
. For example, if the architecture is x64, it should have the following tag:<Platforms>x64</Platforms>
.What have you tried so far? Manually inserting the
<Platforms>x64</Platforms>
tag.How can we reproduce this? Only tested with VS 2019 so far with the following premake file.
What version of Premake are you using? 5.0.0-beta2
Anything else we should know? None