diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst index 336137f5f..03eb0762b 100644 --- a/Help/dev/experimental.rst +++ b/Help/dev/experimental.rst @@ -41,7 +41,8 @@ to tell CMake how to invoke the C++20 module dependency scanning tool. MSVC 19.34 (provided with Visual Studio 17.4) and above contains the support that CMake needs and has these variables already set up as required and only -the UUID variable needs to be set. +the UUID and the ``CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP`` variables need to be +set. For example, add code like the following to a test project: @@ -76,8 +77,9 @@ For compilers that generate module maps, tell CMake as follows: set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FLAG "${compiler_flags_for_module_map} -fmodule-mapper=") -Currently, the only supported format is ``gcc``. The format is described in -the GCC documentation, but the relevant section for the purposes of CMake is: +Currently, the only supported formats are ``gcc`` and ``msvc``. The ``gcc`` +format is described in the GCC documentation, but the relevant section for the +purposes of CMake is: A mapping file consisting of space-separated module-name, filename pairs, one per line. Only the mappings for the direct imports and any @@ -88,6 +90,10 @@ the GCC documentation, but the relevant section for the purposes of CMake is: -- GCC module mapper documentation +The ``msvc`` format is a response file containing flags required to compile +any module interfaces properly as well as find any required files to satisfy +``import`` statements as required for Microsoft's Visual Studio toolchains. + .. _`D1483r1`: https://mathstuf.fedorapeople.org/fortran-modules/fortran-modules.html .. _`P1689r5`: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html .. _`cxx-modules-sandbox`: https://github.com/mathstuf/cxx-modules-sandbox diff --git a/Help/release/3.25.rst b/Help/release/3.25.rst index 7d0cf0a44..fdf8a9465 100644 --- a/Help/release/3.25.rst +++ b/Help/release/3.25.rst @@ -223,11 +223,6 @@ Deprecated and Removed Features Other Changes ============= -* On Windows, when targeting the MSVC ABI, the :command:`find_library` command - now accepts ``.a`` file names after first considering ``.lib``. This is - symmetric with existing behavior when targeting the GNU ABI, in which the - command accepts ``.lib`` file names after first considering ``.a``. - * The :envvar:`SSL_CERT_FILE` and :envvar:`SSL_CERT_DIR` environment variables can now be used to override where to find certificate authorities for TLS/SSL operations. @@ -238,3 +233,16 @@ Other Changes * The :generator:`Xcode` generator no longer adds the per-config suffix ``$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)`` to library search paths. See policy :policy:`CMP0142`. + +Updates +======= + +Changes made since CMake 3.25.0 include the following. + +3.25.1 +------ + +* On Windows, when targeting the MSVC ABI, the :command:`find_library` + command no longer accepts ``.a`` file names. This behavior was added + in CMake 3.25.0, but has been reverted due finding GNU-ABI libraries + in cases we did not previously. diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake index f8d55a5c0..d22741bb7 100644 --- a/Modules/CMakeDetermineRCCompiler.cmake +++ b/Modules/CMakeDetermineRCCompiler.cmake @@ -30,16 +30,19 @@ if(NOT CMAKE_RC_COMPILER) # finally list compilers to try if(CMAKE_RC_COMPILER_INIT) - set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT}) - else() - set(CMAKE_RC_COMPILER_LIST rc) + set(_CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT}) + set(_CMAKE_RC_COMPILER_FALLBACK ${CMAKE_RC_COMPILER_INIT}) + elseif(NOT _CMAKE_RC_COMPILER_LIST) + set(_CMAKE_RC_COMPILER_LIST rc) endif() # Find the compiler. - find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler") - if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER) - set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE) + find_program(CMAKE_RC_COMPILER NAMES ${_CMAKE_RC_COMPILER_LIST} DOC "RC compiler") + if(_CMAKE_RC_COMPILER_FALLBACK AND NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER "${_CMAKE_RC_COMPILER_FALLBACK}" CACHE FILEPATH "RC compiler" FORCE) endif() + unset(_CMAKE_RC_COMPILER_FALLBACK) + unset(_CMAKE_RC_COMPILER_LIST) endif() mark_as_advanced(CMAKE_RC_COMPILER) diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake index 8e8285987..8fc6921ca 100644 --- a/Modules/CheckIncludeFiles.cmake +++ b/Modules/CheckIncludeFiles.cmake @@ -70,10 +70,11 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) message(FATAL_ERROR "Unknown arguments:\n ${ARGN}\n") endif() + string(MAKE_C_IDENTIFIER ${VARIABLE} _variable_escaped) if(_lang STREQUAL "C") - set(src ${VARIABLE}.c) + set(src ${_variable_escaped}.c) elseif(_lang STREQUAL "CXX") - set(src ${VARIABLE}.cpp) + set(src ${_variable_escaped}.cpp) else() message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n") endif() diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index b14ab0692..e09b7c848 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -103,10 +103,11 @@ function(__check_type_size_impl type var map builtin language) endif() # Perform language check + string(MAKE_C_IDENTIFIER ${var} _var_escaped) if(language STREQUAL "C") - set(src ${var}.c) + set(src ${_var_escaped}.c) elseif(language STREQUAL "CXX") - set(src ${var}.cpp) + set(src ${_var_escaped}.cpp) else() message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n") endif() diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 212f6d195..10a9073ac 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -79,7 +79,6 @@ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) endif() if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.34") - set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1) string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE " -nologo -TP" " -showIncludes" diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 470111fa6..c9281574b 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1150,8 +1150,10 @@ if(NOT CUDA_VERSION VERSION_LESS "9.0") find_cuda_helper_libs(nppc) find_cuda_helper_libs(nppial) find_cuda_helper_libs(nppicc) + set(CUDA_npp_LIBRARY ${CUDA_nppc_LIBRARY} ${CUDA_nppial_LIBRARY} ${CUDA_nppicc_LIBRARY}) if(CUDA_VERSION VERSION_LESS "11.0") find_cuda_helper_libs(nppicom) + list(APPEND CUDA_npp_LIBRARY ${CUDA_nppicom_LIBRARY}) endif() find_cuda_helper_libs(nppidei) find_cuda_helper_libs(nppif) @@ -1161,7 +1163,7 @@ if(NOT CUDA_VERSION VERSION_LESS "9.0") find_cuda_helper_libs(nppisu) find_cuda_helper_libs(nppitc) find_cuda_helper_libs(npps) - set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") + list(APPEND CUDA_npp_LIBRARY ${CUDA_nppidei_LIBRARY} ${CUDA_nppif_LIBRARY} ${CUDA_nppig_LIBRARY} ${CUDA_nppim_LIBRARY} ${CUDA_nppist_LIBRARY} ${CUDA_nppisu_LIBRARY} ${CUDA_nppitc_LIBRARY} ${CUDA_npps_LIBRARY}) elseif(CUDA_VERSION VERSION_GREATER "5.0") # In CUDA 5.5 NPP was split into 3 separate libraries. find_cuda_helper_libs(nppc) diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 94c86e9f1..f06f0e885 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -1060,7 +1060,9 @@ if(CUDAToolkit_FOUND) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.1.0) if(NOT TARGET CUDA::nvptxcompiler_static) _CUDAToolkit_find_and_add_import_lib(nvptxcompiler_static DEPS cuda_driver) - target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads) + if(TARGET CUDA::nvptxcompiler_static) + target_link_libraries(CUDA::nvptxcompiler_static INTERFACE Threads::Threads) + endif() endif() endif() diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index b14349ffc..d82f41daa 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -71,9 +71,6 @@ Hints .. versionadded:: 3.18 -``Ruby_ROOT_DIR`` - Define the root directory of a Ruby installation. - ``Ruby_FIND_VIRTUALENV`` This variable defines the handling of virtual environments managed by ``rvm``. It is meaningful only when a virtual environment diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake index 09a12ccb5..d0f686cb0 100644 --- a/Modules/Platform/Android.cmake +++ b/Modules/Platform/Android.cmake @@ -5,6 +5,7 @@ if(CMAKE_ANDROID_NDK) endif() include(Platform/Linux) +unset(LINUX) set(ANDROID 1) diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index bf96e637b..088b238b8 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -157,7 +157,8 @@ macro(__windows_compiler_gnu lang) endif() if(NOT CMAKE_RC_COMPILER_INIT AND NOT CMAKE_GENERATOR_RC) - set(CMAKE_RC_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}windres windres) + set(_CMAKE_RC_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}windres windres) + set(_CMAKE_RC_COMPILER_FALLBACK windres) endif() enable_language(RC) diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake index 526316115..d8b395781 100644 --- a/Modules/Platform/Windows.cmake +++ b/Modules/Platform/Windows.cmake @@ -19,8 +19,8 @@ set(CMAKE_LINK_LIBRARY_SUFFIX ".lib") set(CMAKE_DL_LIBS "") set(CMAKE_EXTRA_LINK_EXTENSIONS ".targets") -set(CMAKE_FIND_LIBRARY_PREFIXES "" "lib") -set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a") +set(CMAKE_FIND_LIBRARY_PREFIXES "") +set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib") # for borland make long command lines are redirected to a file # with the following syntax, see Windows-bcc32.cmake for use diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e4575f40c..c399308b8 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 25) -set(CMake_VERSION_PATCH 0) +set(CMake_VERSION_PATCH 1) #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 [==[13e46189c7 CMake 3.25.0]==]) + set(git_info [==[5676593be9 CMake 3.25.1]==]) # 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/LexerParser/cmFortranParser.cxx b/Source/LexerParser/cmFortranParser.cxx index 5e5cc0be6..f25856abe 100644 --- a/Source/LexerParser/cmFortranParser.cxx +++ b/Source/LexerParser/cmFortranParser.cxx @@ -548,16 +548,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 432 +#define YYLAST 433 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 41 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 14 /* YYNRULES -- Number of rules. */ -#define YYNRULES 64 +#define YYNRULES 65 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 121 +#define YYNSTATES 123 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 295 @@ -608,15 +608,15 @@ static const yytype_int8 yytranslate[] = #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = +static const yytype_int16 yyrline[] = { 0, 106, 106, 106, 109, 113, 118, 123, 129, 136, - 141, 145, 150, 162, 167, 172, 177, 182, 187, 192, - 197, 202, 206, 210, 214, 218, 219, 224, 224, 224, - 225, 225, 226, 226, 227, 227, 228, 228, 229, 229, - 230, 230, 231, 231, 232, 232, 233, 233, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252 + 141, 146, 150, 155, 167, 172, 177, 182, 187, 192, + 197, 202, 207, 211, 215, 219, 223, 224, 229, 229, + 229, 230, 230, 231, 231, 232, 232, 233, 233, 234, + 234, 235, 235, 236, 236, 237, 237, 238, 238, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257 }; #endif @@ -670,15 +670,15 @@ static const yytype_int16 yypact[] = -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -25, -19, 20, -8, -15, -22, -39, -6, 14, 15, 16, 17, -39, -39, - -39, -39, -39, -39, 59, 49, 51, -39, 63, 64, - 35, 36, 37, -39, -39, -39, -39, -39, -39, 74, - 112, 127, 165, 180, -39, -39, -39, -39, -39, -39, + -39, -39, -39, -39, 59, 51, 48, -39, 63, 64, + 35, 36, 37, -39, -39, -39, -39, -39, -39, 75, + 113, 128, 166, 181, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -20, 43, -39, - 218, 233, 271, 286, 324, 339, -39, -39, -39, -39, - -39, 39, 40, 41, 377, -39, -39, -39, -39, -39, - -39, 46, 78, -39, -39, 50, -39, 392, 79, -39, - -39 + -39, -39, -39, -39, 68, -39, -39, -39, -20, 44, + -39, 219, 234, 272, 287, 325, 340, -39, -39, -39, + -39, -39, -39, 40, 41, 42, 378, -39, -39, -39, + -39, -39, -39, 46, 79, -39, -39, 50, -39, 393, + 90, -39, -39 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -686,19 +686,19 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int8 yydefact[] = { - 2, 0, 1, 0, 25, 0, 27, 28, 29, 31, - 30, 33, 32, 34, 36, 38, 42, 40, 44, 35, - 37, 39, 43, 41, 45, 46, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 0, 0, 46, 46, - 46, 46, 26, 46, 0, 0, 0, 4, 0, 0, - 0, 0, 0, 46, 46, 46, 46, 46, 46, 0, - 0, 0, 0, 0, 15, 57, 56, 64, 62, 58, - 59, 60, 61, 63, 55, 48, 49, 50, 51, 52, - 53, 54, 47, 10, 13, 9, 6, 0, 0, 46, - 0, 0, 0, 0, 0, 0, 21, 22, 23, 24, - 14, 0, 0, 0, 0, 5, 16, 17, 18, 19, - 20, 0, 0, 46, 11, 0, 7, 0, 0, 12, - 8 + 2, 0, 1, 0, 26, 0, 28, 29, 30, 32, + 31, 34, 33, 35, 37, 39, 43, 41, 45, 36, + 38, 40, 44, 42, 46, 47, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, 0, 0, 47, 47, + 47, 47, 27, 47, 0, 0, 0, 4, 0, 0, + 0, 0, 0, 47, 47, 47, 47, 47, 47, 0, + 0, 0, 0, 0, 16, 58, 57, 65, 63, 59, + 60, 61, 62, 64, 56, 49, 50, 51, 52, 53, + 54, 55, 48, 11, 0, 14, 9, 6, 0, 0, + 47, 0, 0, 0, 0, 0, 0, 22, 23, 24, + 25, 15, 10, 0, 0, 0, 0, 5, 17, 18, + 19, 20, 21, 0, 0, 47, 12, 0, 7, 0, + 0, 13, 8 }; /* YYPGOTO[NTERM-NUM]. */ @@ -720,50 +720,50 @@ static const yytype_int8 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int8 yytable[] = { - 59, 60, 61, 62, 51, 63, 52, 101, 42, 43, - 102, 53, 45, 46, 50, 90, 91, 92, 93, 94, - 95, 2, 3, 47, 4, 49, 54, 5, 6, 7, + 59, 60, 61, 62, 51, 63, 52, 103, 42, 43, + 104, 53, 45, 46, 50, 91, 92, 93, 94, 95, + 96, 2, 3, 47, 4, 49, 54, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 55, 56, 57, - 58, 104, 83, 48, 84, 25, 26, 27, 28, 29, - 30, 31, 64, 65, 66, 67, 85, 86, 87, 88, - 89, 103, 111, 112, 113, 117, 115, 96, 65, 66, - 67, 116, 120, 118, 0, 68, 69, 70, 71, 72, + 58, 85, 106, 48, 83, 25, 26, 27, 28, 29, + 30, 31, 64, 65, 66, 67, 86, 87, 88, 89, + 90, 102, 105, 113, 114, 115, 117, 119, 97, 65, + 66, 67, 118, 120, 84, 68, 69, 70, 71, 72, + 73, 74, 75, 122, 76, 77, 78, 79, 80, 81, + 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, + 76, 77, 78, 79, 80, 81, 98, 65, 66, 67, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 99, 65, 66, 67, 0, 0, 0, 0, 68, + 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, + 78, 79, 80, 81, 68, 69, 70, 71, 72, 73, + 74, 75, 0, 76, 77, 78, 79, 80, 81, 100, + 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 101, 65, 66, 67, 0, 0, + 0, 0, 68, 69, 70, 71, 72, 73, 74, 75, + 0, 76, 77, 78, 79, 80, 81, 68, 69, 70, + 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, + 80, 81, 107, 65, 66, 67, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 108, 65, 66, + 67, 0, 0, 0, 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, 80, 81, 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, - 77, 78, 79, 80, 81, 97, 65, 66, 67, 0, + 77, 78, 79, 80, 81, 109, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 98, 65, 66, 67, 0, 0, 0, 0, 68, 69, + 110, 65, 66, 67, 0, 0, 0, 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, 80, 81, 68, 69, 70, 71, 72, 73, 74, - 75, 0, 76, 77, 78, 79, 80, 81, 99, 65, + 75, 0, 76, 77, 78, 79, 80, 81, 111, 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 100, 65, 66, 67, 0, 0, 0, + 0, 0, 0, 112, 65, 66, 67, 0, 0, 0, 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, 80, 81, 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, 80, - 81, 105, 65, 66, 67, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 106, 65, 66, 67, + 81, 116, 65, 66, 67, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 121, 65, 66, 67, 0, 0, 0, 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, 80, 81, 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, - 78, 79, 80, 81, 107, 65, 66, 67, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, - 65, 66, 67, 0, 0, 0, 0, 68, 69, 70, - 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, - 80, 81, 68, 69, 70, 71, 72, 73, 74, 75, - 0, 76, 77, 78, 79, 80, 81, 109, 65, 66, - 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 110, 65, 66, 67, 0, 0, 0, 0, - 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, - 77, 78, 79, 80, 81, 68, 69, 70, 71, 72, - 73, 74, 75, 0, 76, 77, 78, 79, 80, 81, - 114, 65, 66, 67, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 119, 65, 66, 67, 0, - 0, 0, 0, 68, 69, 70, 71, 72, 73, 74, - 75, 0, 76, 77, 78, 79, 80, 81, 68, 69, - 70, 71, 72, 73, 74, 75, 0, 76, 77, 78, - 79, 80, 81 + 78, 79, 80, 81 }; static const yytype_int8 yycheck[] = @@ -773,10 +773,26 @@ static const yytype_int8 yycheck[] = 58, 0, 1, 3, 3, 33, 32, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 33, 33, 33, - 33, 89, 3, 33, 3, 34, 35, 36, 37, 38, + 33, 3, 90, 33, 3, 34, 35, 36, 37, 38, 39, 40, 3, 4, 5, 6, 3, 3, 33, 33, - 33, 28, 33, 33, 33, 113, 30, 3, 4, 5, - 6, 3, 3, 33, -1, 26, 27, 28, 29, 30, + 33, 3, 28, 33, 33, 33, 30, 115, 3, 4, + 5, 6, 3, 33, 33, 26, 27, 28, 29, 30, + 31, 32, 33, 3, 35, 36, 37, 38, 39, 40, + -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, + 35, 36, 37, 38, 39, 40, 3, 4, 5, 6, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 3, 4, 5, 6, -1, -1, -1, -1, 26, + 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, + 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, + 32, 33, -1, 35, 36, 37, 38, 39, 40, 3, + 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 3, 4, 5, 6, -1, -1, + -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, + -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, + 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, + 39, 40, 3, 4, 5, 6, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, + 6, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 3, 4, 5, 6, -1, @@ -795,23 +811,7 @@ static const yytype_int8 yycheck[] = -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, - 37, 38, 39, 40, 3, 4, 5, 6, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, - 4, 5, 6, -1, -1, -1, -1, 26, 27, 28, - 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, - 39, 40, 26, 27, 28, 29, 30, 31, 32, 33, - -1, 35, 36, 37, 38, 39, 40, 3, 4, 5, - 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 3, 4, 5, 6, -1, -1, -1, -1, - 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, - 36, 37, 38, 39, 40, 26, 27, 28, 29, 30, - 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, - 3, 4, 5, 6, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 3, 4, 5, 6, -1, - -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, - 33, -1, 35, 36, 37, 38, 39, 40, 26, 27, - 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, - 38, 39, 40 + 37, 38, 39, 40 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -826,11 +826,11 @@ static const yytype_int8 yystos[] = 29, 26, 28, 33, 32, 33, 33, 33, 33, 53, 53, 53, 53, 53, 3, 4, 5, 6, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, - 39, 40, 54, 3, 3, 3, 3, 33, 33, 33, - 53, 53, 53, 53, 53, 53, 3, 3, 3, 3, - 3, 27, 30, 28, 53, 3, 3, 3, 3, 3, - 3, 33, 33, 33, 3, 30, 3, 53, 33, 3, - 3 + 39, 40, 54, 3, 33, 3, 3, 3, 33, 33, + 33, 53, 53, 53, 53, 53, 53, 3, 3, 3, + 3, 3, 3, 27, 30, 28, 53, 3, 3, 3, + 3, 3, 3, 33, 33, 33, 3, 30, 3, 53, + 33, 3, 3 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -838,23 +838,23 @@ static const yytype_int8 yyr1[] = { 0, 41, 42, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 44, 44, 44, - 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, - 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, + 43, 43, 43, 43, 43, 43, 43, 43, 44, 44, + 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, + 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54 + 54, 54, 54, 54, 54, 54 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 2, 2, 4, 3, 6, 8, 3, - 3, 5, 7, 3, 4, 3, 4, 4, 4, 4, - 4, 3, 3, 3, 3, 1, 2, 1, 1, 1, + 4, 3, 5, 7, 3, 4, 3, 4, 4, 4, + 4, 4, 3, 3, 3, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1 }; @@ -1679,27 +1679,37 @@ yyreduce: #line 1680 "cmFortranParser.cxx" break; - case 10: /* stmt: END INTERFACE EOSTMT */ + case 10: /* stmt: END INTERFACE WORD EOSTMT */ #line 141 "cmFortranParser.y" + { + cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); + cmFortranParser_SetInInterface(parser, false); + free((yyvsp[-1].string)); + } +#line 1690 "cmFortranParser.cxx" + break; + + case 11: /* stmt: END INTERFACE EOSTMT */ +#line 146 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, false); } -#line 1689 "cmFortranParser.cxx" +#line 1699 "cmFortranParser.cxx" break; - case 11: /* stmt: USE DCOLON WORD other EOSTMT */ -#line 145 "cmFortranParser.y" + case 12: /* stmt: USE DCOLON WORD other EOSTMT */ +#line 150 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1699 "cmFortranParser.cxx" +#line 1709 "cmFortranParser.cxx" break; - case 12: /* stmt: USE COMMA WORD DCOLON WORD other EOSTMT */ -#line 150 "cmFortranParser.y" + case 13: /* stmt: USE COMMA WORD DCOLON WORD other EOSTMT */ +#line 155 "cmFortranParser.y" { if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); @@ -1712,139 +1722,139 @@ yyreduce: free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1716 "cmFortranParser.cxx" +#line 1726 "cmFortranParser.cxx" break; - case 13: /* stmt: INCLUDE STRING EOSTMT */ -#line 162 "cmFortranParser.y" + case 14: /* stmt: INCLUDE STRING EOSTMT */ +#line 167 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-1].string)); free((yyvsp[-1].string)); } -#line 1726 "cmFortranParser.cxx" +#line 1736 "cmFortranParser.cxx" break; - case 14: /* stmt: CPP_LINE_DIRECTIVE STRING other EOSTMT */ -#line 167 "cmFortranParser.y" + case 15: /* stmt: CPP_LINE_DIRECTIVE STRING other EOSTMT */ +#line 172 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1736 "cmFortranParser.cxx" +#line 1746 "cmFortranParser.cxx" break; - case 15: /* stmt: CPP_INCLUDE_ANGLE other EOSTMT */ -#line 172 "cmFortranParser.y" + case 16: /* stmt: CPP_INCLUDE_ANGLE other EOSTMT */ +#line 177 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1746 "cmFortranParser.cxx" +#line 1756 "cmFortranParser.cxx" break; - case 16: /* stmt: include STRING other EOSTMT */ -#line 177 "cmFortranParser.y" + case 17: /* stmt: include STRING other EOSTMT */ +#line 182 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1756 "cmFortranParser.cxx" +#line 1766 "cmFortranParser.cxx" break; - case 17: /* stmt: define WORD other EOSTMT */ -#line 182 "cmFortranParser.y" + case 18: /* stmt: define WORD other EOSTMT */ +#line 187 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleDefine(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1766 "cmFortranParser.cxx" +#line 1776 "cmFortranParser.cxx" break; - case 18: /* stmt: undef WORD other EOSTMT */ -#line 187 "cmFortranParser.y" + case 19: /* stmt: undef WORD other EOSTMT */ +#line 192 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUndef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1776 "cmFortranParser.cxx" +#line 1786 "cmFortranParser.cxx" break; - case 19: /* stmt: ifdef WORD other EOSTMT */ -#line 192 "cmFortranParser.y" + case 20: /* stmt: ifdef WORD other EOSTMT */ +#line 197 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1786 "cmFortranParser.cxx" +#line 1796 "cmFortranParser.cxx" break; - case 20: /* stmt: ifndef WORD other EOSTMT */ -#line 197 "cmFortranParser.y" + case 21: /* stmt: ifndef WORD other EOSTMT */ +#line 202 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1796 "cmFortranParser.cxx" +#line 1806 "cmFortranParser.cxx" break; - case 21: /* stmt: if other EOSTMT */ -#line 202 "cmFortranParser.y" + case 22: /* stmt: if other EOSTMT */ +#line 207 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIf(parser); } -#line 1805 "cmFortranParser.cxx" +#line 1815 "cmFortranParser.cxx" break; - case 22: /* stmt: elif other EOSTMT */ -#line 206 "cmFortranParser.y" + case 23: /* stmt: elif other EOSTMT */ +#line 211 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleElif(parser); } -#line 1814 "cmFortranParser.cxx" +#line 1824 "cmFortranParser.cxx" break; - case 23: /* stmt: else other EOSTMT */ -#line 210 "cmFortranParser.y" + case 24: /* stmt: else other EOSTMT */ +#line 215 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleElse(parser); } -#line 1823 "cmFortranParser.cxx" +#line 1833 "cmFortranParser.cxx" break; - case 24: /* stmt: endif other EOSTMT */ -#line 214 "cmFortranParser.y" + case 25: /* stmt: endif other EOSTMT */ +#line 219 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleEndif(parser); } -#line 1832 "cmFortranParser.cxx" +#line 1842 "cmFortranParser.cxx" break; - case 48: /* misc_code: WORD */ -#line 236 "cmFortranParser.y" + case 49: /* misc_code: WORD */ +#line 241 "cmFortranParser.y" { free ((yyvsp[0].string)); } -#line 1838 "cmFortranParser.cxx" +#line 1848 "cmFortranParser.cxx" break; - case 55: /* misc_code: STRING */ -#line 243 "cmFortranParser.y" + case 56: /* misc_code: STRING */ +#line 248 "cmFortranParser.y" { free ((yyvsp[0].string)); } -#line 1844 "cmFortranParser.cxx" +#line 1854 "cmFortranParser.cxx" break; -#line 1848 "cmFortranParser.cxx" +#line 1858 "cmFortranParser.cxx" default: break; } @@ -2068,6 +2078,6 @@ yyreturnlab: return yyresult; } -#line 255 "cmFortranParser.y" +#line 260 "cmFortranParser.y" /* End of grammar */ diff --git a/Source/LexerParser/cmFortranParser.y b/Source/LexerParser/cmFortranParser.y index a5c897648..0b2706048 100644 --- a/Source/LexerParser/cmFortranParser.y +++ b/Source/LexerParser/cmFortranParser.y @@ -138,6 +138,11 @@ stmt: cmFortranParser_SetInInterface(parser, true); free($2); } +| END INTERFACE WORD EOSTMT { + cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); + cmFortranParser_SetInInterface(parser, false); + free($3); + } | END INTERFACE EOSTMT { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, false); diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 867f984fd..b44111d6d 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -206,6 +206,8 @@ auto const TryRunSourcesArgParser = auto const TryRunOldArgParser = makeTryRunParser(TryCompileOldArgParser); #undef BIND_LANG_PROPS + +std::string const TryCompileDefaultConfig = "DEBUG"; } Arguments cmCoreTryCompile::ParseArgs( @@ -706,9 +708,9 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments, CM_FALLTHROUGH; case cmPolicies::NEW: { // NEW behavior is to pass config-specific compiler flags. - static std::string const cfgDefault = "DEBUG"; - std::string const cfg = - !tcConfig.empty() ? cmSystemTools::UpperCase(tcConfig) : cfgDefault; + std::string const cfg = !tcConfig.empty() + ? cmSystemTools::UpperCase(tcConfig) + : TryCompileDefaultConfig; for (std::string const& li : testLangs) { std::string const langFlagsCfg = cmStrCat("CMAKE_", li, "_FLAGS_", cfg); @@ -1199,7 +1201,12 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName) tmpOutputFile += targetName; if (this->Makefile->GetGlobalGenerator()->IsMultiConfig()) { - tmpOutputFile += "_DEBUG"; + std::string const tcConfig = + this->Makefile->GetSafeDefinition("CMAKE_TRY_COMPILE_CONFIGURATION"); + std::string const cfg = !tcConfig.empty() + ? cmSystemTools::UpperCase(tcConfig) + : TryCompileDefaultConfig; + tmpOutputFile = cmStrCat(tmpOutputFile, '_', cfg); } tmpOutputFile += "_loc"; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 065802166..116e510c6 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3581,28 +3581,37 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) libItem.IsPath == cmComputeLinkInformation::ItemIsPath::Yes && forceLinkPhase))) { std::string libName; - bool canUseLinkPhase = true; - if (libItem.Target) { - if (libItem.Target->GetType() == cmStateEnums::UNKNOWN_LIBRARY) { - canUseLinkPhase = canUseLinkPhase && forceLinkPhase; + bool canUseLinkPhase = !libItem.HasFeature() || + libItem.GetFeatureName() == "__CMAKE_LINK_FRAMEWORK"_s || + libItem.GetFeatureName() == "FRAMEWORK"_s || + libItem.GetFeatureName() == "WEAK_FRAMEWORK"_s || + libItem.GetFeatureName() == "WEAK_LIBRARY"_s; + if (canUseLinkPhase) { + if (libItem.Target) { + if (libItem.Target->GetType() == cmStateEnums::UNKNOWN_LIBRARY) { + canUseLinkPhase = canUseLinkPhase && forceLinkPhase; + } else { + // If a library target uses custom build output directory Xcode + // won't pick it up so we have to resort back to linker flags, + // but that's OK as long as the custom output dir is absolute + // path. + for (auto const& libConfigName : + this->CurrentConfigurationTypes) { + canUseLinkPhase = canUseLinkPhase && + libItem.Target->UsesDefaultOutputDir( + libConfigName, cmStateEnums::RuntimeBinaryArtifact); + } + } + libName = libItem.Target->GetName(); } else { - // If a library target uses custom build output directory Xcode - // won't pick it up so we have to resort back to linker flags, but - // that's OK as long as the custom output dir is absolute path. - for (auto const& libConfigName : this->CurrentConfigurationTypes) { - canUseLinkPhase = canUseLinkPhase && - libItem.Target->UsesDefaultOutputDir( - libConfigName, cmStateEnums::RuntimeBinaryArtifact); + libName = cmSystemTools::GetFilenameName(libItem.Value.Value); + // We don't want all the possible files here, just standard + // libraries + const auto libExt = cmSystemTools::GetFilenameExtension(libName); + if (!IsLinkPhaseLibraryExtension(libExt)) { + canUseLinkPhase = false; } } - libName = libItem.Target->GetName(); - } else { - libName = cmSystemTools::GetFilenameName(libItem.Value.Value); - // We don't want all the possible files here, just standard libraries - const auto libExt = cmSystemTools::GetFilenameExtension(libName); - if (!IsLinkPhaseLibraryExtension(libExt)) { - canUseLinkPhase = false; - } } if (canUseLinkPhase) { // Add unique configuration name to target-config map for later @@ -3658,6 +3667,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) // separately. std::vector linkSearchPaths; std::vector frameworkSearchPaths; + std::set> linkBuildFileSet; for (auto const& libItem : linkPhaseTargetVector) { // Add target output directory as a library search path std::string linkDir; @@ -3760,8 +3770,30 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) cmSystemTools::Error("Missing files of PBXFrameworksBuildPhase"); continue; } - if (buildFile && !buildFiles->HasObject(buildFile)) { - buildFiles->AddObject(buildFile); + if (buildFile) { + if (cmHasPrefix(libItem->GetFeatureName(), "WEAK_"_s)) { + auto key = std::make_pair(buildFile->GetAttribute("fileRef"), + libItem->GetFeatureName()); + if (linkBuildFileSet.find(key) != linkBuildFileSet.end()) { + continue; + } + linkBuildFileSet.insert(key); + + cmXCodeObject* buildObject = + this->CreateObject(cmXCodeObject::PBXBuildFile); + buildObject->AddAttribute("fileRef", key.first); + // Add settings, ATTRIBUTES, Weak flag + cmXCodeObject* settings = + this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); + cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST); + attrs->AddObject(this->CreateString("Weak")); + settings->AddAttribute("ATTRIBUTES", attrs); + buildObject->AddAttribute("settings", settings); + buildFile = buildObject; + } + if (!buildFiles->HasObject(buildFile)) { + buildFiles->AddObject(buildFile); + } } } diff --git a/Tests/FindBoost/TestPython/CMakeLists.txt b/Tests/FindBoost/TestPython/CMakeLists.txt index 8ef18e985..494c9a3c6 100644 --- a/Tests/FindBoost/TestPython/CMakeLists.txt +++ b/Tests/FindBoost/TestPython/CMakeLists.txt @@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.14) project(TestFindBoostPython CXX) include(CTest) -find_package(Boost OPTIONAL_COMPONENTS python27 python34 python35 python36 python37 python38 python39 python310) +find_package(Boost OPTIONAL_COMPONENTS python27 python34 python35 python36 python37 python38 python39 python310 python311 python312) set(FAILTEST TRUE) -foreach (v IN ITEMS 27 34 35 36 37 38 39 310) +foreach (v IN ITEMS 27 34 35 36 37 38 39 310 311 312) if (Boost_PYTHON${v}_FOUND) set(FAILTEST FALSE) break() diff --git a/Tests/FortranModules/CMakeLists.txt b/Tests/FortranModules/CMakeLists.txt index 94f593908..5c76132ba 100644 --- a/Tests/FortranModules/CMakeLists.txt +++ b/Tests/FortranModules/CMakeLists.txt @@ -42,6 +42,16 @@ add_executable(test_module test_module_implementation.f90 test_module_interface.f90) +add_executable(test_multi_module + # Place this first so that we do not get "lucky" and find the module provided + # by compiling `test_multi_module.f90` first. + test_multi_module_main.f90 + test_multi_module.f90) +set_property(TARGET test_multi_module PROPERTY + JOB_POOL_COMPILE multi_module_serial) +set_property(GLOBAL APPEND PROPERTY + JOB_POOLS multi_module_serial=1) + add_executable(test_use_in_comment_fixedform test_use_in_comment_fixedform.f) set_property(SOURCE test_use_in_comment_fixedform.f PROPERTY Fortran_FORMAT FIXED) diff --git a/Tests/FortranModules/test_multi_module.f90 b/Tests/FortranModules/test_multi_module.f90 new file mode 100644 index 000000000..5b28f748c --- /dev/null +++ b/Tests/FortranModules/test_multi_module.f90 @@ -0,0 +1,8 @@ +module first + interface inner + end interface inner +end module first + +module second + REAL :: C = 1 +end module second diff --git a/Tests/FortranModules/test_multi_module_main.f90 b/Tests/FortranModules/test_multi_module_main.f90 new file mode 100644 index 000000000..afd6dffb6 --- /dev/null +++ b/Tests/FortranModules/test_multi_module_main.f90 @@ -0,0 +1,4 @@ +PROGRAM MAINF90 + use second + PRINT *,'Constant is',C +END PROGRAM MAINF90 diff --git a/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase.cmake b/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase.cmake index 7abc58bf4..a9ea717df 100644 --- a/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase.cmake +++ b/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase.cmake @@ -65,8 +65,12 @@ add_custom_target(prebuildDependencies ALL COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/ExternalFrameworks/build --target staticFrameworkExt sharedFrameworkExt --config Debug ) add_executable(app1 mainOuter.m) +add_executable(app2 mainOuter.m) +add_executable(app3 mainOuter.m) add_library(static1 STATIC funcOuter.c) add_library(shared1 SHARED funcOuter.c) +add_library(shared3 SHARED funcOuter.c) +add_library(shared4 SHARED funcOuter.c) add_library(module1 MODULE funcOuter.c) add_library(obj1 OBJECT funcOuter.c) add_library(staticFramework1 STATIC funcOuter.c) @@ -74,8 +78,12 @@ add_library(sharedFramework1 SHARED funcOuter.c) set_target_properties(staticFramework1 PROPERTIES FRAMEWORK TRUE) set_target_properties(sharedFramework1 PROPERTIES FRAMEWORK TRUE) add_dependencies(app1 prebuildDependencies) +add_dependencies(app2 prebuildDependencies) +add_dependencies(app3 prebuildDependencies) add_dependencies(static1 prebuildDependencies) add_dependencies(shared1 prebuildDependencies) +add_dependencies(shared3 prebuildDependencies) +add_dependencies(shared4 prebuildDependencies) add_dependencies(module1 prebuildDependencies) add_dependencies(obj1 prebuildDependencies) add_dependencies(staticFramework1 prebuildDependencies) @@ -103,6 +111,14 @@ set(libresolv \"${libresolv}\") set(CoreFoundation \"${CoreFoundation}\") ") +macro(SET_LINK_LIBRARIES) + foreach(mainTarget IN LISTS mainTargets) + foreach(linkTo IN LISTS linkToThings) + target_link_libraries(${mainTarget} PRIVATE ${linkTo}) + endforeach() + endforeach() +endmacro() + set(mainTargets app1 static1 @@ -125,8 +141,44 @@ set(linkToThings "${CMAKE_CURRENT_BINARY_DIR}/ExternalFrameworks/build/Debug/staticFrameworkExt.framework" ) -foreach(mainTarget IN LISTS mainTargets) - foreach(linkTo IN LISTS linkToThings) - target_link_libraries(${mainTarget} PRIVATE ${linkTo}) - endforeach() -endforeach() +set_link_libraries() + +set(mainTargets + app2 + shared3 +) + +set(linkToThings + static2 + "$" + obj2 + staticFramework2 + "$" + imported2 + ${libresolv} + ${CoreFoundation} + "$" + "${CMAKE_CURRENT_BINARY_DIR}/ExternalFrameworks/build/Debug/staticFrameworkExt.framework" +) + +set_link_libraries() + +set(mainTargets + app3 + shared4 +) + +set(linkToThings + static2 + "$" + obj2 + staticFramework2 + "$" + imported2 + ${libresolv} + ${CoreFoundation} + "$" + "${CMAKE_CURRENT_BINARY_DIR}/ExternalFrameworks/build/Debug/staticFrameworkExt.framework" +) + +set_link_libraries() diff --git a/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_BUILT_ONLY-check.cmake b/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_BUILT_ONLY-check.cmake index d07a25be0..75edc5c90 100644 --- a/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_BUILT_ONLY-check.cmake +++ b/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_BUILT_ONLY-check.cmake @@ -4,13 +4,20 @@ include(${RunCMake_TEST_BINARY_DIR}/foundLibs.cmake) # obj2 --> Embeds func3.o in the link flags, but obj2 is part of the path # ${libz} --> This is for imported2 -foreach(mainTarget IN ITEMS app1 shared1 module1 sharedFramework1) +foreach(mainTarget IN ITEMS app1 app2 shared1 shared3 module1 sharedFramework1) checkFlags(OTHER_LDFLAGS ${mainTarget} "obj2;${libz};${libresolv};CoreFoundation;sharedFrameworkExt;staticFrameworkExt" "static2;shared2;staticFramework2;sharedFramework2" ) endforeach() +foreach(mainTarget IN ITEMS app3 shared4) + checkFlags(OTHER_LDFLAGS ${mainTarget} + "obj2;${libz};${libresolv};CoreFoundation;sharedFrameworkExt;staticFrameworkExt;shared2;sharedFramework2" + "static2;staticFramework2" + ) +endforeach() + foreach(mainTarget IN ITEMS static1 staticFramework1) checkFlags(OTHER_LIBTOOLFLAGS ${mainTarget} "obj2" diff --git a/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_KNOWN_LOCATION-check.cmake b/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_KNOWN_LOCATION-check.cmake index e1484e790..1044f7889 100644 --- a/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_KNOWN_LOCATION-check.cmake +++ b/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_KNOWN_LOCATION-check.cmake @@ -4,13 +4,20 @@ include(${RunCMake_TEST_BINARY_DIR}/foundLibs.cmake) # obj2 --> Embeds func3.o in the link flags, but obj2 is part of the path # ${libz} --> This is for imported2 -foreach(mainTarget IN ITEMS app1 shared1 module1 sharedFramework1) +foreach(mainTarget IN ITEMS app1 app2 shared1 shared3 module1 sharedFramework1) checkFlags(OTHER_LDFLAGS ${mainTarget} "obj2" "static2;shared2;staticFramework2;sharedFramework2;${libz};${libresolv};CoreFoundation;sharedFrameworkExt;staticFrameworkExt" ) endforeach() +foreach(mainTarget IN ITEMS app3 shared4) + checkFlags(OTHER_LDFLAGS ${mainTarget} + "obj2;shared2;sharedFramework2;sharedFrameworkExt" + "static2;staticFramework2;${libz};${libresolv};CoreFoundation;staticFrameworkExt" + ) +endforeach() + foreach(mainTarget IN ITEMS static1 staticFramework1) checkFlags(OTHER_LIBTOOLFLAGS ${mainTarget} "obj2" diff --git a/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_NONE-check.cmake b/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_NONE-check.cmake index 260167607..b67632b20 100644 --- a/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_NONE-check.cmake +++ b/Tests/RunCMake/XcodeProject/LinkBinariesBuildPhase_NONE-check.cmake @@ -4,7 +4,7 @@ include(${RunCMake_TEST_BINARY_DIR}/foundLibs.cmake) # obj2 --> Embeds func3.o in the link flags, but obj2 is part of the path # ${libz} --> This is for imported2 -foreach(mainTarget IN ITEMS app1 shared1 module1 sharedFramework1) +foreach(mainTarget IN ITEMS app1 app2 app3 shared1 shared3 shared4 module1 sharedFramework1) checkFlags(OTHER_LDFLAGS ${mainTarget} "static2;shared2;staticFramework2;sharedFramework2;obj2;${libz};${libresolv};CoreFoundation;sharedFrameworkExt;staticFrameworkExt" "" diff --git a/Tests/RunCMake/try_compile/CopyFileConfig.cmake b/Tests/RunCMake/try_compile/CopyFileConfig.cmake new file mode 100644 index 000000000..22d20b7ff --- /dev/null +++ b/Tests/RunCMake/try_compile/CopyFileConfig.cmake @@ -0,0 +1,8 @@ +enable_language(C) +set(CMAKE_TRY_COMPILE_CONFIGURATION Release) + +include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS}) +try_compile(RESULT + ${try_compile_bindir_or_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/out.bin" + ) diff --git a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake index ac07ad32e..3158e327f 100644 --- a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake +++ b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake @@ -23,6 +23,7 @@ run_cmake(TryRunArgs) run_cmake(BuildType) run_cmake(BuildTypeAsFlag) run_cmake(OutputDirAsFlag) +run_cmake(CopyFileConfig) run_cmake(EnvConfig)