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

Handle RelWithDebInfo in CMake #751

Merged
merged 4 commits into from
Jun 22, 2021
Merged

Handle RelWithDebInfo in CMake #751

merged 4 commits into from
Jun 22, 2021

Conversation

simone-gaia
Copy link
Contributor

RelWithDebInfo is necessary to debug the translation engine which, if compiled in Debug mode, is REALLY REALLY slow (1 minute to translate).

RelWithDebInfo is necessary to debug the translation engine which, if compiled in Debug mode, is REALLY REALLY slow (1 minute to translate).
@@ -80,7 +80,7 @@ if(BUILD_GAIA_RELEASE OR BUILD_GAIA_LLVM_TESTS)
# LLD/libc++ are necessary for MSan.
set(LLVM_ENABLE_LLD ON CACHE BOOL "")
set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it too much to ask for the name to beReleaseWithDebugInfo?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes :) This is a standard CMake build type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@senderista senderista left a comment

Choose a reason for hiding this comment

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

This has been on my todo list for a while so thanks for getting to it! Just a couple suggestions, nothing blocking.

@@ -106,6 +106,15 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_property(CACHE SANITIZER PROPERTY STRINGS "ASAN")
endif()

# Release with DebugInfo build-specific options.
Copy link
Contributor

Choose a reason for hiding this comment

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

Almost all these options are duplicated between Debug and RelWithDebInfo. Can we coalesce all of them except the the optimization level into one if() block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I expect to get rid of those if as soon as we get rid of GAIA_COMPILE_FLAGS/GAIA_LINK_FLAGS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, I've already gotten rid of these in the example app cmake files but had a little trouble with the production cmake files (quoting issues), and didn't want to spend more time on it.

# Don't omit debug symbols from any built binaries.
add_compile_options(-fno-limit-debug-info)

set(GAIA_COMPILE_FLAGS "-c -Wall -Wextra -O2 -g3 -ggdb -fno-omit-frame-pointer -fno-optimize-sibling-calls -ggnu-pubnames -gsplit-dwarf -ftime-trace")
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't want to bikeshed but would -Og be more appropriate here? I don't think it's a big deal either way; -O2 seems to be the default level for RelWithDebInfo anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't want to bikeshed but would -Og be more appropriate here?

Probably yes.

Copy link
Contributor

@LaurentiuCristofor LaurentiuCristofor left a comment

Choose a reason for hiding this comment

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

Looks good, but it would be nice to avoid the abbreviations. If I'd use this new type of build I'd type it once (or just copy paste it from somewhere) and then get the command from history, so the use of abbreviations doesn't really make my life any easier.

@senderista
Copy link
Contributor

Looks good, but it would be nice to avoid the abbreviations. If I'd use this new type of build I'd type it once (or just copy paste it from somewhere) and then get the command from history, so the use of abbreviations doesn't really make my life any easier.

Feel free to file a bug on CMake :)

@LaurentiuCristofor LaurentiuCristofor changed the title Hanlde RelWithDebInfo in CMake Handle RelWithDebInfo in CMake Jun 22, 2021
@simone-gaia simone-gaia merged commit 4a0967f into master Jun 22, 2021
@simone-gaia simone-gaia deleted the simone-relwithdebuginfo branch August 11, 2021 15:05
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