diff options
41 files changed, 284 insertions, 160 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a41406..305c8d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -824,7 +824,7 @@ b:macos-x86_64-ninja: - .macos_x86_64_tags - .run_manually variables: - CMAKE_CI_JOB_CONTINUOUS: "true" + CMAKE_CI_NO_MR: "true" b:macos-arm64-ninja: extends: @@ -834,7 +834,7 @@ b:macos-arm64-ninja: - .macos_arm64_tags - .run_manually variables: - CMAKE_CI_NO_MR: "true" + CMAKE_CI_JOB_CONTINUOUS: "true" t:macos-x86_64-ninja: extends: @@ -848,8 +848,7 @@ t:macos-x86_64-ninja: needs: - b:macos-x86_64-ninja variables: - CMAKE_CI_JOB_CONTINUOUS: "true" - CMAKE_CI_JOB_NIGHTLY_NINJA: "true" + CMAKE_CI_NO_MR: "true" t:macos-arm64-ninja: extends: @@ -863,7 +862,8 @@ t:macos-arm64-ninja: needs: - b:macos-arm64-ninja variables: - CMAKE_CI_NO_MR: "true" + CMAKE_CI_JOB_CONTINUOUS: "true" + CMAKE_CI_JOB_NIGHTLY_NINJA: "true" b:macos-x86_64-makefiles: extends: @@ -884,17 +884,17 @@ t:macos-x86_64-makefiles: needs: - b:macos-x86_64-makefiles -t:macos-x86_64-ninja-multi: +t:macos-arm64-ninja-multi: extends: - - .macos_x86_64_ninja_multi + - .macos_arm64_ninja_multi - .cmake_test_macos_external - - .macos_x86_64_tags_ext + - .macos_arm64_tags_ext - .cmake_junit_artifacts - .run_dependent dependencies: - - t:macos-x86_64-ninja + - t:macos-arm64-ninja needs: - - t:macos-x86_64-ninja + - t:macos-arm64-ninja variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -909,6 +909,8 @@ t:macos-x86_64-xcode: - t:macos-x86_64-ninja needs: - t:macos-x86_64-ninja + variables: + CMAKE_CI_NO_MR: "true" t:macos-arm64-xcode: extends: @@ -921,8 +923,6 @@ t:macos-arm64-xcode: - t:macos-arm64-ninja needs: - t:macos-arm64-ninja - variables: - CMAKE_CI_NO_MR: "true" t:macos-x86_64-ninja-ub: extends: @@ -938,17 +938,17 @@ t:macos-x86_64-ninja-ub: variables: CMAKE_CI_JOB_NIGHTLY: "true" -t:macos-x86_64-xcode-ub: +t:macos-arm64-xcode-ub: extends: - - .macos_x86_64_xcode_ub + - .macos_arm64_xcode_ub - .cmake_test_macos_external - - .macos_x86_64_tags_ext + - .macos_arm64_tags_ext - .cmake_junit_artifacts - .run_dependent dependencies: - - t:macos-x86_64-ninja + - t:macos-arm64-ninja needs: - - t:macos-x86_64-ninja + - t:macos-arm64-ninja variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -957,7 +957,7 @@ b:macos-package: - .macos_package - .cmake_build_macos - .cmake_release_artifacts - - .macos_x86_64_tags_package + - .macos_arm64_tags_package - .run_only_for_package dependencies: - p:doc-package @@ -980,7 +980,7 @@ b:macos10.10-package: - .macos10.10_package - .cmake_build_macos - .cmake_release_artifacts - - .macos_x86_64_tags_package + - .macos_arm64_tags_package - .run_only_for_package dependencies: - p:doc-package diff --git a/.gitlab/ci/configure_macos_x86_64_ninja_multi.cmake b/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake index b22285c..b22285c 100644 --- a/.gitlab/ci/configure_macos_x86_64_ninja_multi.cmake +++ b/.gitlab/ci/configure_macos_arm64_ninja_multi.cmake diff --git a/.gitlab/ci/configure_macos_x86_64_xcode_ub.cmake b/.gitlab/ci/configure_macos_arm64_xcode_ub.cmake index 1b976d2..1b976d2 100644 --- a/.gitlab/ci/configure_macos_x86_64_xcode_ub.cmake +++ b/.gitlab/ci/configure_macos_arm64_xcode_ub.cmake diff --git a/.gitlab/ci/env_macos_x86_64_ninja_multi.sh b/.gitlab/ci/env_macos_arm64_ninja_multi.sh index 217ff30..217ff30 100644 --- a/.gitlab/ci/env_macos_x86_64_ninja_multi.sh +++ b/.gitlab/ci/env_macos_arm64_ninja_multi.sh diff --git a/.gitlab/ci/env_macos_arm64_xcode_ub.cmake b/.gitlab/ci/env_macos_arm64_xcode_ub.cmake new file mode 100644 index 0000000..244f088 --- /dev/null +++ b/.gitlab/ci/env_macos_arm64_xcode_ub.cmake @@ -0,0 +1 @@ +set(ENV{CMAKE_OSX_ARCHITECTURES} "arm64;x86_64") diff --git a/.gitlab/ci/env_macos_x86_64_xcode_ub.cmake b/.gitlab/ci/env_macos_x86_64_xcode_ub.cmake deleted file mode 100644 index 4b5c401..0000000 --- a/.gitlab/ci/env_macos_x86_64_xcode_ub.cmake +++ /dev/null @@ -1 +0,0 @@ -set(ENV{CMAKE_OSX_ARCHITECTURES} "x86_64;arm64") diff --git a/.gitlab/ci/ispc.ps1 b/.gitlab/ci/ispc.ps1 index 13267c3..524896f 100755 --- a/.gitlab/ci/ispc.ps1 +++ b/.gitlab/ci/ispc.ps1 @@ -1,7 +1,7 @@ $erroractionpreference = "stop" -$version = "1.18.0" -$sha256sum = "9210BB2D9D3711367FACCB37ACF49966696132560B565471C1C6121F4924A17E" +$version = "1.20.0" +$sha256sum = "E212EBFB4E8AFB57ADC103A2579C52673A3CA49610FBC2A5EAE643D3D378548D" $filename = "ispc-v$version-windows" $tarball = "$filename.zip" diff --git a/.gitlab/ci/ispc.sh b/.gitlab/ci/ispc.sh index 2804277..59ee200 100755 --- a/.gitlab/ci/ispc.sh +++ b/.gitlab/ci/ispc.sh @@ -2,18 +2,23 @@ set -e -readonly version="1.18.0" +readonly version="1.20.0" case "$(uname -s)-$(uname -m)" in Linux-x86_64) shatool="sha256sum" - sha256sum="6c379bb97962e9de7d24fd48b3f7e647dc42be898e9d187948220268c646b692" + sha256sum="e6412b88aa312fcd10c46f92df0149ccc4d99e53552c4ce127aa6c634fe9b308" platform="linux" ;; + Darwin-arm64) + shatool="shasum -a 256" + sha256sum="62cee043a3a4dbff8c2f6d3885a7e573901bbc1325dd93d50f92904b7ea67fec" + platform="macOS.arm64" + ;; Darwin-x86_64) shatool="shasum -a 256" - sha256sum="d1435b541182406ff6b18446d31ecceef0eae3aed7654391ae676d3142e0000d" - platform="macOS" + sha256sum="da0f11a048a316081a8ad8170d48b170b2ed7efc3b140fc88b8611238809c8e4" + platform="macOS.x86_64" ;; *) echo "Unrecognized platform $(uname -s)-$(uname -m)" diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index 6f0bea5..1579338 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -80,19 +80,19 @@ CMAKE_GENERATOR: Xcode CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" -.macos_x86_64_xcode_ub: +.macos_arm64_xcode_ub: extends: .macos variables: - CMAKE_CONFIGURATION: macos_x86_64_xcode_ub + CMAKE_CONFIGURATION: macos_arm64_xcode_ub CMAKE_GENERATOR: Xcode CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" -.macos_x86_64_ninja_multi: +.macos_arm64_ninja_multi: extends: .macos variables: - CMAKE_CONFIGURATION: macos_x86_64_ninja_multi + CMAKE_CONFIGURATION: macos_arm64_ninja_multi CMAKE_GENERATOR: "Ninja Multi-Config" CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" @@ -113,15 +113,6 @@ - xcode-14.2 - nonconcurrent -.macos_x86_64_tags_package: - tags: - - cmake # Since this is a bare runner, pin to a project. - - macos-x86_64 - - shell - - xcode-14.2 - - nonconcurrent - - finder - .macos_x86_64_tags_ext: tags: - cmake # Since this is a bare runner, pin to a project. @@ -146,6 +137,15 @@ - xcode-14.2 - concurrent +.macos_arm64_tags_package: + tags: + - cmake # Since this is a bare runner, pin to a project. + - macos-arm64 + - shell + - xcode-14.2 + - nonconcurrent + - finder + ## macOS-specific scripts .before_script_macos: &before_script_macos diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index f5298df..8beebc5 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -162,7 +162,7 @@ if (NOT _CMAKE_TOOLCHAIN_PREFIX) if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|QCC|LCC") get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) - if (COMPILER_BASENAME MATCHES "^(.+-)?(clang|g?cc)(-cl)?(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$") + if (COMPILER_BASENAME MATCHES "^(.+-)?(clang|g?cc)(-cl)?(-?[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_SUFFIX ${CMAKE_MATCH_4}) set(_CMAKE_COMPILER_SUFFIX ${CMAKE_MATCH_6}) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 9e38566..40934ec 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -167,7 +167,7 @@ if (NOT _CMAKE_TOOLCHAIN_PREFIX) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|QCC|LCC") get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) - if (COMPILER_BASENAME MATCHES "^(.+-)?(clang\\+\\+|[gc]\\+\\+|clang-cl)(-[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$") + if (COMPILER_BASENAME MATCHES "^(.+-)?(clang\\+\\+|[gc]\\+\\+|clang-cl)(-?[0-9]+(\\.[0-9]+)*)?(-[^.]+)?(\\.exe)?$") set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_SUFFIX ${CMAKE_MATCH_3}) set(_CMAKE_COMPILER_SUFFIX ${CMAKE_MATCH_5}) diff --git a/Modules/Compiler/Clang-FindBinUtils.cmake b/Modules/Compiler/Clang-FindBinUtils.cmake index daf0371..f4f35e6 100644 --- a/Modules/Compiler/Clang-FindBinUtils.cmake +++ b/Modules/Compiler/Clang-FindBinUtils.cmake @@ -26,6 +26,7 @@ set(__clang_hints ${__clang_hint_1} ${__clang_hint_2}) find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x_y}" "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar-${__version_x}" + "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar${__version_x}" "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar" HINTS ${__clang_hints} NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH @@ -37,6 +38,7 @@ mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR) find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x_y}" "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib-${__version_x}" + "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib${__version_x}" "${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib" HINTS ${__clang_hints} NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH @@ -48,6 +50,7 @@ mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB) find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_CLANG_SCAN_DEPS NAMES "${_CMAKE_TOOLCHAIN_PREFIX}clang-scan-deps-${__version_x_y}" "${_CMAKE_TOOLCHAIN_PREFIX}clang-scan-deps-${__version_x}" + "${_CMAKE_TOOLCHAIN_PREFIX}clang-scan-deps${__version_x}" "${_CMAKE_TOOLCHAIN_PREFIX}clang-scan-deps" HINTS ${__clang_hints} NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH diff --git a/Modules/Compiler/GNU-FindBinUtils.cmake b/Modules/Compiler/GNU-FindBinUtils.cmake index 4dcdd53..3941715 100644 --- a/Modules/Compiler/GNU-FindBinUtils.cmake +++ b/Modules/Compiler/GNU-FindBinUtils.cmake @@ -18,6 +18,7 @@ get_filename_component(__gcc_hints "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPIL find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x_y}" "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x}" + "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${__version_x}" "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_COMPILER_SUFFIX}" HINTS ${__gcc_hints} NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH @@ -29,6 +30,7 @@ mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR) find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x_y}" "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x}" + "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib${__version_x}" "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib${_CMAKE_COMPILER_SUFFIX}" HINTS ${__gcc_hints} NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index e2cc497..1fdd754 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2447,7 +2447,7 @@ function(ExternalProject_Add_Step name step) PROPERTY _EP_${step}_ALWAYS ) if(always) - set(touch) + set(maybe_COMMAND_touch "") # Mark stamp files for all configs as SYMBOLIC since we do not create them. # Remove any existing stamp in case the option changed in an existing tree. get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) @@ -2469,7 +2469,7 @@ function(ExternalProject_Add_Step name step) file(REMOVE ${stamp_file}) endif() else() - set(touch ${CMAKE_COMMAND} -E touch ${stamp_file}) + set(maybe_COMMAND_touch "COMMAND \${CMAKE_COMMAND} -E touch \${stamp_file}") endif() # Wrap with log script? @@ -2497,7 +2497,7 @@ function(ExternalProject_Add_Step name step) BYPRODUCTS \${byproducts} COMMENT \${comment} COMMAND ${__cmdQuoted} - COMMAND \${touch} + ${maybe_COMMAND_touch} DEPENDS \${depends} WORKING_DIRECTORY \${work_dir} VERBATIM diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2470939..f055e81 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 26) -set(CMake_VERSION_PATCH 20230510) +set(CMake_VERSION_PATCH 20230512) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/LexerParser/cmFortranLexer.cxx b/Source/LexerParser/cmFortranLexer.cxx index 5703de1..df65472 100644 --- a/Source/LexerParser/cmFortranLexer.cxx +++ b/Source/LexerParser/cmFortranLexer.cxx @@ -548,8 +548,8 @@ static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 54 -#define YY_END_OF_BUFFER 55 +#define YY_NUM_RULES 55 +#define YY_END_OF_BUFFER 56 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -560,29 +560,29 @@ struct yy_trans_info static const flex_int16_t yy_accept[216] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 55, 49, 51, 50, 53, 1, 49, 33, 2, 47, - 48, 35, 37, 50, 39, 49, 46, 46, 46, 46, - 46, 46, 49, 46, 51, 49, 50, 51, 49, 46, - 9, 8, 9, 9, 4, 3, 49, 0, 10, 0, - 0, 0, 0, 0, 33, 33, 34, 36, 39, 49, - 46, 46, 46, 46, 46, 46, 0, 52, 0, 46, + 56, 50, 52, 51, 54, 1, 50, 34, 2, 48, + 49, 36, 38, 51, 40, 50, 47, 47, 47, 47, + 47, 47, 50, 47, 52, 50, 51, 52, 50, 47, + 9, 8, 9, 9, 4, 3, 50, 0, 10, 0, + 0, 0, 0, 0, 34, 34, 35, 37, 40, 50, + 47, 47, 47, 47, 47, 47, 0, 53, 0, 47, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, - 0, 49, 0, 11, 46, 0, 0, 0, 5, 0, - 0, 0, 0, 0, 29, 0, 33, 33, 33, 33, + 0, 50, 0, 11, 47, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 30, 0, 34, 34, 34, 34, - 0, 0, 40, 46, 46, 46, 46, 45, 12, 12, - 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, + 0, 0, 41, 47, 47, 47, 47, 46, 12, 12, + 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 46, 46, 46, 46, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 30, 31, 0, - 0, 0, 0, 0, 46, 46, 46, 46, 0, 24, - 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 20, 32, 27, 0, 0, 0, 46, 46, 43, 46, - 0, 26, 21, 0, 0, 0, 19, 0, 0, 18, - 28, 0, 0, 41, 46, 46, 17, 22, 0, 7, - - 38, 7, 15, 0, 46, 46, 14, 16, 42, 44, - 0, 0, 0, 13, 0 + 47, 47, 47, 47, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 31, 32, 0, + 0, 0, 0, 0, 47, 47, 47, 47, 0, 25, + 26, 0, 0, 0, 0, 13, 0, 0, 0, 0, + 21, 33, 28, 0, 0, 0, 47, 47, 44, 47, + 0, 27, 22, 0, 0, 13, 20, 0, 0, 19, + 29, 0, 0, 42, 47, 47, 18, 23, 0, 7, + + 39, 7, 16, 0, 47, 47, 15, 17, 43, 45, + 0, 0, 0, 14, 0 } ; static const YY_CHAR yy_ec[256] = @@ -1252,7 +1252,11 @@ YY_RULE_SETUP { return CPP_LINE_DIRECTIVE; } YY_BREAK case 13: -/* rule 13 can match eol */ +YY_RULE_SETUP +{ return CPP_LINE_DIRECTIVE; } + YY_BREAK +case 14: +/* rule 14 can match eol */ YY_RULE_SETUP { yytext[yyleng-1] = 0; @@ -1260,172 +1264,172 @@ YY_RULE_SETUP return CPP_INCLUDE_ANGLE; } YY_BREAK -case 14: +case 15: YY_RULE_SETUP { return CPP_INCLUDE; } YY_BREAK -case 15: +case 16: YY_RULE_SETUP { return F90PPR_INCLUDE; } YY_BREAK -case 16: +case 17: YY_RULE_SETUP { return COCO_INCLUDE; } YY_BREAK -case 17: +case 18: YY_RULE_SETUP { return CPP_DEFINE; } YY_BREAK -case 18: +case 19: YY_RULE_SETUP { return F90PPR_DEFINE; } YY_BREAK -case 19: +case 20: YY_RULE_SETUP { return CPP_UNDEF; } YY_BREAK -case 20: +case 21: YY_RULE_SETUP { return F90PPR_UNDEF; } YY_BREAK -case 21: +case 22: YY_RULE_SETUP { return CPP_IFDEF; } YY_BREAK -case 22: +case 23: YY_RULE_SETUP { return CPP_IFNDEF; } YY_BREAK -case 23: +case 24: YY_RULE_SETUP { return CPP_IF; } YY_BREAK -case 24: +case 25: YY_RULE_SETUP { return CPP_ELIF; } YY_BREAK -case 25: +case 26: YY_RULE_SETUP { return CPP_ELSE; } YY_BREAK -case 26: +case 27: YY_RULE_SETUP { return CPP_ENDIF; } YY_BREAK -case 27: +case 28: YY_RULE_SETUP { return F90PPR_IFDEF; } YY_BREAK -case 28: +case 29: YY_RULE_SETUP { return F90PPR_IFNDEF; } YY_BREAK -case 29: +case 30: YY_RULE_SETUP { return F90PPR_IF; } YY_BREAK -case 30: +case 31: YY_RULE_SETUP { return F90PPR_ELIF; } YY_BREAK -case 31: +case 32: YY_RULE_SETUP { return F90PPR_ELSE; } YY_BREAK -case 32: +case 33: YY_RULE_SETUP { return F90PPR_ENDIF; } YY_BREAK /* Line continuations, possible involving comments. */ -case 33: -/* rule 33 can match eol */ -YY_RULE_SETUP - - YY_BREAK case 34: /* rule 34 can match eol */ YY_RULE_SETUP YY_BREAK case 35: +/* rule 35 can match eol */ YY_RULE_SETUP -{ return COMMA; } + YY_BREAK case 36: YY_RULE_SETUP -{ return DCOLON; } +{ return COMMA; } YY_BREAK case 37: YY_RULE_SETUP -{ return COLON; } +{ return DCOLON; } YY_BREAK case 38: -/* rule 38 can match eol */ YY_RULE_SETUP -{ return GARBAGE; } +{ return COLON; } YY_BREAK case 39: +/* rule 39 can match eol */ YY_RULE_SETUP -{ return ASSIGNMENT_OP; } +{ return GARBAGE; } YY_BREAK case 40: YY_RULE_SETUP -{ return END; } +{ return ASSIGNMENT_OP; } YY_BREAK case 41: YY_RULE_SETUP -{ return INCLUDE; } +{ return END; } YY_BREAK case 42: YY_RULE_SETUP -{ return INTERFACE; } +{ return INCLUDE; } YY_BREAK case 43: YY_RULE_SETUP -{ return MODULE; } +{ return INTERFACE; } YY_BREAK case 44: YY_RULE_SETUP -{ return SUBMODULE; } +{ return MODULE; } YY_BREAK case 45: YY_RULE_SETUP -{ return USE; } +{ return SUBMODULE; } YY_BREAK case 46: YY_RULE_SETUP +{ return USE; } + YY_BREAK +case 47: +YY_RULE_SETUP { yylvalp->string = strdup(yytext); return WORD; } YY_BREAK -case 47: +case 48: YY_RULE_SETUP { return LPAREN; } YY_BREAK -case 48: +case 49: YY_RULE_SETUP { return RPAREN; } YY_BREAK -case 49: +case 50: YY_RULE_SETUP { return GARBAGE; } YY_BREAK -case 50: -/* rule 50 can match eol */ +case 51: +/* rule 51 can match eol */ YY_RULE_SETUP { return EOSTMT; } YY_BREAK -case 51: +case 52: YY_RULE_SETUP /* Ignore */ YY_BREAK -case 52: -/* rule 52 can match eol */ +case 53: +/* rule 53 can match eol */ YY_RULE_SETUP /* Ignore line-endings preceded by \ */ YY_BREAK -case 53: +case 54: YY_RULE_SETUP { return *yytext; } YY_BREAK @@ -1441,7 +1445,7 @@ case YY_STATE_EOF(str_dq): } } YY_BREAK -case 54: +case 55: YY_RULE_SETUP ECHO; YY_BREAK diff --git a/Source/LexerParser/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l index fac3181..7d97699 100644 --- a/Source/LexerParser/cmFortranLexer.in.l +++ b/Source/LexerParser/cmFortranLexer.in.l @@ -102,6 +102,7 @@ Modify cmFortranLexer.cxx: <fixed_fmt>^[cC*dD].*\n { return EOSTMT; } /* empty lines */ ^[ \t]*#([ \t]*line)?[ \t]*[0-9]+[ \t]* { return CPP_LINE_DIRECTIVE; } +^[ \t]*#[ \t]*line[ \t]* { return CPP_LINE_DIRECTIVE; } ^[ \t]*#[ \t]*include[ \t]*<[^>]+> { yytext[yyleng-1] = 0; yylvalp->string = strdup(strchr(yytext, '<')+1); diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 84c85e0..7626fa3 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2226,9 +2226,9 @@ Compilation of source files within a target is split into the following steps: depfile = $DEP_FILE command = gfortran -cpp $DEFINES $INCLUDES $FLAGS -E $in -o $out && cmake -E cmake_ninja_depends \ - --tdi=FortranDependInfo.json --pp=$out --dep=$DEP_FILE \ - --obj=$OBJ_FILE --ddi=$DYNDEP_INTERMEDIATE_FILE \ - --lang=Fortran + --tdi=FortranDependInfo.json --lang=Fortran \ + --src=$out --out=$out --dep=$DEP_FILE --obj=$OBJ_FILE \ + --ddi=$DYNDEP_INTERMEDIATE_FILE build src.f90-pp.f90 | src.f90.o.ddi: Fortran_PREPROCESS src.f90 OBJ_FILE = src.f90.o @@ -2296,14 +2296,15 @@ struct cmSourceInfo }; cm::optional<cmSourceInfo> cmcmd_cmake_ninja_depends_fortran( - std::string const& arg_tdi, std::string const& arg_pp); + std::string const& arg_tdi, std::string const& arg_src); } int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, std::vector<std::string>::const_iterator argEnd) { std::string arg_tdi; - std::string arg_pp; + std::string arg_src; + std::string arg_out; std::string arg_dep; std::string arg_obj; std::string arg_ddi; @@ -2311,8 +2312,10 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, for (std::string const& arg : cmMakeRange(argBeg, argEnd)) { if (cmHasLiteralPrefix(arg, "--tdi=")) { arg_tdi = arg.substr(6); - } else if (cmHasLiteralPrefix(arg, "--pp=")) { - arg_pp = arg.substr(5); + } else if (cmHasLiteralPrefix(arg, "--src=")) { + arg_src = arg.substr(6); + } else if (cmHasLiteralPrefix(arg, "--out=")) { + arg_out = arg.substr(6); } else if (cmHasLiteralPrefix(arg, "--dep=")) { arg_dep = arg.substr(6); } else if (cmHasLiteralPrefix(arg, "--obj=")) { @@ -2321,6 +2324,10 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, arg_ddi = arg.substr(6); } else if (cmHasLiteralPrefix(arg, "--lang=")) { arg_lang = arg.substr(7); + } else if (cmHasLiteralPrefix(arg, "--pp=")) { + // CMake 3.26 and below used '--pp=' instead of '--src=' and '--out='. + arg_src = arg.substr(5); + arg_out = arg_src; } else { cmSystemTools::Error( cmStrCat("-E cmake_ninja_depends unknown argument: ", arg)); @@ -2331,8 +2338,12 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, cmSystemTools::Error("-E cmake_ninja_depends requires value for --tdi="); return 1; } - if (arg_pp.empty()) { - cmSystemTools::Error("-E cmake_ninja_depends requires value for --pp="); + if (arg_src.empty()) { + cmSystemTools::Error("-E cmake_ninja_depends requires value for --src="); + return 1; + } + if (arg_out.empty()) { + cmSystemTools::Error("-E cmake_ninja_depends requires value for --out="); return 1; } if (arg_dep.empty()) { @@ -2354,7 +2365,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, cm::optional<cmSourceInfo> info; if (arg_lang == "Fortran") { - info = cmcmd_cmake_ninja_depends_fortran(arg_tdi, arg_pp); + info = cmcmd_cmake_ninja_depends_fortran(arg_tdi, arg_src); } else { cmSystemTools::Error( cmStrCat("-E cmake_ninja_depends does not understand the ", arg_lang, @@ -2371,7 +2382,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, { cmGeneratedFileStream depfile(arg_dep); - depfile << cmSystemTools::ConvertToUnixOutputPath(arg_pp) << ":"; + depfile << cmSystemTools::ConvertToUnixOutputPath(arg_out) << ":"; for (std::string const& include : info->Includes) { depfile << " \\\n " << cmSystemTools::ConvertToUnixOutputPath(include); } @@ -2389,7 +2400,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, namespace { cm::optional<cmSourceInfo> cmcmd_cmake_ninja_depends_fortran( - std::string const& arg_tdi, std::string const& arg_pp) + std::string const& arg_tdi, std::string const& arg_src) { cm::optional<cmSourceInfo> info; cmFortranCompiler fc; @@ -2441,9 +2452,9 @@ cm::optional<cmSourceInfo> cmcmd_cmake_ninja_depends_fortran( cmFortranSourceInfo finfo; std::set<std::string> defines; cmFortranParser parser(fc, includes, defines, finfo); - if (!cmFortranParser_FilePush(&parser, arg_pp.c_str())) { + if (!cmFortranParser_FilePush(&parser, arg_src.c_str())) { cmSystemTools::Error( - cmStrCat("-E cmake_ninja_depends failed to open ", arg_pp)); + cmStrCat("-E cmake_ninja_depends failed to open ", arg_src)); return info; } if (cmFortran_yyparse(parser.Scanner) != 0) { diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 4ed491d..5bf6a2b 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -540,12 +540,12 @@ void cmNinjaTargetGenerator::WriteLanguageRules(const std::string& language, namespace { // Create the command to run the dependency scanner -std::string GetScanCommand(const std::string& cmakeCmd, const std::string& tdi, - const std::string& lang, const std::string& ppFile, - const std::string& ddiFile) +std::string GetScanCommand(cm::string_view cmakeCmd, cm::string_view tdi, + cm::string_view lang, cm::string_view srcFile, + cm::string_view ddiFile) { return cmStrCat(cmakeCmd, " -E cmake_ninja_depends --tdi=", tdi, - " --lang=", lang, " --pp=", ppFile, + " --lang=", lang, " --src=", srcFile, " --out=$out", " --dep=$DEP_FILE --obj=$OBJ_FILE --ddi=", ddiFile); } @@ -1258,6 +1258,7 @@ namespace { cmNinjaBuild GetScanBuildStatement(const std::string& ruleName, const std::string& ppFileName, bool compilePP, bool compilePPWithDefines, + bool compilationPreprocesses, cmNinjaBuild& objBuild, cmNinjaVars& vars, const std::string& objectFileName, cmLocalGenerator* lg) @@ -1314,6 +1315,13 @@ cmNinjaBuild GetScanBuildStatement(const std::string& ruleName, } else { scanBuild.Outputs.push_back(ddiFile); scanBuild.Variables["PREPROCESSED_OUTPUT_FILE"] = ppFileName; + if (!compilationPreprocesses) { + // Compilation does not preprocess and we are not compiling an + // already-preprocessed source. Make compilation depend on the scan + // results to honor implicit dependencies discovered during scanning + // (such as Fortran INCLUDE directives). + objBuild.ImplicitDeps.emplace_back(ddiFile); + } } // Scanning always provides a depfile for preprocessor dependencies. This @@ -1520,8 +1528,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( } cmNinjaBuild ppBuild = GetScanBuildStatement( - scanRuleName, ppFileName, compilePP, compilePPWithDefines, objBuild, - vars, objectFileName, this->LocalGenerator); + scanRuleName, ppFileName, compilePP, compilePPWithDefines, + compilationPreprocesses, objBuild, vars, objectFileName, + this->LocalGenerator); if (compilePP) { // In case compilation requires flags that are incompatible with diff --git a/Tests/ISPC/ChainedStaticLibraries/CMakeLists.txt b/Tests/ISPC/ChainedStaticLibraries/CMakeLists.txt index 9a255a0..a09f638 100644 --- a/Tests/ISPC/ChainedStaticLibraries/CMakeLists.txt +++ b/Tests/ISPC/ChainedStaticLibraries/CMakeLists.txt @@ -11,10 +11,15 @@ add_library(ispc_objects1 STATIC extra.ispc extra.cxx) add_library(ispc_objects2 STATIC simple.ispc) set_target_properties(ispc_objects1 PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(ispc_objects1 PROPERTIES ISPC_INSTRUCTION_SETS "sse2-i32x4;avx1-i32x16;avx2-i32x4") - set_target_properties(ispc_objects2 PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(ispc_objects2 PROPERTIES ISPC_INSTRUCTION_SETS "sse2-i32x4") + +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + set_property(TARGET ispc_objects1 PROPERTY ISPC_INSTRUCTION_SETS "neon-i32x4") + set_property(TARGET ispc_objects2 PROPERTY ISPC_INSTRUCTION_SETS "neon-i32x4") +else() + set_property(TARGET ispc_objects1 PROPERTY ISPC_INSTRUCTION_SETS "sse2-i32x4;avx1-i32x16;avx2-i32x4") + set_property(TARGET ispc_objects2 PROPERTY ISPC_INSTRUCTION_SETS "sse2-i32x4") +endif() target_link_libraries(ispc_objects2 PRIVATE ispc_objects1) diff --git a/Tests/ISPC/CustomHeaderSuffix/CMakeLists.txt b/Tests/ISPC/CustomHeaderSuffix/CMakeLists.txt index d20f88e..4cf5ca1 100644 --- a/Tests/ISPC/CustomHeaderSuffix/CMakeLists.txt +++ b/Tests/ISPC/CustomHeaderSuffix/CMakeLists.txt @@ -6,7 +6,11 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 4) set(CMAKE_ISPC_FLAGS "--arch=x86") endif() -set(CMAKE_ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i8x16") +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + set(CMAKE_ISPC_INSTRUCTION_SETS "neon-i32x4") +else() + set(CMAKE_ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i8x16") +endif() set(CMAKE_ISPC_HEADER_SUFFIX ".ispc.h") diff --git a/Tests/ISPC/Defines/CMakeLists.txt b/Tests/ISPC/Defines/CMakeLists.txt index 7645804..2b99469 100644 --- a/Tests/ISPC/Defines/CMakeLists.txt +++ b/Tests/ISPC/Defines/CMakeLists.txt @@ -1,7 +1,12 @@ cmake_minimum_required(VERSION 3.18) project(ISPCDefines CXX ISPC) -set(CMAKE_ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i16x8;avx1-i32x16;avx2-i32x4;avx512knl-i32x16;avx512skx-i32x8") +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + set(CMAKE_ISPC_INSTRUCTION_SETS "neon-i32x4") +else() + set(CMAKE_ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i16x8;avx1-i32x16;avx2-i32x4;avx512knl-i32x16;avx512skx-i32x8") +endif() + set(CMAKE_ISPC_FLAGS -DM_PI=3.1415926535f) add_compile_definitions([==[STRUCT_DEFINE=struct{uniform int a]==]) diff --git a/Tests/ISPC/DynamicLibrary/CMakeLists.txt b/Tests/ISPC/DynamicLibrary/CMakeLists.txt index 4655090..516cdc1 100644 --- a/Tests/ISPC/DynamicLibrary/CMakeLists.txt +++ b/Tests/ISPC/DynamicLibrary/CMakeLists.txt @@ -13,8 +13,13 @@ target_sources(ispc_objects2 PRIVATE simple.cxx) set_target_properties(ispc_objects1 PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(ispc_objects1 PROPERTIES ISPC_INSTRUCTION_SETS "sse2-i32x4;avx1-i32x16;avx2-i32x4") -set_target_properties(ispc_objects2 PROPERTIES ISPC_INSTRUCTION_SETS "sse2-i32x4") +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + set_property(TARGET ispc_objects1 PROPERTY ISPC_INSTRUCTION_SETS "neon-i32x4") + set_property(TARGET ispc_objects2 PROPERTY ISPC_INSTRUCTION_SETS "neon-i32x4") +else() + set_property(TARGET ispc_objects1 PROPERTY ISPC_INSTRUCTION_SETS "sse2-i32x4;avx1-i32x16;avx2-i32x4") + set_property(TARGET ispc_objects2 PROPERTY ISPC_INSTRUCTION_SETS "sse2-i32x4") +endif() target_link_libraries(ispc_objects2 PUBLIC ispc_objects1) diff --git a/Tests/ISPC/ObjectGenex/CMakeLists.txt b/Tests/ISPC/ObjectGenex/CMakeLists.txt index bc0cbf6..5e64004 100644 --- a/Tests/ISPC/ObjectGenex/CMakeLists.txt +++ b/Tests/ISPC/ObjectGenex/CMakeLists.txt @@ -1,7 +1,14 @@ cmake_minimum_required(VERSION 3.18) project(ISPCObjectGenex CXX ISPC) -set(CMAKE_ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i16x8;avx1-i32x16;avx2-i32x4;avx512knl-i32x16;avx512skx-i32x8") +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + set(CMAKE_ISPC_INSTRUCTION_SETS "neon-i32x4") + set(numberOfTargets 1) +else() + set(CMAKE_ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i16x8;avx1-i32x16;avx2-i32x4;avx512knl-i32x16;avx512skx-i32x8") + list(LENGTH CMAKE_ISPC_INSTRUCTION_SETS numberOfTargets) + math(EXPR numberOfTargets "${numberOfTargets}+1") +endif() add_library(ispc_objects OBJECT simple.ispc @@ -35,8 +42,6 @@ static std::string obj_paths = "$<TARGET_OBJECTS:ispc_objects>"; add_executable(ISPCObjectGenex main.cxx) add_dependencies(ISPCObjectGenex ispc_objects) -list(LENGTH CMAKE_ISPC_INSTRUCTION_SETS numberOfTargets) -math(EXPR numberOfTargets "${numberOfTargets}+1") target_compile_definitions(ISPCObjectGenex PRIVATE "ExpectedISPCObjects=${numberOfTargets}" "CONFIG_TYPE=gen_$<LOWER_CASE:$<CONFIG>>" diff --git a/Tests/ISPC/ObjectLibrary/CMakeLists.txt b/Tests/ISPC/ObjectLibrary/CMakeLists.txt index a4c81a9..60ce920 100644 --- a/Tests/ISPC/ObjectLibrary/CMakeLists.txt +++ b/Tests/ISPC/ObjectLibrary/CMakeLists.txt @@ -11,8 +11,12 @@ endif() add_library(ispc_objects OBJECT simple.ispc subdir/extra.ispc) set_target_properties(ispc_objects PROPERTIES POSITION_INDEPENDENT_CODE ON) -set_target_properties(ispc_objects PROPERTIES ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i8x16") +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + set_property(TARGET ispc_objects PROPERTY ISPC_INSTRUCTION_SETS "neon-i32x4") +else() + set_property(TARGET ispc_objects PROPERTY ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i8x16") +endif() add_executable(ISPCObjectLibrary main.cxx extra.cxx) target_link_libraries(ISPCObjectLibrary PRIVATE ispc_objects) diff --git a/Tests/ISPC/ResponseAndDefine/CMakeLists.txt b/Tests/ISPC/ResponseAndDefine/CMakeLists.txt index 7539209..d29cb2a 100644 --- a/Tests/ISPC/ResponseAndDefine/CMakeLists.txt +++ b/Tests/ISPC/ResponseAndDefine/CMakeLists.txt @@ -14,13 +14,15 @@ add_executable(ISPCResponseAndDefine main.cxx simple.ispc) set_target_properties(ISPCResponseAndDefine PROPERTIES POSITION_INDEPENDENT_CODE ON) target_include_directories(ISPCResponseAndDefine PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") -target_compile_options(ISPCResponseAndDefine PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>") -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - target_compile_options(ISPCResponseAndDefine PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>") +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + target_compile_options(ISPCResponseAndDefine PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=neon-i32x4>") +else() + target_compile_options(ISPCResponseAndDefine PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>") + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + target_compile_options(ISPCResponseAndDefine PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>") + endif() endif() - - target_compile_definitions(ISPCResponseAndDefine PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:STRUCT_DEFINE=struct{uniform int a>;M_PI=3.14159f") target_include_directories(ISPCResponseAndDefine PRIVATE diff --git a/Tests/ISPC/StaticLibrary/CMakeLists.txt b/Tests/ISPC/StaticLibrary/CMakeLists.txt index ebe5960..76f78e5 100644 --- a/Tests/ISPC/StaticLibrary/CMakeLists.txt +++ b/Tests/ISPC/StaticLibrary/CMakeLists.txt @@ -4,9 +4,13 @@ project(ISPCStaticLibrary CXX ISPC) add_library(ispc_objects STATIC simple.ispc) -target_compile_options(ispc_objects PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>") -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - target_compile_options(ispc_objects PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>") +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + target_compile_options(ispc_objects PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=neon-i32x4>") +else() + target_compile_options(ispc_objects PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>") + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + target_compile_options(ispc_objects PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>") + endif() endif() set_target_properties(ispc_objects PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/Tests/ISPC/SystemIncludes/CMakeLists.txt b/Tests/ISPC/SystemIncludes/CMakeLists.txt index d94e75e..3b4c289 100644 --- a/Tests/ISPC/SystemIncludes/CMakeLists.txt +++ b/Tests/ISPC/SystemIncludes/CMakeLists.txt @@ -7,8 +7,11 @@ set_target_properties(ISPCSystemIncludes PROPERTIES POSITION_INDEPENDENT_CODE ON set_target_properties(ISPCSystemIncludes PROPERTIES ISPC_HEADER_SUFFIX ".ispc.h") target_include_directories(ISPCSystemIncludes SYSTEM PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") - -target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>") -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>") +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=neon-i32x4>") +else() + target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>") + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>") + endif() endif() diff --git a/Tests/RunCMake/BuildDepends/FortranInclude-build1-stderr.txt b/Tests/RunCMake/BuildDepends/FortranInclude-build1-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/BuildDepends/FortranInclude-build1-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/BuildDepends/FortranInclude-build2-stderr.txt b/Tests/RunCMake/BuildDepends/FortranInclude-build2-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/BuildDepends/FortranInclude-build2-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/BuildDepends/FortranInclude.cmake b/Tests/RunCMake/BuildDepends/FortranInclude.cmake new file mode 100644 index 0000000..fa9f399 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/FortranInclude.cmake @@ -0,0 +1,20 @@ +enable_language(Fortran) + +set(check_pairs "") + +add_executable(preprocess FortranIncludePreprocess.F) +set_property(TARGET preprocess PROPERTY Fortran_PREPROCESS ON) +target_include_directories(preprocess PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +list(APPEND check_pairs "$<TARGET_FILE:preprocess>|${CMAKE_CURRENT_BINARY_DIR}/preprocess.inc") + +# LCC < 1.24 has no way to disable Fortran preprocessor +if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL "LCC" OR CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "1.24.00") + add_executable(no_preprocess FortranIncludeNoPreprocess.f) + set_property(TARGET no_preprocess PROPERTY Fortran_PREPROCESS OFF) + target_include_directories(no_preprocess PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + list(APPEND check_pairs "$<TARGET_FILE:no_preprocess>|${CMAKE_CURRENT_BINARY_DIR}/no_preprocess.inc") +endif() + +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +set(check_pairs \"${check_pairs}\") +") diff --git a/Tests/RunCMake/BuildDepends/FortranInclude.step1.cmake b/Tests/RunCMake/BuildDepends/FortranInclude.step1.cmake new file mode 100644 index 0000000..53fdc2f --- /dev/null +++ b/Tests/RunCMake/BuildDepends/FortranInclude.step1.cmake @@ -0,0 +1,2 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/preprocess.inc" "\tPRINT *, 'FortranIncludePreprocess 1'\n") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/no_preprocess.inc" "\tPRINT *, 'FortranIncludeNoPreprocess 1'\n") diff --git a/Tests/RunCMake/BuildDepends/FortranInclude.step2.cmake b/Tests/RunCMake/BuildDepends/FortranInclude.step2.cmake new file mode 100644 index 0000000..05a9f11 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/FortranInclude.step2.cmake @@ -0,0 +1,2 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/preprocess.inc" "\tPRINT *, 'FortranIncludePreprocess 2'\n") +file(WRITE "${RunCMake_TEST_BINARY_DIR}/no_preprocess.inc" "\tPRINT *, 'FortranIncludeNoPreprocess 2'\n") diff --git a/Tests/RunCMake/BuildDepends/FortranIncludeNoPreprocess.f b/Tests/RunCMake/BuildDepends/FortranIncludeNoPreprocess.f new file mode 100644 index 0000000..00b04dc --- /dev/null +++ b/Tests/RunCMake/BuildDepends/FortranIncludeNoPreprocess.f @@ -0,0 +1,3 @@ + PROGRAM FortranIncludeNoPreprocess + INCLUDE 'no_preprocess.inc' + END diff --git a/Tests/RunCMake/BuildDepends/FortranIncludePreprocess.F b/Tests/RunCMake/BuildDepends/FortranIncludePreprocess.F new file mode 100644 index 0000000..680313a --- /dev/null +++ b/Tests/RunCMake/BuildDepends/FortranIncludePreprocess.F @@ -0,0 +1,3 @@ + PROGRAM FortranIncludePreprocess +#include "preprocess.inc" + END diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index b527580..dfa4f49 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -68,6 +68,10 @@ if(NOT RunCMake_GENERATOR STREQUAL "Xcode") unset(run_BuildDepends_skip_step_2) endif() +if(CMake_TEST_Fortran) + run_BuildDepends(FortranInclude) +endif() + run_BuildDepends(Custom-Symbolic-and-Byproduct) run_BuildDepends(Custom-Always) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3007660..cea8cff 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -292,6 +292,10 @@ if(NOT DEFINED CMake_TEST_BuildDepends_GNU_AS endif() endif() +if(CMAKE_Fortran_COMPILER) + list(APPEND BuildDepends_ARGS -DCMake_TEST_Fortran=1) +endif() + add_RunCMake_test(BuildDepends -DMSVC_VERSION=${MSVC_VERSION} -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} @@ -668,6 +672,7 @@ endif() if(XCODE_VERSION) add_RunCMake_test(XcodeProject -DXCODE_VERSION=${XCODE_VERSION} + -DCMAKE_HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR} -DCMake_TEST_Swift=${CMake_TEST_Swift}) add_RunCMake_test(XcodeProject-Embed -DXCODE_VERSION=${XCODE_VERSION}) @@ -786,6 +791,7 @@ endif() add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DMSYS=${MSYS} -DCMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN=${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} + -DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR} -DCMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG=${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG} -DCMAKE_EXECUTABLE_FORMAT=${CMAKE_EXECUTABLE_FORMAT} -DCMake_TEST_ISPC=${CMake_TEST_ISPC} diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 18dde94..bc4a330 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -167,7 +167,9 @@ function(run_cmake test) "|BullseyeCoverage" "|[a-z]+\\([0-9]+\\) malloc:" "|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:" + "|flang-new: warning: argument unused during compilation: .-flang-experimental-exec." "|icp?x: remark: Note that use of .-g. without any optimization-level option will turn off most compiler optimizations" + "|ifx: remark #10440: Note that use of a debug option without any optimization-level option will turnoff most compiler optimizations" "|lld-link: warning: procedure symbol record for .* refers to PDB item index [0-9A-Fa-fx]+ which is not a valid function ID record" "|Error kstat returned" "|Hit xcodebuild bug" diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 3910127..61f7c40 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -101,7 +101,7 @@ function(XcodeSchemaGeneration) run_cmake(XcodeSchemaGeneration) if (XCODE_VERSION VERSION_GREATER_EQUAL 13) - set(maybe_destination -destination platform=macOS) + set(maybe_destination -destination platform=macOS,arch=${CMAKE_HOST_SYSTEM_PROCESSOR}) else() set(maybe_destination "") endif() diff --git a/Tests/RunCMake/install/FILES-EXTRA_ISPC_TARGET_OBJECTS-all-check.cmake b/Tests/RunCMake/install/FILES-EXTRA_ISPC_TARGET_OBJECTS-all-check.cmake index 8750a76..2d4ce66 100644 --- a/Tests/RunCMake/install/FILES-EXTRA_ISPC_TARGET_OBJECTS-all-check.cmake +++ b/Tests/RunCMake/install/FILES-EXTRA_ISPC_TARGET_OBJECTS-all-check.cmake @@ -1,6 +1,10 @@ set(objs obj1 obj2) -set(targets sse2 sse4 avx avx2) +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + set(targets "") +else() + set(targets sse2 sse4 avx avx2) +endif() foreach(o IN LISTS objs) set(item "objs/${o}\\.ispc\\.(o|obj)") check_installed("${item}") diff --git a/Tests/RunCMake/install/FILES-EXTRA_ISPC_TARGET_OBJECTS.cmake b/Tests/RunCMake/install/FILES-EXTRA_ISPC_TARGET_OBJECTS.cmake index ad542ed..91ed458 100644 --- a/Tests/RunCMake/install/FILES-EXTRA_ISPC_TARGET_OBJECTS.cmake +++ b/Tests/RunCMake/install/FILES-EXTRA_ISPC_TARGET_OBJECTS.cmake @@ -1,4 +1,8 @@ enable_language(ISPC) add_library(objs OBJECT obj1.ispc obj2.ispc) -set_target_properties(objs PROPERTIES ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i16x8;avx1-i32x16;avx2-i32x4") +if("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64") + set_property(TARGET objs PROPERTY ISPC_INSTRUCTION_SETS "neon-i32x4") +else() + set_property(TARGET objs PROPERTY ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i16x8;avx1-i32x16;avx2-i32x4") +endif() install(FILES $<TARGET_OBJECTS:objs> DESTINATION objs) |