Fix flags for Intel Fortran on Windows

We replace "/MD" with ifort-specific flags as follows:

  /MD  -> /threads /libs:dll
  /MDd -> /threads /libs:dll /dbglibs

We also enable the "/MD" equivalent for all Fortran configurations.
Previously multithreaded dll runtimes were used for release builds and
threaded static runtimes for debug builds.  For mixed Fortran C/C++
projects, this led to link warnings for Debug but not for Release.

See issue #8744.
This commit is contained in:
Brad King 2009-10-29 10:06:10 -04:00
parent 5075c255f7
commit 537906b467
1 changed files with 3 additions and 3 deletions

View File

@ -53,10 +53,10 @@ ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visu
# does the compiler support pdbtype and is it the newer compiler
SET(CMAKE_BUILD_TYPE_INIT Debug)
SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp")
SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full")
SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads")
SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs")
SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG")
SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/MD /O1 /D NDEBUG")
SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O1 /D NDEBUG")
SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG")
SET (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")