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

Projects
None yet
3 participants
@bilke
Copy link
Member

bilke commented Jul 23, 2018

No description provided.

@endJunction

This comment has been minimized.

Copy link
Member

endJunction commented Jul 23, 2018

Looks good!

@chleh

chleh approved these changes Jul 24, 2018

Copy link
Collaborator

chleh left a comment

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)

This comment has been minimized.

@chleh

chleh Jul 24, 2018

Collaborator

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?

This comment has been minimized.

@bilke

This comment has been minimized.

@endJunction

endJunction Jul 26, 2018

Member

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)

This comment has been minimized.

@chleh

chleh Jul 24, 2018

Collaborator

Just curious: What was the warning fixed by this commit?

This comment has been minimized.

@bilke

bilke Jul 26, 2018

Author Member

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.

This comment has been minimized.

@chleh

chleh Jul 26, 2018

Collaborator

OK, thanks.

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

This comment has been minimized.

@chleh

chleh Jul 24, 2018

Collaborator

Aren't they enabled by default, unless some macro is defined?

This comment has been minimized.

@bilke

bilke Jul 26, 2018

Author Member

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.

This comment has been minimized.

@chleh

chleh Jul 26, 2018

Collaborator

Thanks for checking the docs. I thought, bounds checking was enabled by default in debug mode -- another misconception clarified.

This comment has been minimized.

@endJunction

endJunction Jul 26, 2018

Member

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)

This comment has been minimized.

@chleh

chleh Jul 24, 2018

Collaborator

Maybe nest these blocks within the if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL) ?

This comment has been minimized.

@bilke

bilke Jul 26, 2018

Author Member

@bilke bilke force-pushed the bilke:cmake-compile-options branch 3 times, most recently from 083d08f to 0bd25f8 Jul 26, 2018

bilke added some commits Jul 23, 2018

@bilke bilke force-pushed the bilke:cmake-compile-options branch from 0bd25f8 to 9a5bc7b Jul 26, 2018

@bilke bilke merged commit d48dae5 into ufz:master Jul 26, 2018

2 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
deploy/netlify Deploy preview ready!
Details

@bilke bilke deleted the bilke:cmake-compile-options branch Jul 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.