-
Notifications
You must be signed in to change notification settings - Fork 239
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
[CMake] Switched to target_compile_options() instead of CXX_FLAGS #2168
Conversation
Looks good! |
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.
Only minor things.
@@ -20,7 +20,7 @@ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) | |||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) | |||
|
|||
if(COMPILER_IS_CLANG) | |||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments") | |||
add_compile_options(-Qunused-arguments) |
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.
It's not introduced in this PR, but should we really keep that setting?
-Qunused-arguments
Do not emit any warnings for unused driver arguments.
Are the warnings caused by ccache?
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.
From the clang docu
-Qunused-arguments Don’t emit warning for unused driver arguments
I guess it is silencing the ccache options not used by clang. It was added here, isn't it ;) ?
Feel free to remove the option, if there are not too many warnings because of unused ccache options.
@@ -6,7 +6,9 @@ APPEND_SOURCE_FILES(SOURCES InterpolationAlgorithms) | |||
APPEND_SOURCE_FILES(SOURCES Integration) | |||
APPEND_SOURCE_FILES(SOURCES LinAlg) | |||
APPEND_SOURCE_FILES(SOURCES LinAlg/Dense) | |||
APPEND_SOURCE_FILES(SOURCES ODE) | |||
if(CVODE_FOUND) |
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.
Just curious: What was the warning fixed by this commit?
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.
The warning was about that there were no symbols for the implementation of the solver class. No it is simply not part of the project if cvode is not used.
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.
OK, thanks.
scripts/cmake/CompilerSetup.cmake
Outdated
message(STATUS "Set release compiler flags") | ||
add_compile_options(-O3) | ||
elseif(NOT STL_NO_DEBUG) | ||
# Enable assertions in STL in debug mode. |
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.
Aren't they enabled by default, unless some macro is defined?
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.
No they are not defined. They add debug symbols to the libc++. This was added by @endJunction. I checked the docs and found only _GLIBCXX_DEBUG
and _GLIBCXX_DEBUG_PEDANTIC
. I am not sure if the other defines are legit.
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.
Thanks for checking the docs. I thought, bounds checking was enabled by default in debug mode -- another misconception clarified.
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 guess they are dependent on the compiler version. The linked docs are for the newest version. I think it would be not wrong to add _GLIBCXX_DEBUG_PEDANTIC
to the list.
scripts/cmake/CompilerSetup.cmake
Outdated
endif() | ||
|
||
### GNU C/CXX compiler | ||
if(COMPILER_IS_GCC) |
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.
Maybe nest these blocks within the if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL)
?
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.
✅
083d08f
to
0bd25f8
Compare
Simplified CompilerSetup.cmake a bit.
0bd25f8
to
9a5bc7b
Compare
OpenGeoSys development has been moved to GitLab. |
No description provided.