-
Notifications
You must be signed in to change notification settings - Fork 87
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
standardise cmakelist #76
Conversation
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.
For more context for upstream, me and OP are Fedora packagers and we've encountered some peculiarities while trying to package this project.
The main change here is to install the Config.cmake
file into the libdir
folder, particularly because this is a compiled project.
CMakeLists.txt
Outdated
target_compile_options(${PROJECT_NAME}_objlib PRIVATE $<$<CONFIG:RELEASE>:-s>) | ||
# target_compile_options(${PROJECT_NAME}_objlib PRIVATE $<$<CONFIG:RELEASE>:-s>) | ||
# try to make it optional. removed as it will break debuginfo generation. |
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.
I can't find documentation on the -s
option, but overall I agree that all of these compile flags should be moved outside of the project configuration, since these affect downstream packagers. Use CMakePresets.json
instead. If specific compile flags are indeed needed, please document them and guard them by the compiler ID/family.
For now though, we can circumvent this issue by specifying -DCMAKE_BUILD=RelWithDebInfo
downstream, and minimize the changes of this PR a bit.
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.
-s Remove all symbol table and relocation information from the executable.
https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
Let's split this chnage out for ease of reviewing.
CMakeLists.txt
Outdated
target_compile_options(${PROJECT_NAME}_objlib PRIVATE $<$<CONFIG:RELEASE>:-s>) | ||
# target_compile_options(${PROJECT_NAME}_objlib PRIVATE $<$<CONFIG:RELEASE>:-s>) | ||
# try to make it optional. removed as it will break debuginfo generation. |
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.
-s Remove all symbol table and relocation information from the executable.
https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
Let's split this chnage out for ease of reviewing.
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.
One small nit.
And can you format as one commit with "safestringlib: cmake:" header prefix, message body and Signed-off-by: line?
CMakeLists.txt
Outdated
@@ -184,14 +186,14 @@ if(BUILD_ERROR_ON_WARNING) | |||
target_compile_options(${PROJECT_NAME}_objlib PRIVATE -Werror) | |||
endif() | |||
|
|||
target_compile_options(${PROJECT_NAME}_objlib PRIVATE $<$<CONFIG:RELEASE>:-s>) | |||
target_compile_options(${PROJECT_NAME}_objlib PRIVATE $<$<CONFIG:RELEASE>:-s>) |
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.
please remove stray whitespace
db16981
to
5daa67b
Compare
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.
safestringlib: cmake: standardize cmakelist
Signed-off-by: yoong jin <[email protected]>
Hi, Fedora packager here. This pr is some quick suggestions for improvemnt in the cmakelists file