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

[CMake] Switched to target_compile_options() instead of CXX_FLAGS #2168

Merged
merged 4 commits into from
Jul 26, 2018

Conversation

bilke
Copy link
Member

@bilke bilke commented Jul 23, 2018

No description provided.

@endJunction
Copy link
Member

Looks good!

Copy link
Collaborator

@chleh chleh left a 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)
Copy link
Collaborator

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

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)
Copy link
Collaborator

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?

Copy link
Member Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, thanks.

message(STATUS "Set release compiler flags")
add_compile_options(-O3)
elseif(NOT STL_NO_DEBUG)
# Enable assertions in STL in debug mode.
Copy link
Collaborator

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?

Copy link
Member Author

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.

Copy link
Collaborator

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.

Copy link
Member

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.

endif()

### GNU C/CXX compiler
if(COMPILER_IS_GCC)
Copy link
Collaborator

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) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@bilke bilke force-pushed the cmake-compile-options branch 3 times, most recently from 083d08f to 0bd25f8 Compare July 26, 2018 08:25
@bilke bilke merged commit d48dae5 into ufz:master Jul 26, 2018
@bilke bilke deleted the cmake-compile-options branch July 26, 2018 10:27
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants