I noticed that the
CMAKE_Fortran_VISIBILITY_PRESET behaves somewhat different than the same flag for other languages in that it cannot be specified from the cmake command line:
cmake . -DCMAKE_Fortran_VISIBILITY_PRESET=hidden cmake --build . --verbose
Manually-specified variables were not used by the project: CMAKE_Fortran_VISIBILITY_PRESET
and doesn’t result in
-fvisibility=hidden being passed during compilation. This works as expected for C/CXX, but for fortran, it only works if the flag is
set() in the CMakeLists.txt.
cmTarget.cxx, I suspect it is due to neither
initProp("Fortran_VISIBILITY_PRESET") being called.
sorry if this is not the correct category to post under.