OptimizeReferences and EnableCOMDATFolding linker options are ignored with "Visual Studio 15 2017" generator for Fortran projects.
I'm trying to build Fortran projects with generated solution but I found flags missing issue.
- I added following flags to CMakeLists.txt
target_link_options(${PROJECT_NAME} PRIVATE ... /OPT:REF;/OPT:ICF; ... )
- Then I generated soludion from CMakeLists.txt using Visual Studio 15 2017 Win64 generator. Generated *.vfproj contains next strings:
EnableCOMDATFolding="2"
OptimizeReferences="2"
- Then I'm trying to build it with following command:
cmake --build "build_dir" --config "Release"
As a result: mentioned options haven't passed to link command line and absent at build log. Even more: they were deleted from generated *.vfproj file with visual studio. Maybe there is some kind of verification stage before build itself(formatting of generated *.vfproj is also changed).
So, I guess the problem at stage 2. CMake should generate following:
for /OPT:ICF
EnableCOMDATFolding="optFolding"
for /OPT:NOICF
EnableCOMDATFolding="optNoFolding"
for /OPT:REF
OptimizeReferences="optReferences"
for /OPT:NOREF
EnableCOMDATFolding="optNoReferences"
Note: generator NMake Makefiles works well.
I'm using:
CMake 3.13
Visual Studio 15.9.16
parallel studio xe 2017.6