mutationpp / Mutationpp

The MUlticomponent Thermodynamic And Transport library for IONized gases in C++
GNU Lesser General Public License v3.0
103 stars 58 forks source link

CMake Fortran compiler flags not set properly #190

Closed mgoodson-cvd closed 2 years ago

mgoodson-cvd commented 2 years ago

The CMake Fortran compiler flags defined here are not set properly because the calls to set are missing the CACHE and FORCE attributes. The CMAKE_<LANG>_FLAGS* are defined by CMake and are cached, so we need the CACHE flag when setting them explicitly to override the defaults. We also need the FORCE attribute to override the CMake default values for these variables.

rdbisme commented 2 years ago

Are you sure about this? It's a new behavior? I never had to force cache compiler flags ever before... And I tested the Fortran interface not so long ago and it was working as expected.

mgoodson-cvd commented 2 years ago

It will still work fine as-is, but the Fortran compiler flags will be set to the CMake defaults rather than what you're setting them to be. Check your CMakeCache.txt after running CMake and compare the CMAKE_Fortran_FLAGS* in there against what is being specified here in CMakeLists.txt.

mgoodson-cvd commented 2 years ago

Also, it's worth pointing out that the CMAKE_CXX_FLAGS_Profile are force cached in that same file and they function as expected. I duplicated this behavior in my commit.