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

CodeLite Generation Broken, Breaks with Multiple Platforms #1411

Closed
Spirrwell opened this issue Mar 23, 2020 · 9 comments · Fixed by #1419
Closed

CodeLite Generation Broken, Breaks with Multiple Platforms #1411

Spirrwell opened this issue Mar 23, 2020 · 9 comments · Fixed by #1419
Labels

Comments

@Spirrwell
Copy link

Spirrwell commented Mar 23, 2020

Hello! I'm running premake5 5.0.0-alpha14

When I generate a CodeLite project with premake that has multiple platforms, generation seems to break. Specifically, if I use something like "links" to link another project. If I rebuild the workspace, everything seems to build fine, but if I build the specific project that calls "links" it gives me an error like "No rule to make target '".build-x86_64', needed by 'bin/x86_64/Debug/test_exe'"

This seems to be an old issue as I've come across something similar here: premake/premake-codelite#17

In testing, it seems to be caused by the OR character '|' in the generated .project files.

image

I can induce the problem if I use configurations only with no platforms, and I use the '|' character.

configurations{ "Debug|32","Release|32", "Debug|64", "Release|64" }

If I don't use |, there are no issues.

I don't know why. But it seems like a straightforward solution is to not use |

As an extra reference, here's an example premake file (and repo) that reproduces the issue https://github.com/Spirrwell/premake-codelite-bug/blob/master/premake5.lua

@Spirrwell Spirrwell added the bug label Mar 23, 2020
@samsinsane
Copy link
Member

It's likely we just need to escape the |, probably as | in this function

function codelite.esc(value)
local result = value:gsub('&', '&')
result = result:gsub('<', '&lt;')
result = result:gsub('>', '&gt;')
result = result:gsub('"', '\\&quot;')
return result
end

If you add the following to your premake5.lua does it resolve the issue?

premake.override(premake.modules.codelite, "esc", function(oldfn, value)
  return oldfn(value):gsub("|", "&verbar;")
end)

@Spirrwell
Copy link
Author

Spirrwell commented Mar 23, 2020

No, doing this seems to nuke my workspace, none of my projects show up in CodeLite. The | symbols are still there as well, but I do see &verbar; in some spots.

As far as I can tell, it seems like the issue is here on this line:
https://github.com/premake/premake-core/blob/master/modules/codelite/codelite.lua#L24

Using an underscore here instead of | works fine.

@starkos
Copy link
Member

starkos commented Mar 25, 2020

Out of curiosity, if you set up a similar multi-platform project by hand, using the CodeLite UI instead of Premake, what value does it put there?

Wherever possible, we try to match the "native" behavior of the tool. But our experience with CodeLite is, well, "lite" so a lot of Visual Studio behaviors carry over instead.

@Spirrwell
Copy link
Author

Spirrwell commented Mar 25, 2020

I don't think CodeLite has a concept of "platforms", but instead it seems everything is a configuration. Whatever you name your configuration is what ends up in the workspace/project files.

There is a default "Debug" and "Release" configuration, but that's it. Everything else you setup and name yourself.

@starkos
Copy link
Member

starkos commented Mar 30, 2020

To confirm, if you add the following to your premake5.lua does it resolve the issue?

premake.override(premake.modules.codelite, "esc", function(oldfn, value)
  return oldfn(value):gsub("|", "_")
end)

@Spirrwell
Copy link
Author

The projects show up with that, but it doesn't build and gives this output:
image

@starkos
Copy link
Member

starkos commented Mar 30, 2020

Thanks, one more: what if you change codelite.lua:24 from this:

cfgname = string.format("%s|%s", cfg.platform, cfg.buildcfg)

…to this:

cfgname = string.format("%s&verbar;%s", cfg.platform, cfg.buildcfg)

If that doesn't work I'll concede and switch it to a "-" (dash).

@Spirrwell
Copy link
Author

That doesn't work
image

samsinsane added a commit that referenced this issue Mar 31, 2020
Fix #1411: Remove "|"  from Codelite config names
@starkos
Copy link
Member

starkos commented Mar 31, 2020

Thanks for checking it, @Spirrwell. I went ahead and fixed with a dash "-".

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

Successfully merging a pull request may close this issue.

3 participants