Skip to content

CMake compiler options for build configurations #387

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

Open
awvwgk opened this issue Apr 11, 2021 · 1 comment
Open

CMake compiler options for build configurations #387

awvwgk opened this issue Apr 11, 2021 · 1 comment
Labels
build: cmake Issue with stdlib's CMake build files

Comments

@awvwgk
Copy link
Member

awvwgk commented Apr 11, 2021

The CMake build files currently set options using the add_compile_options function, which adds the respective argument independently from the actual build configuration (we call it profile in fpm).

For context: The CMake build configuration is found in CMAKE_BUILD_TYPE and is empty by default (NoConfig), other common profiles are Debug, RelWithDebInfo, Release, and MinSizeRel, but one can basically use any name. The global compiler options are taken from CMAKE_Fortran_FLAGS and the build configuration specific ones from CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE} (with the value of CMAKE_BUILD_TYPE as uppercase...).

As I understood @milancurcic the current options set with add_compile_options are the debug / development profile, but they are currently added for all build configurations. Instead we should try to set those options to the CMAKE_Fortran_FLAGS_DEBUG variable.

@milancurcic
Copy link
Member

Yes, what I meant in that comment was that we could do this, not that we currently do it.

@awvwgk awvwgk added the build: cmake Issue with stdlib's CMake build files label Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build: cmake Issue with stdlib's CMake build files
Projects
None yet
Development

No branches or pull requests

2 participants