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

Fix CMake compiler flags logic #3852

Merged
merged 1 commit into from
Aug 6, 2020

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Aug 6, 2020

Remove non-standard CMake logic that appends a whitespace-separated list of compiler flags as a string at the end of a list, making it incompatible with automated build systems like RPM Build (Fedora) and OSC (OpenSUSE).

The CMAKE_CXX_FLAGS CMake variable cannot be added directly to an
INTERFACE target. This will duplicate it at the end of the list as
a whole string, which can lead to a compiler error. For example,
`CXXFLAGS="-O3 -Wall" cmake ..` will generate a compilation command
in the form `c++ <flags> -O3 -Wall <flags> "-O3 -Wall" <filenames>`,
which is incorrect (there is no optimization level "3 -Wall"). This
will fail randomly depending on the compiler. This is incompatible
with automated build systems such as RPM Build and OSC.
@jngrad jngrad added the automerge Merge with kodiak label Aug 6, 2020
@kodiakhq kodiakhq bot merged commit a3e4356 into espressomd:python Aug 6, 2020
@jngrad jngrad deleted the fix-cmake-rpmbuild branch January 18, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants