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

standardise cmakelist #76

Merged
merged 1 commit into from
Mar 25, 2025
Merged

standardise cmakelist #76

merged 1 commit into from
Mar 25, 2025

Conversation

solomoncyj
Copy link
Contributor

@solomoncyj solomoncyj commented Oct 5, 2024

Hi, Fedora packager here. This pr is some quick suggestions for improvemnt in the cmakelists file

@solomoncyj solomoncyj changed the title staderdise cmakelist standardise cmakelist Oct 5, 2024
Copy link

@LecrisUT LecrisUT left a 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
Comment on lines 187 to 189
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.

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.

Copy link
Contributor

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
Comment on lines 187 to 189
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.
Copy link
Contributor

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.

Copy link
Contributor

@ausyskin ausyskin left a 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>)
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove stray whitespace

@solomoncyj solomoncyj force-pushed the patch-1 branch 2 times, most recently from db16981 to 5daa67b Compare March 24, 2025 10:40
Copy link
Contributor

@ausyskin ausyskin left a 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

@ausyskin ausyskin merged commit e72c3ae into intel:master Mar 25, 2025
3 checks passed
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.

3 participants