diff options
author | Adriaan de Groot <adridg@FreeBSD.org> | 2021-02-10 11:21:31 +0000 |
---|---|---|
committer | Adriaan de Groot <adridg@FreeBSD.org> | 2021-02-10 11:21:31 +0000 |
commit | 406bf0b60228fd78aecd73efd8f52d9040f669fa (patch) | |
tree | ebe01f2f3ed79071c3b6e9d0fa2ada3567d1241b /devel/cmake | |
parent | 8b1c951e17d8c2e5fb1a5112f9582ed934aa7615 (diff) | |
download | ports-406bf0b60228fd78aecd73efd8f52d9040f669fa.tar.gz ports-406bf0b60228fd78aecd73efd8f52d9040f669fa.zip |
Backport a Fortran-with-CMake patch from CMake 3.20
This is already merged upstream and slated for 3.20, but is convenient
to have in ports now (with CMake 3.19.4). It allows propagating
CMAKE_EXE_LINKER_FLAGS into fortran-compatibility-tests in the face
of post-CMake-3.10 policy settings.
Patch from yuri@, only massaged to avoid having an octothorpe in
a filename.
PR: 253381
Submitted by: yuri@
Obtained from: upstream
Notes
Notes:
svn path=/head/; revision=564851
Diffstat (limited to 'devel/cmake')
-rw-r--r-- | devel/cmake/Makefile | 1 | ||||
-rw-r--r-- | devel/cmake/files/patch-cmake-issue-21408 | 59 |
2 files changed, 60 insertions, 0 deletions
diff --git a/devel/cmake/Makefile b/devel/cmake/Makefile index 0cc1bcc11d35..f71626987320 100644 --- a/devel/cmake/Makefile +++ b/devel/cmake/Makefile @@ -4,6 +4,7 @@ PORTNAME= cmake # Remember to update devel/cmake-doc and devel/cmake-gui as well. DISTVERSION= 3.19.4 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= https://github.com/Kitware/CMake/releases/download/v${DISTVERSION}/ \ https://www.cmake.org/files/v${PORTVERSION}/ diff --git a/devel/cmake/files/patch-cmake-issue-21408 b/devel/cmake/files/patch-cmake-issue-21408 new file mode 100644 index 000000000000..3968ff8e8a08 --- /dev/null +++ b/devel/cmake/files/patch-cmake-issue-21408 @@ -0,0 +1,59 @@ +- Backport https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5483/diffs?commit_id=15e77fbd40e324fd0be394a73ed94800bb47ad2e that is schedueled for 3.20 + +diff --git Modules/FortranCInterface.cmake Modules/FortranCInterface.cmake +index 547346ba90782d765cac860f755641cfb55b6dcf..733c7232c737e1c9a721124fc8a5465eaf872d91 100644 +--- Modules/FortranCInterface.cmake ++++ Modules/FortranCInterface.cmake +@@ -343,6 +343,13 @@ function(FortranCInterface_VERIFY) + set(_desc "Verifying Fortran/${lang} Compiler Compatibility") + message(CHECK_START "${_desc}") + ++ cmake_policy(GET CMP0056 _FortranCInterface_CMP0056) ++ if(_FortranCInterface_CMP0056 STREQUAL "NEW") ++ set(_FortranCInterface_EXE_LINKER_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}") ++ else() ++ set(_FortranCInterface_EXE_LINKER_FLAGS "") ++ endif() ++ + # Build a sample project which reports symbols. + set(CMAKE_TRY_COMPILE_CONFIGURATION Release) + try_compile(FortranCInterface_VERIFY_${lang}_COMPILED +@@ -358,6 +365,7 @@ function(FortranCInterface_VERIFY) + "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}" + "-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}" + "-DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}" ++ ${_FortranCInterface_EXE_LINKER_FLAGS} + OUTPUT_VARIABLE _output) + file(WRITE "${FortranCInterface_BINARY_DIR}/Verify${lang}/output.txt" "${_output}") + +diff --git Modules/FortranCInterface/Detect.cmake Modules/FortranCInterface/Detect.cmake +index c75067b32e4b7eeba1edf7d6bc6acc3798032dd7..998faf1eccf92f654f78ea66f2a34a8b05b5f991 100644 +--- Modules/FortranCInterface/Detect.cmake ++++ Modules/FortranCInterface/Detect.cmake +@@ -26,6 +26,14 @@ unset(FortranCInterface_VERIFIED_CXX CACHE) + + set(_result) + ++cmake_policy(GET CMP0056 _FortranCInterface_CMP0056) ++if(_FortranCInterface_CMP0056 STREQUAL "NEW") ++ set(_FortranCInterface_EXE_LINKER_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}") ++else() ++ set(_FortranCInterface_EXE_LINKER_FLAGS "") ++endif() ++unset(_FortranCInterface_CMP0056) ++ + # Build a sample project which reports symbols. + set(CMAKE_TRY_COMPILE_CONFIGURATION Release) + try_compile(FortranCInterface_COMPILED +@@ -38,9 +46,11 @@ try_compile(FortranCInterface_COMPILED + "-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}" + "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}" + "-DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}" ++ ${_FortranCInterface_EXE_LINKER_FLAGS} + OUTPUT_VARIABLE FortranCInterface_OUTPUT) + set(FortranCInterface_COMPILED ${FortranCInterface_COMPILED}) + unset(FortranCInterface_COMPILED CACHE) ++unset(_FortranCInterface_EXE_LINKER_FLAGS) + + # Locate the sample project executable. + set(FortranCInterface_EXE) |