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

Fix quote escaping in Codelite. #1506

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

Jarod42
Copy link
Contributor

@Jarod42 Jarod42 commented Aug 30, 2020

What does this PR do?

Fix quote escaping in Codelite.
-> fix define with quote
-> fix SharedLib (at least on windows).

improve/fix #1275

How does this PR change Premake's behavior?

No Core changes, only codelite generator

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits

-> fix define with quote
-> fix SharedLib (at least on windows).
@@ -40,7 +40,7 @@
local result = value:gsub('&', '&')
result = result:gsub('<', '&lt;')
result = result:gsub('>', '&gt;')
result = result:gsub('"', '\\&quot;')
result = result:gsub('"', '&quot;')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit hesitant to approve this, the \ was required. Does the Premake project still build with CodeLite with this change?

Copy link
Contributor Author

@Jarod42 Jarod42 Aug 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me adding extra \ breaks defines with quotes and sharedLib (on windows).

premake project doesn't use either so it is identical for it.

It is the downside of simple UTs without integration testing ;-)

With my sample project, I now have

-shared;-Wl,--out-implib="bin/Debug/sharedLib.lib"
("C:/msys64/mingw64/bin/x86_64-w64-mingw32-g++.exe" -shared -fPIC -o bin/Debug/sharedLib.dll @"sharedLib.txt" -LC:\msys64\mingw64\lib -L. -shared -Wl,--out-implib="bin/Debug/sharedLib.lib"
)

instead of previous
-shared;-Wl,--out-implib=\"bin/Debug/sharedLib.lib\"
(``"C:/msys64/mingw64/bin/x86_64-w64-mingw32-g++.exe" -shared -fPIC -o bin/Debug/sharedLib.dll @"sharedLib.txt" -LC:\msys64\mingw64\lib -L. -shared -Wl,--out-implib="bin/Debug/sharedLib.lib" ) with cannot create `"bin/Debug/sharedLib.lib"` (quote in name of file).

Moreover, it makes sense to not have to escape &quot; which already mean quote (which might be string delimiter or inside string).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

premake project doesn't use either so it is identical for it.

It does, can you answer my question now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no problem here.

@samsinsane samsinsane merged commit 670935a into premake:master Aug 31, 2020
@Jarod42 Jarod42 deleted the FixQuoteEscapingForCodelite branch August 31, 2020 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants