-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
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") |
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.
Is it too much to ask for the name to beReleaseWithDebugInfo
?
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.
Yes :) This is a standard CMake build type.
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.
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 has been on my todo list for a while so thanks for getting to it! Just a couple suggestions, nothing blocking.
production/CMakeLists.txt
Outdated
@@ -106,6 +106,15 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") | |||
set_property(CACHE SANITIZER PROPERTY STRINGS "ASAN") | |||
endif() | |||
|
|||
# Release with DebugInfo build-specific options. |
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.
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?
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.
Sure.
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.
Done, I expect to get rid of those if as soon as we get rid of GAIA_COMPILE_FLAGS/GAIA_LINK_FLAGS.
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.
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.
production/CMakeLists.txt
Outdated
# 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") |
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.
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.
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.
Don't want to bikeshed but would -Og be more appropriate here?
Probably yes.
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.
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 :) |
RelWithDebInfo is necessary to debug the translation engine which, if compiled in Debug mode, is REALLY REALLY slow (1 minute to translate).