From d8bb5ae4fe6a43cc9c0af5468a856a9110257603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Thu, 21 Sep 2023 23:15:15 +0200 Subject: [PATCH] New upstream version 3.27.6 --- Help/release/3.27.rst | 4 ++-- Source/CMakeVersion.cmake | 4 ++-- Source/cmComputeLinkInformation.cxx | 5 +++-- Tests/FortranModules/CMakeLists.txt | 9 +++++++++ Tests/FortranModules/Issue25112/CMakeLists.txt | 4 ++++ .../Issue25112}/objmain.f90 | 0 .../Issue25112}/objmod.f90 | 0 Tests/FortranModules/Issue25223/CMakeLists.txt | 15 +++++++++++++++ Tests/FortranModules/Issue25223/m1.f90 | 11 +++++++++++ Tests/FortranModules/Issue25223/m2.f90 | 13 +++++++++++++ Tests/FortranModules/Issue25223/m3.f90 | 13 +++++++++++++ Tests/FortranModules/Issue25223/m4.f90 | 13 +++++++++++++ Tests/FortranModules/Issue25223/main.f90 | 15 +++++++++++++++ .../Issue25252-iface-sources/CMakeLists.txt | 9 +++++++++ .../Issue25252-iface-sources/iface.f90 | 11 +++++++++++ .../FortranModules/Issue25252-iface-sources/lib.c | 4 ++++ .../Issue25252-iface-sources/lib.f90 | 13 +++++++++++++ .../Issue25252-iface-target/CMakeLists.txt | 5 +++++ .../Issue25252-iface-target/iface.f90 | 5 +++++ .../Issue25252-iface-target/lib.f90 | 11 +++++++++++ Tests/FortranModules/Issue25252/CMakeLists.txt | 6 ++++++ Tests/FortranModules/Issue25252/custom_target.f90 | 5 +++++ Tests/FortranModules/Issue25252/lib.f90 | 11 +++++++++++ Tests/FortranOnly/CMakeLists.txt | 6 ------ 24 files changed, 180 insertions(+), 12 deletions(-) create mode 100644 Tests/FortranModules/Issue25112/CMakeLists.txt rename Tests/{FortranOnly => FortranModules/Issue25112}/objmain.f90 (100%) rename Tests/{FortranOnly => FortranModules/Issue25112}/objmod.f90 (100%) create mode 100644 Tests/FortranModules/Issue25223/CMakeLists.txt create mode 100644 Tests/FortranModules/Issue25223/m1.f90 create mode 100644 Tests/FortranModules/Issue25223/m2.f90 create mode 100644 Tests/FortranModules/Issue25223/m3.f90 create mode 100644 Tests/FortranModules/Issue25223/m4.f90 create mode 100644 Tests/FortranModules/Issue25223/main.f90 create mode 100644 Tests/FortranModules/Issue25252-iface-sources/CMakeLists.txt create mode 100644 Tests/FortranModules/Issue25252-iface-sources/iface.f90 create mode 100644 Tests/FortranModules/Issue25252-iface-sources/lib.c create mode 100644 Tests/FortranModules/Issue25252-iface-sources/lib.f90 create mode 100644 Tests/FortranModules/Issue25252-iface-target/CMakeLists.txt create mode 100644 Tests/FortranModules/Issue25252-iface-target/iface.f90 create mode 100644 Tests/FortranModules/Issue25252-iface-target/lib.f90 create mode 100644 Tests/FortranModules/Issue25252/CMakeLists.txt create mode 100644 Tests/FortranModules/Issue25252/custom_target.f90 create mode 100644 Tests/FortranModules/Issue25252/lib.f90 diff --git a/Help/release/3.27.rst b/Help/release/3.27.rst index 72386ee4d..e0b72cd27 100644 --- a/Help/release/3.27.rst +++ b/Help/release/3.27.rst @@ -285,8 +285,8 @@ Changes made since CMake 3.27.0 include the following. to select the Windows 8.1 SDK. In CMake 3.27.[0-1] the ``version=`` field was limited to selecting Windows 10 SDKs. -3.27.3, 3.27.4, 3.27.5 ----------------------- +3.27.3, 3.27.4, 3.27.5, 3.27.6 +------------------------------ * These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1d949902d..fc738def3 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 27) -set(CMake_VERSION_PATCH 5) +set(CMake_VERSION_PATCH 6) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) @@ -21,7 +21,7 @@ endif() if(NOT CMake_VERSION_NO_GIT) # If this source was exported by 'git archive', use its commit info. - set(git_info [==[7d3b4868d0 CMake 3.27.5]==]) + set(git_info [==[51b34a5483 CMake 3.27.6]==]) # Otherwise, try to identify the current development source version. if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* " diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 480456584..7d3675ed5 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -539,8 +539,9 @@ bool cmComputeLinkInformation::Compute() this->Target->GetType() == cmStateEnums::SHARED_LIBRARY || this->Target->GetType() == cmStateEnums::MODULE_LIBRARY || this->Target->GetType() == cmStateEnums::STATIC_LIBRARY || - this->Target->HaveCxx20ModuleSources() || - this->Target->HaveFortranSources())) { + (this->Target->CanCompileSources() && + (this->Target->HaveCxx20ModuleSources() || + this->Target->HaveFortranSources())))) { return false; } diff --git a/Tests/FortranModules/CMakeLists.txt b/Tests/FortranModules/CMakeLists.txt index 5c76132ba..00f3e570c 100644 --- a/Tests/FortranModules/CMakeLists.txt +++ b/Tests/FortranModules/CMakeLists.txt @@ -125,3 +125,12 @@ add_subdirectory(Executable) if(CMake_TEST_Fortran_SUBMODULES) add_subdirectory(Submodules) endif() + +add_subdirectory(Issue25112) +add_subdirectory(Issue25223) +if( # Intel Fortran VS Integration breaks on custom targets with Fortran sources + NOT CMAKE_GENERATOR MATCHES "Visual Studio") + add_subdirectory(Issue25252) + add_subdirectory(Issue25252-iface-target) +endif() +add_subdirectory(Issue25252-iface-sources) diff --git a/Tests/FortranModules/Issue25112/CMakeLists.txt b/Tests/FortranModules/Issue25112/CMakeLists.txt new file mode 100644 index 000000000..cf0c69e87 --- /dev/null +++ b/Tests/FortranModules/Issue25112/CMakeLists.txt @@ -0,0 +1,4 @@ +set(CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/include") +add_library(objmod OBJECT objmod.f90) +add_executable(objmain objmain.f90) +target_link_libraries(objmain PRIVATE objmod) diff --git a/Tests/FortranOnly/objmain.f90 b/Tests/FortranModules/Issue25112/objmain.f90 similarity index 100% rename from Tests/FortranOnly/objmain.f90 rename to Tests/FortranModules/Issue25112/objmain.f90 diff --git a/Tests/FortranOnly/objmod.f90 b/Tests/FortranModules/Issue25112/objmod.f90 similarity index 100% rename from Tests/FortranOnly/objmod.f90 rename to Tests/FortranModules/Issue25112/objmod.f90 diff --git a/Tests/FortranModules/Issue25223/CMakeLists.txt b/Tests/FortranModules/Issue25223/CMakeLists.txt new file mode 100644 index 000000000..f2afcb95d --- /dev/null +++ b/Tests/FortranModules/Issue25223/CMakeLists.txt @@ -0,0 +1,15 @@ +# See https://gist.github.com/scivision/8e3070319f0577f7d3efcba863638cae +set(CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/include") +add_library(m1 OBJECT m1.f90) + +add_library(m2 OBJECT m2.f90) +target_link_libraries(m2 PRIVATE m1) + +add_library(m3 OBJECT m3.f90) +target_link_libraries(m3 PRIVATE m2) + +add_library(m4 OBJECT m4.f90) +target_link_libraries(m4 PRIVATE m3) + +add_executable(main25223 main.f90) +target_link_libraries(main25223 PRIVATE m4 m3 m2 m1) diff --git a/Tests/FortranModules/Issue25223/m1.f90 b/Tests/FortranModules/Issue25223/m1.f90 new file mode 100644 index 000000000..6b5ddd59f --- /dev/null +++ b/Tests/FortranModules/Issue25223/m1.f90 @@ -0,0 +1,11 @@ +module m1 + +implicit none + +contains + +pure real function pi() +pi = 4*atan(1.) +end function + +end module m1 diff --git a/Tests/FortranModules/Issue25223/m2.f90 b/Tests/FortranModules/Issue25223/m2.f90 new file mode 100644 index 000000000..c614d0e00 --- /dev/null +++ b/Tests/FortranModules/Issue25223/m2.f90 @@ -0,0 +1,13 @@ +module m2 + +use m1, only : pi + +implicit none + +contains + +pure real function twopi() +twopi = 2*pi() +end function + +end module diff --git a/Tests/FortranModules/Issue25223/m3.f90 b/Tests/FortranModules/Issue25223/m3.f90 new file mode 100644 index 000000000..a29ca840e --- /dev/null +++ b/Tests/FortranModules/Issue25223/m3.f90 @@ -0,0 +1,13 @@ +module m3 + +use m2, only : twopi + +implicit none + +contains + +pure real function fourpi() +fourpi = 2*twopi() +end function + +end module diff --git a/Tests/FortranModules/Issue25223/m4.f90 b/Tests/FortranModules/Issue25223/m4.f90 new file mode 100644 index 000000000..b1ec1a823 --- /dev/null +++ b/Tests/FortranModules/Issue25223/m4.f90 @@ -0,0 +1,13 @@ +module m4 + +use m3, only : fourpi + +implicit none + +contains + +pure real function halfpi() +halfpi = fourpi() / 8.0 +end function + +end module diff --git a/Tests/FortranModules/Issue25223/main.f90 b/Tests/FortranModules/Issue25223/main.f90 new file mode 100644 index 000000000..3ec392024 --- /dev/null +++ b/Tests/FortranModules/Issue25223/main.f90 @@ -0,0 +1,15 @@ +program main + +use m1, only : pi +use m4, only : halfpi + +implicit none + +real :: rpi, rhalfpi + +rpi = pi() / 2 +rhalfpi = halfpi() + +print '(a,ES15.8)', 'floating point precision loss: ', rpi - rhalfpi + +end program diff --git a/Tests/FortranModules/Issue25252-iface-sources/CMakeLists.txt b/Tests/FortranModules/Issue25252-iface-sources/CMakeLists.txt new file mode 100644 index 000000000..574435f6b --- /dev/null +++ b/Tests/FortranModules/Issue25252-iface-sources/CMakeLists.txt @@ -0,0 +1,9 @@ +enable_language(C) + +add_library(fortran_source_iface_sources STATIC lib.c) +target_sources(fortran_source_iface_sources + INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/iface.f90") + +add_library(lib25252-iface-sources lib.f90) +target_link_libraries(lib25252-iface-sources PRIVATE fortran_source_iface_sources) diff --git a/Tests/FortranModules/Issue25252-iface-sources/iface.f90 b/Tests/FortranModules/Issue25252-iface-sources/iface.f90 new file mode 100644 index 000000000..6b5ddd59f --- /dev/null +++ b/Tests/FortranModules/Issue25252-iface-sources/iface.f90 @@ -0,0 +1,11 @@ +module m1 + +implicit none + +contains + +pure real function pi() +pi = 4*atan(1.) +end function + +end module m1 diff --git a/Tests/FortranModules/Issue25252-iface-sources/lib.c b/Tests/FortranModules/Issue25252-iface-sources/lib.c new file mode 100644 index 000000000..6ccdb8d86 --- /dev/null +++ b/Tests/FortranModules/Issue25252-iface-sources/lib.c @@ -0,0 +1,4 @@ +int f() +{ + return 0; +} diff --git a/Tests/FortranModules/Issue25252-iface-sources/lib.f90 b/Tests/FortranModules/Issue25252-iface-sources/lib.f90 new file mode 100644 index 000000000..f97190970 --- /dev/null +++ b/Tests/FortranModules/Issue25252-iface-sources/lib.f90 @@ -0,0 +1,13 @@ +module lib + +use m1, only : pi + +implicit none + +contains + +pure real function func() +func = pi() +end function + +end module diff --git a/Tests/FortranModules/Issue25252-iface-target/CMakeLists.txt b/Tests/FortranModules/Issue25252-iface-target/CMakeLists.txt new file mode 100644 index 000000000..b312fcdd5 --- /dev/null +++ b/Tests/FortranModules/Issue25252-iface-target/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(fortran_source_iface INTERFACE + iface.f90) + +add_library(lib25252-iface-target lib.f90) +add_dependencies(lib25252-iface-target fortran_source_iface) diff --git a/Tests/FortranModules/Issue25252-iface-target/iface.f90 b/Tests/FortranModules/Issue25252-iface-target/iface.f90 new file mode 100644 index 000000000..0528d4125 --- /dev/null +++ b/Tests/FortranModules/Issue25252-iface-target/iface.f90 @@ -0,0 +1,5 @@ +program main + +implicit none + +end program diff --git a/Tests/FortranModules/Issue25252-iface-target/lib.f90 b/Tests/FortranModules/Issue25252-iface-target/lib.f90 new file mode 100644 index 000000000..a6d7fa629 --- /dev/null +++ b/Tests/FortranModules/Issue25252-iface-target/lib.f90 @@ -0,0 +1,11 @@ +module lib + +implicit none + +contains + +pure real function func() +func = 1.0 +end function + +end module diff --git a/Tests/FortranModules/Issue25252/CMakeLists.txt b/Tests/FortranModules/Issue25252/CMakeLists.txt new file mode 100644 index 000000000..8111c4290 --- /dev/null +++ b/Tests/FortranModules/Issue25252/CMakeLists.txt @@ -0,0 +1,6 @@ +add_custom_target(custom_target_with_fortran + COMMAND "${CMAKE_COMMAND}" -E echo "custom target with fortran sources" + SOURCES custom_target.f90) + +add_library(lib25252 lib.f90) +add_dependencies(lib25252 custom_target_with_fortran) diff --git a/Tests/FortranModules/Issue25252/custom_target.f90 b/Tests/FortranModules/Issue25252/custom_target.f90 new file mode 100644 index 000000000..0528d4125 --- /dev/null +++ b/Tests/FortranModules/Issue25252/custom_target.f90 @@ -0,0 +1,5 @@ +program main + +implicit none + +end program diff --git a/Tests/FortranModules/Issue25252/lib.f90 b/Tests/FortranModules/Issue25252/lib.f90 new file mode 100644 index 000000000..a6d7fa629 --- /dev/null +++ b/Tests/FortranModules/Issue25252/lib.f90 @@ -0,0 +1,11 @@ +module lib + +implicit none + +contains + +pure real function func() +func = 1.0 +end function + +end module diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index dfc28dd81..02bf2b857 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -186,9 +186,3 @@ if(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF AND set_property(SOURCE no_preprocess_source_upper.F no_preprocess_source_fpp.fpp PROPERTY Fortran_PREPROCESS OFF) endif() - -# Issue 25112 -set(CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/include") -add_library(objmod OBJECT objmod.f90) -add_executable(objmain objmain.f90) -target_link_libraries(objmain PRIVATE objmod)