Skip to content

Commit

Permalink
Set <Project>_ENABLE_Fortran=OFF by default for WIN32 (TriBITSPub#299)
Browse files Browse the repository at this point in the history
It is very hard to get a Fortran compiler for native Windows so do everyone a
favor and just disable it by default for WIN32.
  • Loading branch information
bartlettroscoe committed Nov 18, 2021
1 parent 8ee5942 commit 246296b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tribits/ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Release Notes for TriBITS
----------------------------------------

2021/11/18:

(*) MAJOR: The default value for <Project>_ENABLE_Fortran is set to OFF on
WIN32 systems. (Getting a Fortran compiler for native Windows is not
typically very easy.)

2021/10/11:

(*) MAJOR: The `<Package>Config.cmake` for each enabled package generated in
Expand Down
6 changes: 5 additions & 1 deletion tribits/core/package_arch/TribitsGlobalMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ macro(tribits_define_global_options_and_define_extra_repos)
set(${PROJECT_NAME}_ENABLE_CXX11 ON)

if ("${${PROJECT_NAME}_ENABLE_Fortran_DEFAULT}" STREQUAL "")
set(${PROJECT_NAME}_ENABLE_Fortran_DEFAULT ON)
if (WIN32)
set(${PROJECT_NAME}_ENABLE_Fortran_DEFAULT OFF)
else()
set(${PROJECT_NAME}_ENABLE_Fortran_DEFAULT ON)
endif()
endif()

option(${PROJECT_NAME}_ENABLE_Fortran
Expand Down
4 changes: 4 additions & 0 deletions tribits/doc/guides/TribitsCoreDetailedReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ These options are described below.

This default can be set in `<projectDir>/ProjectName.cmake`_ or `<projectDir>/CMakeLists.txt`_.

On WIN32 sytems, the default for ``${PROJECT_NAME}_ENABLE_Fortran_DEFAULT``
is set to ``OFF`` since it can be difficult to get a Fortran compiler for
native Windows.

Given that a native Fortran compiler is not supported by default on Windows
and on most Mac OSX systems, projects that have optional Fortran code may
decide to set the default depending on the platform by setting, for example::
Expand Down

0 comments on commit 246296b

Please sign in to comment.