geospace-code / h5fortran

Lightweight HDF5 polymorphic Fortran: h5write() h5read()
https://geospace-code.github.io/h5fortran
BSD 3-Clause "New" or "Revised" License
99 stars 24 forks source link

Use CMAKE_Fortran_Flags in compile options #34

Closed gekowa closed 2 years ago

scivision commented 2 years ago

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

gekowa commented 2 years ago

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 commented 2 years ago

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!