h5fortran icon indicating copy to clipboard operation
h5fortran copied to clipboard

Use CMAKE_Fortran_Flags in compile options

Open gekowa opened this issue 3 years ago • 3 comments

gekowa avatar Aug 18 '22 03:08 gekowa

This variable is used to initialize the compiler options for every target, every source file of that language https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html

I.e. this change shouldn't have any effect as those options are already implemented for all targets by CMake

scivision avatar Aug 18 '22 17:08 scivision

This variable is used to initialize the compiler options for every target, every source file of that language https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html

I.e. this change shouldn't have any effect as those options are already implemented for all targets by CMake

Oh, that makes sense. I'll improve later.

gekowa avatar Aug 18 '22 18:08 gekowa

The reason that I created this PR is that I'd like to have a place to pass '-fPIC' to the compiler, especially. ifort, or I have to manually modify CMakeLists.txt to add this compiler option each time. So, if CMAKE_LANG_FLAGS were not appropriate, please let me know if there's a better place. Thank you!

gekowa avatar Aug 23 '22 03:08 gekowa