-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[lua] Fix library type and usage #24436
Conversation
Sorry, I should have clarified: the thing I want us to try is to have different directories with CMakeLists.txts in them, without any copying of source files. (If I have time today I'm going to try this...) |
According to the official doc:
So we can make a new CMakeLists.txt, add the cpp code to it to avoid this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- IMO the same list variables should be used for main directory and for C++ subdirectory. Avoid redundancy. Of course it needs absolute paths.
- Did you consider moving to
file(GLOB ...)
to collect the headers and sources? - I see the install commands using absolute destination paths. In general, the preferred form is relative paths, and it is shorter. (Not so relevant for vcpkg but enough to catch my eye.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This addresses my concern of multiple copies of sources confusing debuggers, thanks!
I would like to see @dg0yt's comments addressed though.
Such as the headers and sources?
No, lua provides more files than listed. We should only choose some of them.
I will make some update for them. |
* Use "supports" on features rather than if tests plus message FATAL_ERROR * Deduplicate ENABLE_LUA_CPP and COMPILE_AS_CPP * Add quotes. * Use file(INSTALL rather than configure_file(COPYONLY)
Thanks for your fixes! |
Since the library generated by lua's feature
cpp
uses the same source as thec
version of the lua library, usingSET_SOURCE_FILES_PROPERTIES(PROPERTIES LANGUAGE CXX)
anywhere in cmake will cause thec
library to also be built as thecpp
version.So I made a copy of the source code and just declared them as CXX to fix this.
Also export the
INTERFACE_INCLUDE_DIRECTORIES
for usage.Fixes #24413
Already tested build rmlui with / without lua cpp feature.