diff options
254 files changed, 1121 insertions, 1009 deletions
diff --git a/.clang-format b/.clang-format index cba23d6..813a84d 100644 --- a/.clang-format +++ b/.clang-format @@ -1,5 +1,5 @@ --- -# This configuration requires clang-format version 6.0 exactly. +# This configuration requires clang-format version 15 exactly. BasedOnStyle: Mozilla AlignOperands: false AllowShortFunctionsOnASingleLine: InlineOnly diff --git a/.gitattributes b/.gitattributes index 71ecacf..96a1166 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,11 +4,11 @@ .editorconfig export-ignore # Custom attribute to mark sources as using our C code style. -[attr]our-c-style whitespace=tab-in-indent format.clang-format-6.0 +[attr]our-c-style whitespace=tab-in-indent format.clang-format=15 # Custom attribute to mark sources as generated. # Do not perform whitespace checks. Do not format. -[attr]generated whitespace=-tab-in-indent,-indent-with-non-tab -format.clang-format-6.0 +[attr]generated whitespace=-tab-in-indent,-indent-with-non-tab -format.clang-format bootstrap eol=lf configure eol=lf diff --git a/.gitlab/ci/docker/cuda10.2/Dockerfile b/.gitlab/ci/docker/cuda10.2/Dockerfile index b6f37b5..cd30446 100644 --- a/.gitlab/ci/docker/cuda10.2/Dockerfile +++ b/.gitlab/ci/docker/cuda10.2/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:10.2-devel-ubuntu18.04 +FROM kitware/nvidia-cuda:10.2-devel-ubuntu18.04 MAINTAINER Ben Boeckel <ben.boeckel@kitware.com> COPY llvm.list /etc/apt/sources.list.d/llvm.list diff --git a/.gitlab/ci/docker/cuda11.6/Dockerfile b/.gitlab/ci/docker/cuda11.6/Dockerfile index 27cdf8b..f69b0fd 100644 --- a/.gitlab/ci/docker/cuda11.6/Dockerfile +++ b/.gitlab/ci/docker/cuda11.6/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:11.6.0-devel-ubuntu20.04 +FROM kitware/nvidia-cuda:11.6.0-devel-ubuntu20.04 MAINTAINER Ben Boeckel <ben.boeckel@kitware.com> COPY llvm.list /etc/apt/sources.list.d/llvm.list diff --git a/.gitlab/ci/docker/cuda11.8-minimal/Dockerfile b/.gitlab/ci/docker/cuda11.8-minimal/Dockerfile index 02e096e..e185848 100644 --- a/.gitlab/ci/docker/cuda11.8-minimal/Dockerfile +++ b/.gitlab/ci/docker/cuda11.8-minimal/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:11.8.0-devel-ubuntu20.04 +FROM kitware/nvidia-cuda:11.8.0-devel-ubuntu20.04 MAINTAINER Robert Maynard <rmaynard@nvidia.com> COPY install_deps.sh /root/install_deps.sh diff --git a/.gitlab/ci/docker/cuda9.2/Dockerfile b/.gitlab/ci/docker/cuda9.2/Dockerfile index 7eae886..d7e483b 100644 --- a/.gitlab/ci/docker/cuda9.2/Dockerfile +++ b/.gitlab/ci/docker/cuda9.2/Dockerfile @@ -1,4 +1,4 @@ -FROM nvidia/cuda:9.2-devel-ubuntu16.04 +FROM kitware/nvidia-cuda:9.2-devel-ubuntu16.04 MAINTAINER Brad King <brad.king@kitware.com> COPY install_deps.sh /root/install_deps.sh diff --git a/.gitlab/ci/docker/nvhpc22.11/Dockerfile b/.gitlab/ci/docker/nvhpc22.11/Dockerfile index 52f4f8e..078ae37 100644 --- a/.gitlab/ci/docker/nvhpc22.11/Dockerfile +++ b/.gitlab/ci/docker/nvhpc22.11/Dockerfile @@ -1,5 +1,5 @@ # https://catalog.ngc.nvidia.com/orgs/nvidia/containers/nvhpc/tags -FROM nvcr.io/nvidia/nvhpc:22.11-devel-cuda_multi-ubuntu22.04 +FROM kitware/nvidia-nvhpc:22.11-devel-cuda_multi-ubuntu22.04 MAINTAINER Brad King <brad.king@kitware.com> COPY install_deps.sh /root/install_deps.sh diff --git a/Help/command/message.rst b/Help/command/message.rst index 9ac4277..e8a4ea0 100644 --- a/Help/command/message.rst +++ b/Help/command/message.rst @@ -14,6 +14,8 @@ Synopsis `Reporting checks`_ message(<checkState> "message text" ...) + `Configure Log`_ + message(CONFIGURE_LOG <text>...) General messages ^^^^^^^^^^^^^^^^ @@ -194,6 +196,54 @@ Output from the above would appear something like the following:: -- Finding partB - not found -- Finding my things - missing components: B +Configure Log +^^^^^^^^^^^^^ + +.. versionadded:: 3.26 + +.. code-block:: cmake + + message(CONFIGURE_LOG <text>...) + +Record a :ref:`configure-log message event <message configure-log event>` +with the specified ``<text>``. By convention, if the text contains more +than one line, the first line should be a summary of the event. + +This mode is intended to record the details of a system inspection check +or other one-time operation guarded by a cache entry, but that is not +performed using :command:`try_compile` or :command:`try_run`, which +automatically log their details. Projects should avoid calling it every +time CMake runs. For example: + +.. code-block:: cmake + + if (NOT DEFINED MY_CHECK_RESULT) + # Print check summary in configure output. + message(CHECK_START "My Check") + + # ... perform system inspection, e.g., with execute_process ... + + # Cache the result so we do not run the check again. + set(MY_CHECK_RESULT "${MY_CHECK_RESULT}" CACHE INTERNAL "My Check") + + # Record the check details in the cmake-configure-log. + message(CONFIGURE_LOG + "My Check Result: ${MY_CHECK_RESULT}\n" + "${details}" + ) + + # Print check result in configure output. + if(MY_CHECK_RESULT) + message(CHECK_PASS "passed") + else() + message(CHECK_FAIL "failed") + endif() + endif() + +If no project is currently being configured, such as in +:ref:`cmake -P <Script Processing Mode>` script mode, +this command does nothing. + See Also ^^^^^^^^ diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index 8f6a4eb..21b063f 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -42,6 +42,11 @@ below for the meaning of other options. Previously this was only done by the :ref:`source file <Try Compiling Source Files>` signature. +.. versionadded:: 3.26 + This command records a + :ref:`configure-log try_compile event <try_compile configure-log event>` + if the ``NO_LOG`` option is not specified. + This command also supports an alternate signature which was present in older versions of CMake: diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst index ef8ec96..7566264 100644 --- a/Help/command/try_run.rst +++ b/Help/command/try_run.rst @@ -50,6 +50,11 @@ the test project is constructed to build the source file. One or more source files must be provided. Additionally, one of ``SOURCES`` and/or ``SOURCE_FROM_*`` must precede other keywords. +.. versionadded:: 3.26 + This command records a + :ref:`configure-log try_run event <try_run configure-log event>` + if the ``NO_LOG`` option is not specified. + This command also supports an alternate signature which was present in older versions of CMake: diff --git a/Help/dev/source.rst b/Help/dev/source.rst index f488b3e..68ca743 100644 --- a/Help/dev/source.rst +++ b/Help/dev/source.rst @@ -9,7 +9,7 @@ See documentation on `CMake Development`_ for more information. C++ Code Style ============== -We use `clang-format`_ version **6.0** to define our style for C++ code in +We use `clang-format`_ version **15** to define our style for C++ code in the CMake source tree. See the `.clang-format`_ configuration file for our style settings. Use the `Utilities/Scripts/clang-format.bash`_ script to format source code. It automatically runs ``clang-format`` on the set of diff --git a/Help/guide/tutorial/Adding Export Configuration.rst b/Help/guide/tutorial/Adding Export Configuration.rst index eb14f42..6c83276 100644 --- a/Help/guide/tutorial/Adding Export Configuration.rst +++ b/Help/guide/tutorial/Adding Export Configuration.rst @@ -102,7 +102,7 @@ but prepended with a ``PACKAGE_`` prefix. :end-before: # generate the version file The :command:`write_basic_package_version_file` is next. This command writes -a file which is used by the "find_package" document the version and +a file which is used by :command:`find_package`, documenting the version and compatibility of the desired package. Here, we use the ``Tutorial_VERSION_*`` variables and say that it is compatible with ``AnyNewerVersion``, which denotes that this version or any higher one are compatible with the requested @@ -133,8 +133,8 @@ the following to the bottom of the top level ``CMakeLists.txt``: :caption: CMakeLists.txt :name: CMakeLists.txt-export :language: cmake - :start-after: # needs to be after the install(TARGETS ) command + :start-after: # needs to be after the install(TARGETS) command -With this export call we now generate a ``Targets.cmake``, allowing the +With this export call we now generate a ``MathFunctionsTargets.cmake``, allowing the configured ``MathFunctionsConfig.cmake`` in the build directory to be used by other projects, without needing it to be installed. diff --git a/Help/guide/tutorial/Installing and Testing.rst b/Help/guide/tutorial/Installing and Testing.rst index aa3fb74..7a59fcb 100644 --- a/Help/guide/tutorial/Installing and Testing.rst +++ b/Help/guide/tutorial/Installing and Testing.rst @@ -1,8 +1,6 @@ Step 5: Installing and Testing ============================== -.. _`Tutorial Testing Support`: - Exercise 1 - Install Rules ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -154,6 +152,8 @@ are similar. To the end of the top-level ``CMakeLists.txt`` we add: That is all that is needed to create a basic local install of the tutorial. +.. _`Tutorial Testing Support`: + Exercise 2 - Testing Support ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst index 1c49c23..7befe1d 100644 --- a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst +++ b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst @@ -65,7 +65,7 @@ At this point, if you build everything, you may notice that linking fails as we are combining a static library without position independent code with a library that has position independent code. The solution to this is to explicitly set the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property of -SqrtLibrary to be ``True`` no matter the build type. +SqrtLibrary to be ``True`` when building shared libraries. .. literalinclude:: Step11/MathFunctions/CMakeLists.txt :caption: MathFunctions/CMakeLists.txt diff --git a/Help/guide/tutorial/Step12/CMakeLists.txt b/Help/guide/tutorial/Step12/CMakeLists.txt index 220ed4b..1d8b5a6 100644 --- a/Help/guide/tutorial/Step12/CMakeLists.txt +++ b/Help/guide/tutorial/Step12/CMakeLists.txt @@ -94,7 +94,7 @@ install(EXPORT MathFunctionsTargets ) include(CMakePackageConfigHelpers) -# generate the config file that is includes the exports +# generate the config file that includes the exports configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake" INSTALL_DESTINATION "lib/cmake/example" @@ -116,7 +116,7 @@ install(FILES ) # generate the export targets for the build tree -# needs to be after the install(TARGETS ) command +# needs to be after the install(TARGETS) command export(EXPORT MathFunctionsTargets FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake" ) diff --git a/Help/guide/tutorial/Step5/CMakeLists.txt b/Help/guide/tutorial/Step5/CMakeLists.txt index c894917..279ddf9 100644 --- a/Help/guide/tutorial/Step5/CMakeLists.txt +++ b/Help/guide/tutorial/Step5/CMakeLists.txt @@ -61,4 +61,4 @@ target_include_directories(Tutorial PUBLIC # Hint: Use the PASS_REGULAR_EXPRESSION property with "4 is 2" # TODO 9: Add more tests. Create a function called do_test to avoid copy + -# paste. Test the following values: 4, 9, 5, 7, 25, -25 and 0.00001. +# paste. Test the following values: 4, 9, 5, 7, 25, -25 and 0.0001. diff --git a/Help/manual/cmake-configure-log.7.rst b/Help/manual/cmake-configure-log.7.rst index 2620124..a9c185d 100644 --- a/Help/manual/cmake-configure-log.7.rst +++ b/Help/manual/cmake-configure-log.7.rst @@ -131,6 +131,40 @@ The keys common to all events are: Additional mapping keys are specific to each (versioned) event kind, described below. +.. _`message configure-log event`: + +Event Kind ``message`` +---------------------- + +The :command:`message(CONFIGURE_LOG)` command logs ``message`` events. + +There is only one ``message`` event major version, version 1. + +.. _`message-v1 event`: + +``message-v1`` Event +^^^^^^^^^^^^^^^^^^^^ + +A ``message-v1`` event is a YAML mapping: + +.. code-block:: yaml + + kind: "message-v1" + backtrace: + - "CMakeLists.txt:123 (message)" + checks: + - "Checking for something" + message: | + # ... + +The keys specific to ``message-v1`` mappings are: + +``message`` + A YAML literal block scalar containing the message text, + represented using our `Text Block Encoding`_. + +.. _`try_compile configure-log event`: + Event Kind ``try_compile`` -------------------------- @@ -204,6 +238,8 @@ The keys specific to ``try_compile-v1`` mappings are: An integer specifying the build tool exit code from trying to build the test project. +.. _`try_run configure-log event`: + Event Kind ``try_run`` ---------------------- diff --git a/Help/prop_tgt/DEFINE_SYMBOL.rst b/Help/prop_tgt/DEFINE_SYMBOL.rst index eb7f937..775cf89 100644 --- a/Help/prop_tgt/DEFINE_SYMBOL.rst +++ b/Help/prop_tgt/DEFINE_SYMBOL.rst @@ -8,4 +8,10 @@ compiling sources in a shared library. If not set here then it is set to ``target_EXPORTS`` by default (with some substitutions if the target is not a valid C identifier). This is useful for headers to know whether they are being included from inside their library or outside to -properly setup dllexport/dllimport decorations. +properly setup dllexport/dllimport decorations on Windows. + +On POSIX platforms, this can optionally be used to control the visibility +of symbols. + +CMake provides support for such decorations with the :module:`GenerateExportHeader` +module. diff --git a/Help/release/3.25.rst b/Help/release/3.25.rst index dea8de8..2d04741 100644 --- a/Help/release/3.25.rst +++ b/Help/release/3.25.rst @@ -253,3 +253,7 @@ Changes made since CMake 3.25.0 include the following. * CUDA language level 20 (corresponding to C++20) is now supported with NVCC 12.0 and above. + +* On Windows, the ``icpx`` compiler now provided by Intel oneAPI 2023.0 + and above is no longer selected because its GNU-like command-line is + not yet supported by CMake. diff --git a/Help/release/dev/FindCUDAToolkit-nvrtc.rst b/Help/release/dev/FindCUDAToolkit-nvrtc.rst new file mode 100644 index 0000000..5f8bfdd --- /dev/null +++ b/Help/release/dev/FindCUDAToolkit-nvrtc.rst @@ -0,0 +1,5 @@ +FindCUDAToolkit-nvrtc +--------------------- + +* The :module:`FindCUDAToolkit` module now provides a target for + ``libnvrtc_static``, if found. diff --git a/Help/release/dev/configure-log.rst b/Help/release/dev/configure-log.rst index f802a8c..588a54c 100644 --- a/Help/release/dev/configure-log.rst +++ b/Help/release/dev/configure-log.rst @@ -7,6 +7,9 @@ Configure Log * The :manual:`cmake-file-api(7)` gained a new "configureLog" object kind that enables stable access to the :manual:`cmake-configure-log(7)`. +* The :command:`message` command gained a ``CONFIGURE_LOG`` mode to + record an entry in the :manual:`cmake-configure-log(7)`. + * The :command:`try_compile` and :command:`try_run` commands gained a ``LOG_DESCRIPTION`` option specifying text to be recorded in the :manual:`cmake-configure-log(7)`. diff --git a/Help/release/dev/cygwin-no-legacy-win32.rst b/Help/release/dev/cygwin-no-legacy-win32.rst new file mode 100644 index 0000000..7991138 --- /dev/null +++ b/Help/release/dev/cygwin-no-legacy-win32.rst @@ -0,0 +1,5 @@ +cygwin-no-legacy-win32 +---------------------- + +* On CYGWIN, the undocumented ``CMAKE_LEGACY_CYGWIN_WIN32`` mode for + compatibility with CMake versions older than 2.8.4 has been removed. diff --git a/Help/variable/CMAKE_CONFIGURATION_TYPES.rst b/Help/variable/CMAKE_CONFIGURATION_TYPES.rst index 75ff8a1..887eb2f 100644 --- a/Help/variable/CMAKE_CONFIGURATION_TYPES.rst +++ b/Help/variable/CMAKE_CONFIGURATION_TYPES.rst @@ -3,7 +3,8 @@ CMAKE_CONFIGURATION_TYPES Specifies the available build types (configurations) on multi-config generators (e.g. :ref:`Visual Studio <Visual Studio Generators>`, -:generator:`Xcode`, or :generator:`Ninja Multi-Config`). Typical values +:generator:`Xcode`, or :generator:`Ninja Multi-Config`) as a +:ref:`semicolon-separated list <CMake Language Lists>`. Typical entries include ``Debug``, ``Release``, ``RelWithDebInfo`` and ``MinSizeRel``, but custom build types can also be defined. diff --git a/Modules/CMakeCCompilerABI.c b/Modules/CMakeCCompilerABI.c index f0ee21a..63596be 100644 --- a/Modules/CMakeCCompilerABI.c +++ b/Modules/CMakeCCompilerABI.c @@ -9,7 +9,8 @@ #include "CMakeCompilerABI.h" #ifdef __CLASSIC_C__ -int main(argc, argv) int argc; +int main(argc, argv) +int argc; char* argv[]; #else int main(int argc, char* argv[]) diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index f43b17b..53c5f78 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -520,10 +520,10 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") set(_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT \"${CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT}\")") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed CUDA nvcc implicit link information from above output:\n${_nvcc_log}\n${log}\n\n") + message(CONFIGURE_LOG + "Parsed CUDA nvcc implicit link information:\n${_nvcc_log}\n${log}\n\n") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Failed to parse CUDA nvcc implicit link information:\n${_nvcc_log}\n\n") message(FATAL_ERROR "Failed to extract nvcc implicit link line.") endif() @@ -576,10 +576,10 @@ if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") list(APPEND CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "${line}") endforeach() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed CUDA nvcc include information from above output:\n${_nvcc_log}\n${log}\n\n") + message(CONFIGURE_LOG + "Parsed CUDA nvcc include information:\n${_nvcc_log}\n${log}\n\n") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Failed to detect CUDA nvcc include information:\n${_nvcc_log}\n\n") endif() diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 053effa..4169734 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -82,8 +82,6 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) # Load the resulting information strings. if(CMAKE_${lang}_ABI_COMPILED) message(CHECK_PASS "done") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n") file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 32 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]") set(ABI_SIZEOF_DPTR "NOTFOUND") set(ABI_BYTE_ORDER "NOTFOUND") @@ -126,8 +124,8 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) set (implicit_incdirs "") cmake_parse_implicit_include_info("${OUTPUT}" "${lang}" implicit_incdirs log rv) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed ${lang} implicit include dir info from above output: rv=${rv}\n${log}\n\n") + message(CONFIGURE_LOG + "Parsed ${lang} implicit include dir info: rv=${rv}\n${log}\n\n") if("${rv}" STREQUAL "done") # Entries that we have been told to explicitly pass as standard include # directories will not be implicitly added by the compiler. @@ -151,8 +149,8 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}" COMPUTE_IMPLICIT_OBJECTS implicit_objs LANGUAGE ${lang}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed ${lang} implicit link information from above output:\n${log}\n\n") + message(CONFIGURE_LOG + "Parsed ${lang} implicit link information:\n${log}\n\n") endif() # for VS IDE Intel Fortran we have to figure out the # implicit link path for the fortran run time using @@ -195,8 +193,6 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) else() message(CHECK_FAIL "failed") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n${_copy_error}\n\n") endif() endif() endfunction() diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 7f392c8..ece9f39 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -2,6 +2,8 @@ # file Copyright.txt or https://cmake.org/licensing for details. macro(__determine_compiler_id_test testflags_var userflags_var) + set(_CMAKE_${lang}_COMPILER_ID_LOG "") + separate_arguments(testflags UNIX_COMMAND "${${testflags_var}}") CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${testflags}" "${${userflags_var}}" "${src}") CMAKE_DETERMINE_COMPILER_ID_MATCH_VENDOR("${lang}" "${COMPILER_${lang}_PRODUCED_OUTPUT}") @@ -11,6 +13,9 @@ macro(__determine_compiler_id_test testflags_var userflags_var) CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}") endforeach() endif() + + message(CONFIGURE_LOG "${_CMAKE_${lang}_COMPILER_ID_LOG}") + unset(_CMAKE_${lang}_COMPILER_ID_LOG) endmacro() # Function to compile a source file to identify the compiler. This is @@ -85,8 +90,6 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) # If the compiler is still unknown, fallback to GHS if(NOT CMAKE_${lang}_COMPILER_ID AND "${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI") set(CMAKE_${lang}_COMPILER_ID GHS) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "The ${lang} compiler identification is falling back to GHS.\n\n") endif() # CUDA < 7.5 is missing version macros @@ -116,7 +119,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) RESULT_VARIABLE result TIMEOUT 10 ) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Running the ${lang} compiler: \"${CMAKE_${lang}_COMPILER}\" -version\n" "${output}\n" ) @@ -140,7 +143,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) RESULT_VARIABLE result TIMEOUT 10 ) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Running the ${lang} compiler: \"${CMAKE_${lang}_COMPILER}\" -version\n" "${output}\n" ) @@ -160,7 +163,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) RESULT_VARIABLE result TIMEOUT 10 ) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Running the ${lang} compiler: \"${CMAKE_${lang}_COMPILER}\" --version\n" "${output}\n" ) @@ -724,7 +727,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} OR CMAKE_${lang}_COMPILER_ID_OUTPUT MATCHES "warning #5117: Bad # preprocessor line" ) # Compilation failed. - string(APPEND _CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG + set(MSG "Compiling the ${lang} compiler identification source file \"${src}\" failed. ${COMPILER_DESCRIPTION} The output was: @@ -734,14 +737,16 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} ") # Log the output unless we recognize it as a known-bad case. if(NOT CMAKE_${lang}_COMPILER_ID_OUTPUT MATCHES "warning #5117: Bad # preprocessor line") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}") + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG "${MSG}") endif() + string(APPEND _CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG "${MSG}") + # Some languages may know the correct/desired set of flags and want to fail right away if they don't work. # This is currently only used by CUDA. if(__compiler_id_require_success) message(FATAL_ERROR "${_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG}") - else() + elseif(CMAKE_${lang}_COMPILER_ID_REQUIRE_SUCCESS) # Build up the outputs for compiler detection attempts so that users # can see all set of flags tried, instead of just last set(_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG "${_CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG}" PARENT_SCOPE) @@ -752,7 +757,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} set(COMPILER_${lang}_PRODUCED_OUTPUT) else() # Compilation succeeded. - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG "Compiling the ${lang} compiler identification source file \"${src}\" succeeded. ${COMPILER_DESCRIPTION} The output was: @@ -781,7 +786,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} foreach(file ${files}) if(NOT IS_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}/${file}) list(APPEND COMPILER_${lang}_PRODUCED_FILES ${file}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG "Compilation of the ${lang} compiler identification source \"" "${src}\" produced \"${file}\"\n\n") endif() @@ -789,7 +794,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} if(NOT COMPILER_${lang}_PRODUCED_FILES) # No executable was found. - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG "Compilation of the ${lang} compiler identification source \"" "${src}\" did not produce an executable in \"" "${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n") @@ -801,6 +806,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} # Return the files produced by the compilation. set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE) set(COMPILER_${lang}_PRODUCED_OUTPUT "${COMPILER_${lang}_PRODUCED_OUTPUT}" PARENT_SCOPE) + set(_CMAKE_${lang}_COMPILER_ID_LOG "${_CMAKE_${lang}_COMPILER_ID_LOG}" PARENT_SCOPE) endfunction() @@ -994,15 +1000,16 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) # Check the compiler identification string. if(CMAKE_${lang}_COMPILER_ID) # The compiler identification was found. - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \"" - "${file}\"\n\n") + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG + "The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in:\n" + " ${file}\n\n") else() # The compiler identification could not be found. - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "The ${lang} compiler identification could not be found in \"" - "${file}\"\n\n") + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG + "The ${lang} compiler identification could not be found in:\n" + " ${file}\n\n") endif() + set(_CMAKE_${lang}_COMPILER_ID_LOG "${_CMAKE_${lang}_COMPILER_ID_LOG}" PARENT_SCOPE) endif() # try to figure out the executable format: ELF, COFF, Mach-O @@ -1089,7 +1096,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang userflags) ) if("${output}" MATCHES "${regex}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " "matched \"${regex}\":\n${output}") set(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE) @@ -1098,11 +1105,11 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang userflags) break() else() if("${result}" MATCHES "timeout") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " "terminated after 10 s due to timeout.") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " "did not match \"${regex}\":\n${output}") endif() diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index d169012..8cbaf70 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -187,11 +187,11 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) if(NOT CMAKE_COMPILER_RETURN) if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_GNU") set(CMAKE_Fortran_COMPILER_ID "GNU") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Determining if the Fortran compiler is GNU succeeded with " "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Determining if the Fortran compiler is GNU failed with " "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") endif() diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index 94e92e8..d4dcc62 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -196,13 +196,14 @@ endif() if(CMAKE_BINARY_DIR) # write entry to the log file if(PRESET_CMAKE_SYSTEM_NAME) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n") + message(CONFIGURE_LOG + "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n" + "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n" + ) else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n") + message(CONFIGURE_LOG + "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n" + ) endif() # if a toolchain file is used, it needs to be included in the configured file, diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 62f7ef2..a75dfce 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -17,19 +17,20 @@ if(CMAKE_Swift_COMPILER_ID) include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift OPTIONAL) endif() -set(CMAKE_EXE_EXPORTS_Swift_FLAG "-emit-module -emit-module-path <SWIFT_MODULE> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS}") - set(CMAKE_INCLUDE_FLAG_Swift "-I ") -if(CMAKE_SYSTEM_NAME STREQUAL Darwin) + +# FIXME: Move compiler- and platform-specific flags to the above-included modules. +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS" + OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -install_name -Xlinker ") elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -soname -Xlinker ") endif() - if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows) set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ") - if(CMAKE_SYSTEM_NAME STREQUAL Darwin) + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS" + OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS") set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP "") set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP "") else() @@ -114,6 +115,10 @@ if(NOT CMAKE_Swift_LINK_EXECUTABLE) set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") endif() +if(NOT CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS) + set(CMAKE_Swift_LINK_EXECUTABLE_WITH_EXPORTS "${CMAKE_Swift_LINK_EXECUTABLE} -emit-module -emit-module-path <SWIFT_MODULE> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS}") +endif() + if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY) set(CMAKE_Swift_CREATE_STATIC_LIBRARY "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake index a706767..58726db 100644 --- a/Modules/CMakeTestCCompiler.cmake +++ b/Modules/CMakeTestCCompiler.cmake @@ -63,9 +63,6 @@ if(NOT CMAKE_C_COMPILER_WORKS) __TestCompiler_restoreTryCompileTargetType() if(NOT CMAKE_C_COMPILER_WORKS) PrintTestCompilerResult(CHECK_FAIL "broken") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the C compiler works failed with " - "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n") string(REPLACE "\n" "\n " _output "${__CMAKE_C_COMPILER_OUTPUT}") message(FATAL_ERROR "The C compiler\n \"${CMAKE_C_COMPILER}\"\n" "is not able to compile a simple test program.\nIt fails " @@ -73,9 +70,6 @@ if(NOT CMAKE_C_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") endif() PrintTestCompilerResult(CHECK_PASS "works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the C compiler works passed with " - "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n") endif() # Try to identify the compiler features diff --git a/Modules/CMakeTestCSharpCompiler.cmake b/Modules/CMakeTestCSharpCompiler.cmake index 1c9e249..9f4b99f 100644 --- a/Modules/CMakeTestCSharpCompiler.cmake +++ b/Modules/CMakeTestCSharpCompiler.cmake @@ -44,9 +44,6 @@ endif() if(NOT CMAKE_CSharp_COMPILER_WORKS) PrintTestCompilerResult(CHECK_FAIL "broken") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the C# compiler works failed with " - "the following output:\n${__CMAKE_CSharp_COMPILER_OUTPUT}\n\n") string(REPLACE "\n" "\n " _output "${__CMAKE_CSharp_COMPILER_OUTPUT}") message(FATAL_ERROR "The C# compiler\n \"${CMAKE_CSharp_COMPILER}\"\n" "is not able to compile a simple test program.\nIt fails " @@ -55,9 +52,6 @@ if(NOT CMAKE_CSharp_COMPILER_WORKS) else() if(CSharp_TEST_WAS_RUN) PrintTestCompilerResult(CHECK_PASS "works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the C# compiler works passed with " - "the following output:\n${__CMAKE_CSharp_COMPILER_OUTPUT}\n\n") endif() # Re-configure to save learned information. diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake index f2fa6ea..5779e4b 100644 --- a/Modules/CMakeTestCUDACompiler.cmake +++ b/Modules/CMakeTestCUDACompiler.cmake @@ -60,7 +60,7 @@ if(CMAKE_CUDA_ABI_COMPILED) set(_CUDA_ARCHS_STATUS "") endif() string(REPLACE "\n" "\n " _CUDA_ARCHS_OUTPUT " ${_CUDA_ARCHS_OUTPUT}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Detecting the CUDA native architecture(s) failed with " "the following output:\n${_CUDA_ARCHS_OUTPUT}\n\n") endif() @@ -96,9 +96,6 @@ if(NOT CMAKE_CUDA_COMPILER_WORKS) unset(CMAKE_CUDA_COMPILER_WORKS CACHE) if(NOT CMAKE_CUDA_COMPILER_WORKS) PrintTestCompilerResult(CHECK_FAIL "broken") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the CUDA compiler works failed with " - "the following output:\n${__CMAKE_CUDA_COMPILER_OUTPUT}\n\n") string(REPLACE "\n" "\n " _output "${__CMAKE_CUDA_COMPILER_OUTPUT}") message(FATAL_ERROR "The CUDA compiler\n \"${CMAKE_CUDA_COMPILER}\"\n" "is not able to compile a simple test program.\nIt fails " @@ -106,9 +103,6 @@ if(NOT CMAKE_CUDA_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") endif() PrintTestCompilerResult(CHECK_PASS "works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the CUDA compiler works passed with " - "the following output:\n${__CMAKE_CUDA_COMPILER_OUTPUT}\n\n") endif() # Try to identify the compiler features diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake index fa4016a..e640ff9 100644 --- a/Modules/CMakeTestCXXCompiler.cmake +++ b/Modules/CMakeTestCXXCompiler.cmake @@ -56,9 +56,6 @@ if(NOT CMAKE_CXX_COMPILER_WORKS) __TestCompiler_restoreTryCompileTargetType() if(NOT CMAKE_CXX_COMPILER_WORKS) PrintTestCompilerResult(CHECK_FAIL "broken") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the C++ compiler works failed with " - "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n") string(REPLACE "\n" "\n " _output "${__CMAKE_CXX_COMPILER_OUTPUT}") message(FATAL_ERROR "The C++ compiler\n \"${CMAKE_CXX_COMPILER}\"\n" "is not able to compile a simple test program.\nIt fails " @@ -66,9 +63,6 @@ if(NOT CMAKE_CXX_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") endif() PrintTestCompilerResult(CHECK_PASS "works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the C++ compiler works passed with " - "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n") endif() # Try to identify the compiler features diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake index e6d1f6d..1baa18d 100644 --- a/Modules/CMakeTestFortranCompiler.cmake +++ b/Modules/CMakeTestFortranCompiler.cmake @@ -55,9 +55,6 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS) unset(CMAKE_Fortran_COMPILER_WORKS CACHE) if(NOT CMAKE_Fortran_COMPILER_WORKS) PrintTestCompilerResult(CHECK_FAIL "broken") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the Fortran compiler works failed with " - "the following output:\n${OUTPUT}\n\n") string(REPLACE "\n" "\n " _output "${OUTPUT}") message(FATAL_ERROR "The Fortran compiler\n \"${CMAKE_Fortran_COMPILER}\"\n" "is not able to compile a simple test program.\nIt fails " @@ -65,9 +62,6 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") endif() PrintTestCompilerResult(CHECK_PASS "works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the Fortran compiler works passed with " - "the following output:\n${OUTPUT}\n\n") endif() # Test for Fortran 90 support by using an f90-specific construct. @@ -84,15 +78,9 @@ if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90) unset(__TestCompiler_testFortranCompilerF90Source) if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) message(CHECK_PASS "yes") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the Fortran compiler supports Fortran 90 passed with " - "the following output:\n${OUTPUT}\n\n") set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1) else() message(CHECK_FAIL "no") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the Fortran compiler supports Fortran 90 failed with " - "the following output:\n${OUTPUT}\n\n") set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0) endif() unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE) diff --git a/Modules/CMakeTestHIPCompiler.cmake b/Modules/CMakeTestHIPCompiler.cmake index 1da0ae4..686f055 100644 --- a/Modules/CMakeTestHIPCompiler.cmake +++ b/Modules/CMakeTestHIPCompiler.cmake @@ -59,9 +59,6 @@ if(NOT CMAKE_HIP_COMPILER_WORKS) __TestCompiler_restoreTryCompileTargetType() if(NOT CMAKE_HIP_COMPILER_WORKS) PrintTestCompilerResult(CHECK_FAIL "broken") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the HIP compiler works failed with " - "the following output:\n${__CMAKE_HIP_COMPILER_OUTPUT}\n\n") string(REPLACE "\n" "\n " _output "${__CMAKE_HIP_COMPILER_OUTPUT}") message(FATAL_ERROR "The HIP compiler\n \"${CMAKE_HIP_COMPILER}\"\n" "is not able to compile a simple test program.\nIt fails " @@ -69,9 +66,6 @@ if(NOT CMAKE_HIP_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") endif() PrintTestCompilerResult(CHECK_PASS "works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the HIP compiler works passed with " - "the following output:\n${__CMAKE_HIP_COMPILER_OUTPUT}\n\n") endif() set(CMAKE_HIP_FLAGS "${__CMAKE_HIP_FLAGS}") diff --git a/Modules/CMakeTestOBJCCompiler.cmake b/Modules/CMakeTestOBJCCompiler.cmake index bbc90a7..a36180b 100644 --- a/Modules/CMakeTestOBJCCompiler.cmake +++ b/Modules/CMakeTestOBJCCompiler.cmake @@ -60,9 +60,6 @@ if(NOT CMAKE_OBJC_COMPILER_WORKS) __TestCompiler_restoreTryCompileTargetType() if(NOT CMAKE_OBJC_COMPILER_WORKS) PrintTestCompilerResult(CHECK_FAIL "broken") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the Objective-C compiler works failed with " - "the following output:\n${__CMAKE_OBJC_COMPILER_OUTPUT}\n\n") string(REPLACE "\n" "\n " _output "${__CMAKE_OBJC_COMPILER_OUTPUT}") message(FATAL_ERROR "The Objective-C compiler\n \"${CMAKE_OBJC_COMPILER}\"\n" "is not able to compile a simple test program.\nIt fails " @@ -70,9 +67,6 @@ if(NOT CMAKE_OBJC_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") endif() PrintTestCompilerResult(CHECK_PASS "works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the Objective-C compiler works passed with " - "the following output:\n${__CMAKE_OBJC_COMPILER_OUTPUT}\n\n") endif() # Try to identify the compiler features diff --git a/Modules/CMakeTestOBJCXXCompiler.cmake b/Modules/CMakeTestOBJCXXCompiler.cmake index aceb939..f7935c7 100644 --- a/Modules/CMakeTestOBJCXXCompiler.cmake +++ b/Modules/CMakeTestOBJCXXCompiler.cmake @@ -59,9 +59,6 @@ if(NOT CMAKE_OBJCXX_COMPILER_WORKS) __TestCompiler_restoreTryCompileTargetType() if(NOT CMAKE_OBJCXX_COMPILER_WORKS) PrintTestCompilerResult(CHECK_FAIL "broken") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the Objective-C++ compiler works failed with " - "the following output:\n${__CMAKE_OBJCXX_COMPILER_OUTPUT}\n\n") string(REPLACE "\n" "\n " _output "${__CMAKE_OBJCXX_COMPILER_OUTPUT}") message(FATAL_ERROR "The Objective-C++ compiler\n \"${CMAKE_OBJCXX_COMPILER}\"\n" "is not able to compile a simple test program.\nIt fails " @@ -69,9 +66,6 @@ if(NOT CMAKE_OBJCXX_COMPILER_WORKS) "CMake will not be able to correctly generate this project.") endif() PrintTestCompilerResult(CHECK_PASS "works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the Objective-C++ compiler works passed with " - "the following output:\n${__CMAKE_OBJCXX_COMPILER_OUTPUT}\n\n") endif() # Try to identify the compiler features diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake index 88a864c..c7df912 100644 --- a/Modules/CMakeTestSwiftCompiler.cmake +++ b/Modules/CMakeTestSwiftCompiler.cmake @@ -36,9 +36,6 @@ endif() if(NOT CMAKE_Swift_COMPILER_WORKS) PrintTestCompilerResult(CHECK_FAIL "broken") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the Swift compiler works failed with " - "the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n") string(REPLACE "\n" "\n " _output "${__CMAKE_Swift_COMPILER_OUTPUT}") message(FATAL_ERROR "The Swift compiler\n \"${CMAKE_Swift_COMPILER}\"\n" "is not able to compile a simple test program.\nIt fails " @@ -47,9 +44,6 @@ if(NOT CMAKE_Swift_COMPILER_WORKS) else() if(Swift_TEST_WAS_RUN) PrintTestCompilerResult(CHECK_PASS "works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the Swift compiler works passed with " - "the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n") endif() # Unlike C and CXX we do not yet detect any information about the Swift ABI. diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake index 7e3a7ee..4e5a246 100644 --- a/Modules/CheckFortranFunctionExists.cmake +++ b/Modules/CheckFortranFunctionExists.cmake @@ -70,21 +70,14 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE) SOURCE_FROM_VAR testFortranCompiler.f __CheckFunction_testFortranCompilerSource ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS} ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} - OUTPUT_VARIABLE OUTPUT ) unset(__CheckFunction_testFortranCompilerSource) if(${VARIABLE}) set(${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") message(CHECK_PASS "found") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" - "${OUTPUT}\n\n") else() message(CHECK_FAIL "not found") set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" - "${OUTPUT}\n\n") endif() endif() endmacro() diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake index 60f0184..e2939ed 100644 --- a/Modules/CheckFunctionExists.cmake +++ b/Modules/CheckFunctionExists.cmake @@ -95,7 +95,7 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}" - OUTPUT_VARIABLE OUTPUT) + ) unset(_cfe_source) if(${VARIABLE}) @@ -103,17 +103,11 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_PASS "found") endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the function ${FUNCTION} exists passed with the following output:\n" - "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the function ${FUNCTION} exists failed with the following output:\n" - "${OUTPUT}\n\n") endif() endif() endmacro() diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake index 9108e34..de682b7 100644 --- a/Modules/CheckIPOSupported.cmake +++ b/Modules/CheckIPOSupported.cmake @@ -150,9 +150,6 @@ macro(_ipo_run_language_check language) unset(_IPO_LANGUAGE_CHECK_RESULT CACHE) if(NOT _IPO_LANGUAGE_CHECK_RESULT) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "${language} compiler IPO check failed with the following output:\n" - "${output}\n") _ipo_not_supported("check failed to compile") if(X_OUTPUT) set("${X_OUTPUT}" "${output}" PARENT_SCOPE) diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake index 4cba91b..5771307 100644 --- a/Modules/CheckIncludeFile.cmake +++ b/Modules/CheckIncludeFile.cmake @@ -100,7 +100,7 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS} "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}" - OUTPUT_VARIABLE OUTPUT) + ) unset(_CIF_LINK_OPTIONS) unset(_CIF_LINK_LIBRARIES) @@ -113,19 +113,11 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE) message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the include file ${INCLUDE} " - "exists passed with the following output:\n" - "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the include file ${INCLUDE} " - "exists failed with the following output:\n" - "${OUTPUT}\n\n") endif() endif() endmacro() diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake index f6af036..d27b485 100644 --- a/Modules/CheckIncludeFileCXX.cmake +++ b/Modules/CheckIncludeFileCXX.cmake @@ -99,7 +99,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS} "${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}" - OUTPUT_VARIABLE OUTPUT) + ) unset(_CIF_LINK_OPTIONS) unset(_CIF_LINK_LIBRARIES) @@ -112,19 +112,11 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the include file ${INCLUDE} " - "exists passed with the following output:\n" - "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the include file ${INCLUDE} " - "exists failed with the following output:\n" - "${OUTPUT}\n\n") endif() endif() endmacro() diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake index 8fc6921..2f50c61 100644 --- a/Modules/CheckIncludeFiles.cmake +++ b/Modules/CheckIncludeFiles.cmake @@ -142,7 +142,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS} "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}" - OUTPUT_VARIABLE OUTPUT) + ) unset(_CIF_LINK_OPTIONS) unset(_CIF_LINK_LIBRARIES) if(${VARIABLE}) @@ -150,19 +150,11 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if files ${INCLUDE} " - "exist passed with the following output:\n" - "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if files ${INCLUDE} " - "exist failed with the following output:\n" - "${OUTPUT}\nSource:\n${_src_content}\n") endif() endif() endmacro() diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index 52f707c..2e56a19 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -90,14 +90,14 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" ) include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/result.cmake OPTIONAL) if(CMAKE_${lang}_COMPILER AND "${_cl_result}" STREQUAL "0") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "${_desc} passed with the following output:\n" "${_cl_output}\n") set(_CHECK_COMPILER_STATUS CHECK_PASS) else() set(CMAKE_${lang}_COMPILER NOTFOUND) set(_CHECK_COMPILER_STATUS CHECK_FAIL) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "${_desc} failed with the following output:\n" "${_cl_output}\n") endif() diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake index 56424ac..5f1a914 100644 --- a/Modules/CheckLibraryExists.cmake +++ b/Modules/CheckLibraryExists.cmake @@ -76,7 +76,7 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION} -DLINK_DIRECTORIES:STRING=${LOCATION} - OUTPUT_VARIABLE OUTPUT) + ) unset(_cle_source) if(${VARIABLE}) @@ -84,19 +84,11 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the function ${FUNCTION} exists in the ${LIBRARY} " - "passed with the following output:\n" - "${OUTPUT}\n\n") else() if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the function ${FUNCTION} exists in the ${LIBRARY} " - "failed with the following output:\n" - "${OUTPUT}\n\n") endif() endif() endmacro() diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake index 12f4e86..3d53b93 100644 --- a/Modules/CheckPrototypeDefinition.cmake +++ b/Modules/CheckPrototypeDefinition.cmake @@ -104,24 +104,18 @@ function(check_prototype_definition _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB ${CHECK_PROTOTYPE_DEFINITION_LIBS} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS} "${CMAKE_SYMBOL_EXISTS_INCLUDES}" - OUTPUT_VARIABLE OUTPUT) + ) if (${_VARIABLE}) set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_PASS "True") endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n" - "${OUTPUT}\n\n") else () if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "False") endif() set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} failed with the following output:\n" - "${OUTPUT}\n\n${_SOURCE}\n\n") endif () endif() diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake index 722d50f..c4a1574 100644 --- a/Modules/CheckSymbolExists.cmake +++ b/Modules/CheckSymbolExists.cmake @@ -150,27 +150,17 @@ int main(int argc, char** argv) CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_SYMBOL_EXISTS_FLAGS} "${CMAKE_SYMBOL_EXISTS_INCLUDES}" - OUTPUT_VARIABLE OUTPUT) + ) if(${VARIABLE}) if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_PASS "found") endif() set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the ${SYMBOL} " - "exist passed with the following output:\n" - "${OUTPUT}\nFile ${SOURCEFILE}:\n" - "${_CSE_SOURCE}\n") else() if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "not found") endif() set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the ${SYMBOL} " - "exist failed with the following output:\n" - "${OUTPUT}\nFile ${SOURCEFILE}:\n" - "${_CSE_SOURCE}\n") endif() unset(_CSE_SOURCE) endif() diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index e09b7c8..579d189 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -152,7 +152,6 @@ function(__check_type_size_impl type var map builtin language) CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}" "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}" - OUTPUT_VARIABLE output COPY_FILE ${bin} ) @@ -203,16 +202,12 @@ function(__check_type_size_impl type var map builtin language) if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_PASS "done") endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining size of ${type} passed with the following output:\n${output}\n\n") set(${var} "${${var}}" CACHE INTERNAL "CHECK_TYPE_SIZE: sizeof(${type})") else() # The check failed to compile. if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "failed") endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining size of ${type} failed with the following output:\n${output}\n${src}:\n${src_content}\n\n") set(${var} "" CACHE INTERNAL "CHECK_TYPE_SIZE: ${type} unknown") file(REMOVE ${map}) endif() diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake index 5dc3441..3a7a431 100644 --- a/Modules/CheckVariableExists.cmake +++ b/Modules/CheckVariableExists.cmake @@ -67,23 +67,17 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE) ${CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS} ${CHECK_VARIABLE_EXISTS_ADD_LIBRARIES} CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_VARIABLE_DEFINITIONS} - OUTPUT_VARIABLE OUTPUT) + ) if(${VARIABLE}) set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_PASS "found") endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the variable ${VAR} exists passed with the following output:\n" - "${OUTPUT}\n\n") else() set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}") if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "not found") endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the variable ${VAR} exists failed with the following output:\n" - "${OUTPUT}\n\n") endif() endif() endmacro() diff --git a/Modules/Compiler/IntelLLVM-C.cmake b/Modules/Compiler/IntelLLVM-C.cmake index d7346f6..3a81154 100644 --- a/Modules/Compiler/IntelLLVM-C.cmake +++ b/Modules/Compiler/IntelLLVM-C.cmake @@ -41,6 +41,9 @@ if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17") set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17") + + set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x") + set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x") else() # clang-cl doesn't have any of these set(CMAKE_C90_STANDARD_COMPILE_OPTION "") @@ -54,6 +57,9 @@ else() set(CMAKE_C17_STANDARD_COMPILE_OPTION "") set(CMAKE_C17_EXTENSION_COMPILE_OPTION "") + + set(CMAKE_C23_STANDARD_COMPILE_OPTION "") + set(CMAKE_C23_EXTENSION_COMPILE_OPTION "") endif() __compiler_check_default_language_standard(C 2020 17) diff --git a/Modules/Compiler/IntelLLVM-CXX.cmake b/Modules/Compiler/IntelLLVM-CXX.cmake index 4d3f5a1..45b723f 100644 --- a/Modules/Compiler/IntelLLVM-CXX.cmake +++ b/Modules/Compiler/IntelLLVM-CXX.cmake @@ -46,6 +46,9 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20") set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20") + + set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-std=c++2b") + set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-std=gnu++2b") else() set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") @@ -53,14 +56,17 @@ else() set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "") - set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd=c++14") - set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd=c++14") + set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd:c++14") + set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd:c++14") + + set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd:c++17") + set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd:c++17") - set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd=c++17") - set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd=c++17") + set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Qstd:c++20") + set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-Qstd:c++20") - set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Qstd=c++20") - set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-Qstd=c++20") + set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "-Qstd:c++2b") + set(CMAKE_CXX23_EXTENSION_COMPILE_OPTION "-Qstd:c++2b") endif() __compiler_check_default_language_standard(CXX 2020 14) diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake index a65fd2c..b946cfd 100644 --- a/Modules/Compiler/NAG-Fortran.cmake +++ b/Modules/Compiler/NAG-Fortran.cmake @@ -14,7 +14,7 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED) string(REGEX REPLACE "/[^/]*$" "" _nag_dir "${_nag_obj}") string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" _nag_regex "${_nag_dir}") set(CMAKE_Fortran_IMPLICIT_OBJECT_REGEX "^${_nag_regex}/") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Detecting NAG Fortran directory with -dryrun found\n" " object: ${_nag_obj}\n" " directory: ${_nag_dir}\n" @@ -22,7 +22,7 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED) "from output:\n${_dryrun}\n\n") message(CHECK_PASS "${_nag_dir}") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Detecting NAG Fortran directory with -dryrun failed:\n${_dryrun}\n\n") message(CHECK_FAIL "failed") endif() diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index d621195..cd44cc6 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -380,6 +380,12 @@ Targets Created: - ``CUDA::nvrtc`` +.. versionadded:: 3.26 + + - ``CUDA::nvrtc_builtins`` + - ``CUDA::nvrtc_static`` starting in CUDA 11.5 + - ``CUDA::nvrtc_builtins_static`` starting in CUDA 11.5 + .. _`cuda_toolkit_nvjitlink`: nvJitLink @@ -1099,7 +1105,6 @@ if(CUDAToolkit_FOUND) EXTRA_INCLUDE_DIRS "${CUDAToolkit_CUPTI_INCLUDE_DIR}") endif() - _CUDAToolkit_find_and_add_import_lib(nvrtc DEPS cuda_driver) 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) @@ -1114,6 +1119,13 @@ if(CUDAToolkit_FOUND) _CUDAToolkit_find_and_add_import_lib(nvJitLink_static DEPS cuda_driver) endif() + _CUDAToolkit_find_and_add_import_lib(nvrtc_builtins DEPS cuda_driver) + _CUDAToolkit_find_and_add_import_lib(nvrtc DEPS nvrtc_builtins nvJitLink) + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.5.0) + _CUDAToolkit_find_and_add_import_lib(nvrtc_builtins_static DEPS cuda_driver) + _CUDAToolkit_find_and_add_import_lib(nvrtc_static DEPS nvrtc_builtins_static nvptxcompiler_static nvJitLink_static) + endif() + _CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml) if(WIN32) diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake index c298bab..1b3929b 100644 --- a/Modules/FindLibLZMA.cmake +++ b/Modules/FindLibLZMA.cmake @@ -117,7 +117,7 @@ if (LIBLZMA_FOUND) if(NOT TARGET LibLZMA::LibLZMA) add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED) set_target_properties(LibLZMA::LibLZMA PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${LIBLZMA_INCLUDE_DIR} + INTERFACE_INCLUDE_DIRECTORIES "${LIBLZMA_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES C) if(LIBLZMA_LIBRARY_RELEASE) diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake index 2d5de89..38259c3 100644 --- a/Modules/FindMFC.cmake +++ b/Modules/FindMFC.cmake @@ -49,15 +49,9 @@ if(MFC_ATTEMPT_TRY_COMPILE) if(MFC_HAVE_MFC) message(CHECK_PASS "found") set(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if MFC exists passed with the following output:\n" - "${OUTPUT}\n\n") else() message(CHECK_FAIL "not found") set(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if MFC exists failed with the following output:\n" - "${OUTPUT}\n\n") endif() endif() diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index e15be91..1fbb4f9 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -1259,9 +1259,16 @@ function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY SUPPRE file(READ "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" MPI_TEST_SOURCE_CONTENT) set(MPI_TEST_SOURCE_FILE "${MPI_TEST_FILE_NAME}.c") endif() + if(SUPPRESS_ERRORS) + set(maybe_no_log NO_LOG) + else() + set(maybe_no_log "") + endif() if(RUN_BINARY) try_run(MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} SOURCE_FROM_VAR "${MPI_TEST_SOURCE_FILE}" MPI_TEST_SOURCE_CONTENT + ${maybe_no_log} + LOG_DESCRIPTION "The MPI test ${MPI_TEST_FILE_NAME} for ${LANG} in mode ${MODE}" COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} LINK_LIBRARIES MPI::MPI_${LANG} RUN_OUTPUT_VARIABLE MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} @@ -1270,20 +1277,13 @@ function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY SUPPRE else() try_compile(MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} SOURCE_FROM_VAR "${MPI_TEST_SOURCE_FILE}" MPI_TEST_SOURCE_CONTENT + ${maybe_no_log} + LOG_DESCRIPTION "The MPI test ${MPI_TEST_FILE_NAME} for ${LANG} in mode ${MODE}" COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} LINK_LIBRARIES MPI::MPI_${LANG} COPY_FILE "${BIN_FILE}" OUTPUT_VARIABLE _MPI_TRY_${MPI_TEST_FILE_NAME}_${MODE}_OUTPUT) endif() - if(NOT SUPPRESS_ERRORS) - if(NOT MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "The MPI test ${MPI_TEST_FILE_NAME} for ${LANG} in mode ${MODE} failed to compile with the following output:\n${_MPI_TRY_${MPI_TEST_FILE_NAME}_${MODE}_OUTPUT}\n\n") - elseif(DEFINED MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} AND MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "The MPI test ${MPI_TEST_FILE_NAME} for ${LANG} in mode ${MODE} failed to run with the following output:\n${MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}}\n\n") - endif() - endif() endfunction() macro(_MPI_check_lang_works LANG SUPPRESS_ERRORS) diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index 9e24925..4aa7d91 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -214,6 +214,7 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}") try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT + LOG_DESCRIPTION "Detecting ${LANG} OpenMP compiler info" CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}" LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT @@ -228,9 +229,6 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) unset(OpenMP_${LANG}_IMPLICIT_FWK_DIRS) unset(OpenMP_${LANG}_LOG_VAR) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Detecting ${LANG} OpenMP compiler ABI info compiled with the following output:\n${OpenMP_TRY_COMPILE_OUTPUT}\n\n") - cmake_parse_implicit_link_info("${OpenMP_TRY_COMPILE_OUTPUT}" OpenMP_${LANG}_IMPLICIT_LIBRARIES OpenMP_${LANG}_IMPLICIT_LINK_DIRS @@ -240,9 +238,6 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) LANGUAGE ${LANG} ) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed ${LANG} OpenMP implicit link information from above output:\n${OpenMP_${LANG}_LOG_VAR}\n\n") - # For LCC we should additionally alanyze -print-search-dirs output # to check for additional implicit_dirs. # Note: This won't work if CMP0129 policy is set to OLD! @@ -255,11 +250,14 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) if("${output_lines}" MATCHES ".*\nlibraries:[ \t]+(.*:)\n.*") string(REPLACE ":" ";" implicit_dirs_addon "${CMAKE_MATCH_1}") list(PREPEND OpenMP_${LANG}_IMPLICIT_LINK_DIRS ${implicit_dirs_addon}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + string(APPEND OpenMP_${LANG}_LOG_VAR " Extended OpenMP library search paths: [${implicit_dirs}]\n") endif() endif() + message(CONFIGURE_LOG + "Parsed ${LANG} OpenMP implicit link information from above output:\n${OpenMP_${LANG}_LOG_VAR}\n\n") + unset(_OPENMP_LIB_NAMES) foreach(_OPENMP_IMPLICIT_LIB IN LISTS OpenMP_${LANG}_IMPLICIT_LIBRARIES) get_filename_component(_OPENMP_IMPLICIT_LIB_DIR "${_OPENMP_IMPLICIT_LIB}" DIRECTORY) @@ -312,9 +310,9 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) # default header search path already. try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT + LOG_DESCRIPTION "Trying ${LANG} OpenMP compiler with '${OpenMP_libomp_LIBRARY}'" CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}" LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} ${OpenMP_libomp_LIBRARY} - OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT ) if(NOT OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}) find_path(OpenMP_${LANG}_INCLUDE_DIR omp.h) @@ -323,10 +321,10 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) if(OpenMP_${LANG}_INCLUDE_DIR) try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT + LOG_DESCRIPTION "Trying ${LANG} OpenMP compiler with '${OpenMP_libomp_LIBRARY}' and '${OpenMP_${LANG}_INCLUDE_DIR}'" CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}" "-DINCLUDE_DIRECTORIES:STRING=${OpenMP_${LANG}_INCLUDE_DIR}" LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} ${OpenMP_libomp_LIBRARY} - OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT ) endif() endif() @@ -346,9 +344,9 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) if(OpenMP_libomp_LIBRARY) try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT + LOG_DESCRIPTION "Trying ${LANG} OpenMP compiler with '${OpenMP_libomp_LIBRARY}'" CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}" LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} ${OpenMP_libomp_LIBRARY} - OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT ) if(OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}) set("${OPENMP_FLAG_VAR}" "${OPENMP_FLAG}" PARENT_SCOPE) @@ -356,9 +354,6 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) break() endif() endif() - else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Detecting ${LANG} OpenMP failed with the following output:\n${OpenMP_TRY_COMPILE_OUTPUT}\n\n") endif() set("${OPENMP_LIB_NAMES_VAR}" "NOTFOUND" PARENT_SCOPE) set("${OPENMP_FLAG_VAR}" "NOTFOUND" PARENT_SCOPE) @@ -419,9 +414,10 @@ function(_OPENMP_GET_SPEC_DATE LANG SPEC_DATE) string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}") try_compile(OpenMP_SPECTEST_${LANG}_${OPENMP_PLAIN_FLAG} SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT + LOG_DESCRIPTION "Detecting ${LANG} OpenMP version" CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OpenMP_${LANG}_FLAGS}" ${_includeDirFlags} COPY_FILE "${BIN_FILE}" - OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT) + ) if(${OpenMP_SPECTEST_${LANG}_${OPENMP_PLAIN_FLAG}}) file(STRINGS ${BIN_FILE} specstr LIMIT_COUNT 1 REGEX "INFO:OpenMP-date") @@ -429,9 +425,6 @@ function(_OPENMP_GET_SPEC_DATE LANG SPEC_DATE) if("${specstr}" MATCHES "${regex_spec_date}") set(${SPEC_DATE} "${CMAKE_MATCH_1}" PARENT_SCOPE) endif() - else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Detecting ${LANG} OpenMP version failed with the following output:\n${OpenMP_TRY_COMPILE_OUTPUT}\n\n") endif() endfunction() diff --git a/Modules/FindOpenSP.cmake b/Modules/FindOpenSP.cmake index 655dd65..25d0e6f 100644 --- a/Modules/FindOpenSP.cmake +++ b/Modules/FindOpenSP.cmake @@ -63,24 +63,17 @@ The following cache variables may also be set: #]=======================================================================] -if (NOT OpenSP_INCLUDE_DIR AND NOT OpenSP_LIBRARY) - find_package(PkgConfig) - if (PkgConfig_FOUND) - pkg_check_modules(OpenSP IMPORTED_TARGET GLOBAL opensp) - - if (OpenSP_FOUND) - add_library(OpenSP::OpenSP INTERFACE IMPORTED) - target_link_libraries(OpenSP::OpenSP INTERFACE PkgConfig::OpenSP) - - set(OpenSP_INCLUDE_DIR ${OpenSP_INCLUDE_DIRS}) - set(OpenSP_LIBRARY ${OpenSP_LIBRARIES}) - endif () - endif () +find_package(PkgConfig QUIET) +if (PkgConfig_FOUND) + pkg_check_modules(PC_OpenSP QUIET opensp) endif () if (NOT OpenSP_INCLUDE_DIR) find_path(OpenSP_INCLUDE_DIR NAMES ParserEventGeneratorKit.h + HINTS + ${PC_OpenSP_INCLUDEDIRS} + ${PC_OpenSP_INCLUDE_DIRS} PATH_SUFFIXES OpenSP opensp DOC "The OpenSP include directory" ) @@ -89,17 +82,23 @@ endif () if (NOT OpenSP_LIBRARY) find_library(OpenSP_LIBRARY_RELEASE NAMES osp libosp opensp libopensp sp133 libsp + HINTS + ${PC_OpenSP_LIBDIR} + ${PC_OpenSP_LIBRARY_DIRS} ) find_library(OpenSP_LIBRARY_DEBUG NAMES ospd libospd openspd libopenspd sp133d libspd + HINTS + ${PC_OpenSP_LIBDIR} + ${PC_OpenSP_LIBRARY_DIRS} ) include(SelectLibraryConfigurations) select_library_configurations(OpenSP) endif () -if (OpenSP_INCLUDE_DIR AND OpenSP_LIBRARY) +if (OpenSP_INCLUDE_DIR) if (EXISTS "${OpenSP_INCLUDE_DIR}/config.h") if (NOT OpenSP_VERSION) file(STRINGS "${OpenSP_INCLUDE_DIR}/config.h" opensp_version_str REGEX "^#define[\t ]+SP_VERSION[\t ]+\".*\"") @@ -116,38 +115,44 @@ if (OpenSP_INCLUDE_DIR AND OpenSP_LIBRARY) include(CheckCXXSymbolExists) check_cxx_symbol_exists(SP_MULTI_BYTE "${OpenSP_INCLUDE_DIR}/config.h" OpenSP_MULTI_BYTE) endif () +endif () - if (NOT TARGET OpenSP::OpenSP) - set(OpenSP_INCLUDE_DIRS ${OpenSP_INCLUDE_DIR}) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenSP + FOUND_VAR OpenSP_FOUND + REQUIRED_VARS OpenSP_LIBRARY OpenSP_INCLUDE_DIR + VERSION_VAR OpenSP_VERSION + ) + +mark_as_advanced(OpenSP_INCLUDE_DIR OpenSP_LIBRARY OpenSP_MULTI_BYTE) +if (OpenSP_FOUND) + set(OpenSP_INCLUDE_DIRS ${OpenSP_INCLUDE_DIR}) + if (NOT TARGET OpenSP::OpenSP) add_library(OpenSP::OpenSP UNKNOWN IMPORTED) - set_target_properties(OpenSP::OpenSP PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${OpenSP_INCLUDE_DIRS}") + if (EXISTS "${OpenSP_LIBRARY}") + set_target_properties(OpenSP::OpenSP PROPERTIES + IMPORTED_LOCATION "${OpenSP_LIBRARY}") + endif () + set_target_properties(OpenSP::OpenSP PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OpenSP_INCLUDE_DIRS}") if (OpenSP_LIBRARY_RELEASE) - set_target_properties(OpenSP::OpenSP PROPERTIES IMPORTED_LOCATION_RELEASE "${OpenSP_LIBRARY_RELEASE}") - set_property(TARGET OpenSP::OpenSP APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(OpenSP::OpenSP PROPERTIES + IMPORTED_LOCATION_RELEASE "${OpenSP_LIBRARY_RELEASE}") + set_property(TARGET OpenSP::OpenSP APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) endif () if (OpenSP_LIBRARY_DEBUG) - set_target_properties(OpenSP::OpenSP PROPERTIES IMPORTED_LOCATION_DEBUG "${OpenSP_LIBRARY_DEBUG}") - set_property(TARGET OpenSP::OpenSP APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - endif () - - if (NOT OpenSP_LIBRARY_RELEASE AND NOT OpenSP_LIBRARY_DEBUG) - set_property(TARGET OpenSP::OpenSP APPEND PROPERTY IMPORTED_LOCATION "${OpenSP_LIBRARY}") + set_target_properties(OpenSP::OpenSP PROPERTIES + IMPORTED_LOCATION_DEBUG "${OpenSP_LIBRARY_DEBUG}") + set_property(TARGET OpenSP::OpenSP APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) endif () endif () endif () -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(OpenSP - FOUND_VAR OpenSP_FOUND - REQUIRED_VARS OpenSP_LIBRARY OpenSP_INCLUDE_DIR - VERSION_VAR OpenSP_VERSION - ) - -mark_as_advanced(OpenSP_INCLUDE_DIR OpenSP_LIBRARY OpenSP_MULTI_BYTE) - include(FeatureSummary) set_package_properties(OpenSP PROPERTIES URL "http://openjade.sourceforge.net/doc/index.htm" diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index ec0f453..3154ad3 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -623,7 +623,7 @@ if (QT_QMAKE_EXECUTABLE AND endif() set(Qt4_FOUND FALSE) if(Qt4_FIND_REQUIRED) - message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") + message( FATAL_ERROR "Could NOT find QtCore.") else() return() endif() diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 7326ef9..701c143 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -136,10 +136,8 @@ macro(_threads_check_flag_pthread) try_compile(THREADS_HAVE_PTHREAD_ARG SOURCE_FROM_FILE "${_threads_src}" "${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c" CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread - OUTPUT_VARIABLE _cmake_check_pthreads_output) + ) - string(APPEND _cmake_find_threads_output "${_cmake_check_pthreads_output}") - unset(_cmake_check_pthreads_output) unset(_threads_src) if(THREADS_HAVE_PTHREAD_ARG) @@ -239,10 +237,4 @@ if(THREADS_FOUND AND NOT TARGET Threads::Threads) if(CMAKE_THREAD_LIBS_INIT) set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") endif() -elseif(NOT THREADS_FOUND AND _cmake_find_threads_output) - file(APPEND - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if compiler accepts -pthread failed with the following output:\n${_cmake_find_threads_output}\n\n") endif() - -unset(_cmake_find_threads_output) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 19eba95..3159ff7 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -615,7 +615,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") set(wxWidgets_INCLUDE_DIRS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}) else() - DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.") + DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exist.") set(wxWidgets_FOUND FALSE) endif() diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake index af025af..ed8830e 100644 --- a/Modules/FortranCInterface.cmake +++ b/Modules/FortranCInterface.cmake @@ -381,13 +381,9 @@ function(FortranCInterface_VERIFY) # Report results. if(FortranCInterface_VERIFY_${lang}_COMPILED) message(CHECK_PASS "Success") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "${_desc} passed with the following output:\n${_output}\n\n") set(FortranCInterface_VERIFIED_${lang} 1 CACHE INTERNAL "Fortran/${lang} compatibility") else() message(CHECK_FAIL "Failed") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "${_desc} failed with the following output:\n${_output}\n\n") set(FortranCInterface_VERIFIED_${lang} 0 CACHE INTERNAL "Fortran/${lang} compatibility") endif() unset(FortranCInterface_VERIFY_${lang}_COMPILED CACHE) diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake index 6401aed..010661e 100644 --- a/Modules/FortranCInterface/Detect.cmake +++ b/Modules/FortranCInterface/Detect.cmake @@ -51,6 +51,7 @@ try_compile(FortranCInterface_COMPILED TARGET FortranCInterface SOURCE_DIR ${FortranCInterface_SOURCE_DIR} BINARY_DIR ${FortranCInterface_BINARY_DIR} + LOG_DESCRIPTION "Fortran/C interface test project" CMAKE_FLAGS "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}" "-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}" @@ -58,7 +59,7 @@ try_compile(FortranCInterface_COMPILED "-DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}" ${_FortranCInterface_OSX_ARCH} ${_FortranCInterface_EXE_LINKER_FLAGS} - OUTPUT_VARIABLE FortranCInterface_OUTPUT) + ) set(FortranCInterface_COMPILED ${FortranCInterface_COMPILED}) unset(FortranCInterface_COMPILED CACHE) unset(_FortranCInterface_EXE_LINKER_FLAGS) @@ -70,9 +71,6 @@ if(FortranCInterface_COMPILED) include(${FortranCInterface_BINARY_DIR}/exe-Release.cmake OPTIONAL) else() set(_result "Failed to compile") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Fortran/C interface test project failed with the following output:\n" - "${FortranCInterface_OUTPUT}\n") endif() # Load symbols from INFO:symbol[] strings in the executable. diff --git a/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake index d6fa5f0..b671b4a 100644 --- a/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake +++ b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake @@ -51,7 +51,7 @@ function(CMAKE_TRY_COMPILER_OR_LINKER_FLAG lang flag result) if (NOT lang MATCHES "^(C|CXX|Fortran|ASM)$") # other possible languages are not supported # log message to keep trace of this problem... - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Function 'CMAKE_CHECK_COMPILER_FLAG' called with unsupported language: ${lang}\n") set(${result} FALSE CACHE INTERNAL ${comment}) return() @@ -144,7 +144,7 @@ function(CMAKE_TRY_COMPILER_OR_LINKER_FLAG lang flag result) endforeach() endif() if (DEFINED ${result}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Determining if the ${flag} option " "is supported for ${lang} language failed with the following output:\n" "${COMPILER_FLAG_OUTPUT}\n") diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake index 7c10280..8ac1f6b 100644 --- a/Modules/Internal/CPack/CPackRPM.cmake +++ b/Modules/Internal/CPack/CPackRPM.cmake @@ -1200,7 +1200,7 @@ function(cpack_rpm_generate_package) file(READ ${CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE} "CPACK_RPM_SPEC_${RPM_SCRIPT_FILE_TIME_}${RPM_SCRIPT_FILE_TYPE_}") else() - message("CPackRPM:Warning: CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_SCRIPT_FILE <${CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE}> does not exists - ignoring") + message("CPackRPM:Warning: CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_SCRIPT_FILE <${CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE}> does not exist - ignoring") endif() else() # reset SPEC var value if no file has been specified @@ -1217,7 +1217,7 @@ function(cpack_rpm_generate_package) if(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG) else() - message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring") + message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exist - ignoring") endif() else() set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Eric Noulard <eric.noulard@gmail.com> - ${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}\n Generated by CPack RPM (no Changelog file were provided)") diff --git a/Modules/Internal/CheckSourceCompiles.cmake b/Modules/Internal/CheckSourceCompiles.cmake index bf5a82d..83d7020 100644 --- a/Modules/Internal/CheckSourceCompiles.cmake +++ b/Modules/Internal/CheckSourceCompiles.cmake @@ -122,19 +122,11 @@ function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var) if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_PASS "Success") endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing ${_lang_textual} SOURCE FILE Test ${_var} succeeded with the following output:\n" - "${OUTPUT}\n" - "Source file was:\n${_source}\n") else() if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "Failed") endif() set(${_var} "" CACHE INTERNAL "Test ${_var}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Performing ${_lang_textual} SOURCE FILE Test ${_var} failed with the following output:\n" - "${OUTPUT}\n" - "Source file was:\n${_source}\n") endif() endif() endfunction() diff --git a/Modules/Internal/CheckSourceRuns.cmake b/Modules/Internal/CheckSourceRuns.cmake index 09c85c5..805d98d 100644 --- a/Modules/Internal/CheckSourceRuns.cmake +++ b/Modules/Internal/CheckSourceRuns.cmake @@ -98,8 +98,7 @@ function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var) CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} "${CHECK_${_lang}_SOURCE_COMPILES_ADD_INCLUDES}" - COMPILE_OUTPUT_VARIABLE OUTPUT - RUN_OUTPUT_VARIABLE RUN_OUTPUT) + ) # if it did not compile make the return value fail code of 1 if(NOT ${_var}_COMPILED) set(${_var}_EXITCODE 1) @@ -111,13 +110,6 @@ function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var) if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_PASS "Success") endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing ${_lang_textual} SOURCE FILE Test ${_var} succeeded with the following compile output:\n" - "${OUTPUT}\n" - "...and run output:\n" - "${RUN_OUTPUT}\n" - "Return value: ${${_var}}\n" - "Source file was:\n${_source}\n") else() if(CMAKE_CROSSCOMPILING AND "${${_var}_EXITCODE}" MATCHES "FAILED_TO_RUN") set(${_var} "${${_var}_EXITCODE}" PARENT_SCOPE) @@ -128,14 +120,6 @@ function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var) if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_FAIL "Failed") endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Performing ${_lang_textual} SOURCE FILE Test ${_var} failed with the following compile output:\n" - "${OUTPUT}\n" - "...and run output:\n" - "${RUN_OUTPUT}\n" - "Return value: ${${_var}_EXITCODE}\n" - "Source file was:\n${_source}\n") - endif() endif() endfunction() diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake index 5c144ec..1a8a27e 100644 --- a/Modules/Internal/FeatureTesting.cmake +++ b/Modules/Internal/FeatureTesting.cmake @@ -35,27 +35,25 @@ macro(_record_compiler_features lang compile_flags feature_list) SOURCE_FROM_VAR "feature_tests.${lang_lc}" _content COMPILE_DEFINITIONS "${compile_flags}" LINK_LIBRARIES "${compile_flags_for_link}" - OUTPUT_VARIABLE _output COPY_FILE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin" COPY_FILE_ERROR _copy_error ) - if(CMAKE_${lang}_FEATURE_TEST AND NOT _copy_error) - set(_result 0) - else() + if(NOT CMAKE_${lang}_FEATURE_TEST) + set(_result 255) + elseif(_copy_error) set(_result 255) + message(WARNING "${_copy_error}") + else() + set(_result 0) endif() unset(CMAKE_${lang}_FEATURE_TEST CACHE) unset(compile_flags_for_link) if (_result EQUAL 0) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "\n\nDetecting ${lang} [${compile_flags}] compiler features compiled with the following output:\n${_output}\n\n") if(EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin") file(STRINGS "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin" features REGEX "${lang}_FEATURE:.*") foreach(info ${features}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - " Feature record: ${info}\n") string(REPLACE "${lang}_FEATURE:" "" info ${info}) string(SUBSTRING ${info} 0 1 has_feature) if(has_feature) @@ -64,9 +62,6 @@ macro(_record_compiler_features lang compile_flags feature_list) endif() endforeach() endif() - else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Detecting ${lang} [${compile_flags}] compiler features failed to compile with the following output:\n${_output}\n${_copy_error}\n\n") endif() endmacro() diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index a4e9574..715f68b 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -70,7 +70,7 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio") endif() endif() if(VCXPROJ_INSPECT_RESULT) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Determining the sysroot for the Android NDK failed. The output was: ${VCXPROJ_INSPECT_RESULT} @@ -78,7 +78,7 @@ ${VCXPROJ_INSPECT_OUTPUT} ") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Determining the sysroot for the Android NDK succeeded. The output was: ${VCXPROJ_INSPECT_RESULT} diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake index fc4ea2e..0b64496 100644 --- a/Modules/Platform/CYGWIN.cmake +++ b/Modules/Platform/CYGWIN.cmake @@ -1,48 +1,3 @@ -if("${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS "2.8.3.20101214" AND NOT MSYS) - set(__USE_CMAKE_LEGACY_CYGWIN_WIN32 1) -endif() -if(NOT DEFINED WIN32 AND NOT MSYS) - set(WIN32 0) - if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32) - if(NOT DEFINED CMAKE_LEGACY_CYGWIN_WIN32 - AND DEFINED ENV{CMAKE_LEGACY_CYGWIN_WIN32}) - set(CMAKE_LEGACY_CYGWIN_WIN32 $ENV{CMAKE_LEGACY_CYGWIN_WIN32}) - endif() - if(CMAKE_LEGACY_CYGWIN_WIN32) - message(STATUS "Defining WIN32 under Cygwin due to CMAKE_LEGACY_CYGWIN_WIN32") - set(WIN32 1) - elseif("x${CMAKE_LEGACY_CYGWIN_WIN32}" STREQUAL "x") - message(WARNING "CMake no longer defines WIN32 on Cygwin!" - "\n" - "(1) If you are just trying to build this project, ignore this warning " - "or quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or " - "in the CMake cache. " - "If later configuration or build errors occur then this project may " - "have been written under the assumption that Cygwin is WIN32. " - "In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead." - "\n" - "(2) If you are developing this project, add the line\n" - " set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required\n" - "at the top of your top-level CMakeLists.txt file or set the minimum " - "required version of CMake to 2.8.4 or higher. " - "Then teach your project to build on Cygwin without WIN32.") - endif() - elseif(DEFINED CMAKE_LEGACY_CYGWIN_WIN32) - message(AUTHOR_WARNING "CMAKE_LEGACY_CYGWIN_WIN32 ignored because\n" - " cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})\n" - "is at least 2.8.4.") - endif() -endif() -if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32) - # Pass WIN32 legacy setting to scripts. - if(WIN32) - set(ENV{CMAKE_LEGACY_CYGWIN_WIN32} 1) - else() - set(ENV{CMAKE_LEGACY_CYGWIN_WIN32} 0) - endif() - unset(__USE_CMAKE_LEGACY_CYGWIN_WIN32) -endif() - set(CYGWIN 1) set(CMAKE_SHARED_LIBRARY_PREFIX "cyg") diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake index bda23ab..47e266d 100644 --- a/Modules/ProcessorCount.cmake +++ b/Modules/ProcessorCount.cmake @@ -22,9 +22,17 @@ This function is guaranteed to return a positive integer (>=1) if it succeeds. It returns 0 if there's a problem determining the processor count. +More generally accurate physical CPU count can be obtained via +:command:`cmake_host_system_information`: + +.. code-block:: cmake + + cmake_host_system_information(RESULT N + QUERY NUMBER_OF_PHYSICAL_CORES) + Example use, in a ctest -S dashboard script: -:: +.. code-block:: cmake include(ProcessorCount) ProcessorCount(N) @@ -33,8 +41,6 @@ Example use, in a ctest -S dashboard script: set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) endif() - - This function is intended to offer an approximation of the value of the number of compute cores available on the current machine, such that you may use that value for parallel building and parallel diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake index 5ecc39a..97f3856 100644 --- a/Modules/SystemInformation.cmake +++ b/Modules/SystemInformation.cmake @@ -5,8 +5,8 @@ cmake_minimum_required(VERSION ${CMAKE_VERSION}) project(DumpInformation) -# first get the standard information for th platform -include_directories("This does not exists") +# first get the standard information for the platform +include_directories("This does not exist") get_directory_property(incl INCLUDE_DIRECTORIES) set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${DumpInformation_BINARY_DIR};${DumpInformation_SOURCE_DIR}") @@ -83,8 +83,6 @@ macro(DUMP_FILE THE_FILE) endmacro() DUMP_FILE("../CMakeCache.txt") -DUMP_FILE("../CMakeFiles/CMakeOutput.log") -DUMP_FILE("../CMakeFiles/CMakeError.log") DUMP_FILE("../CMakeFiles/CMakeSystem.cmake") foreach (EXTRA_FILE ${EXTRA_DUMP_FILES}) diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake index 096c90c..12b6816 100644 --- a/Modules/TestBigEndian.cmake +++ b/Modules/TestBigEndian.cmake @@ -87,7 +87,6 @@ macro(__TEST_BIG_ENDIAN_LEGACY_IMPL VARIABLE) try_compile(HAVE_${VARIABLE} SOURCE_FROM_VAR "${_test_file}" TEST_ENDIANESS_FILE_CONTENT - OUTPUT_VARIABLE OUTPUT COPY_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestEndianess.bin" ) if(HAVE_${VARIABLE}) @@ -125,14 +124,8 @@ macro(__TEST_BIG_ENDIAN_LEGACY_IMPL VARIABLE) message(CHECK_FAIL "TEST_BIG_ENDIAN found no result!") message(SEND_ERROR "TEST_BIG_ENDIAN found no result!") endif() - - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the system is big endian passed with the following output:\n${OUTPUT}\n${_test_file}:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n") - else() message(CHECK_FAIL "failed") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the system is big endian failed with the following output:\n${OUTPUT}\n${_test_file}:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n") set(${VARIABLE}) endif() endif() diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake index 2e511ae..023d6ba 100644 --- a/Modules/TestCXXAcceptsFlag.cmake +++ b/Modules/TestCXXAcceptsFlag.cmake @@ -27,17 +27,11 @@ macro(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE) try_compile(${VARIABLE} SOURCES ${CMAKE_ROOT}/Modules/DummyCXXFile.cxx CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${FLAGS} - OUTPUT_VARIABLE OUTPUT) + ) if(${VARIABLE}) message(CHECK_PASS "yes") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the CXX compiler accepts the flag ${FLAGS} passed with " - "the following output:\n${OUTPUT}\n\n") else() message(CHECK_FAIL "no") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the CXX compiler accepts the flag ${FLAGS} failed with " - "the following output:\n${OUTPUT}\n\n") endif() endif() endmacro() diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake index 06db586..b1a12cf 100644 --- a/Modules/TestForANSIForScope.cmake +++ b/Modules/TestForANSIForScope.cmake @@ -19,21 +19,15 @@ if(NOT DEFINED CMAKE_ANSI_FOR_SCOPE) message(CHECK_START "Check for ANSI scope") try_compile(CMAKE_ANSI_FOR_SCOPE SOURCES ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx - OUTPUT_VARIABLE OUTPUT) + ) if (CMAKE_ANSI_FOR_SCOPE) message(CHECK_PASS "found") set (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL "Does the compiler support ansi for scope.") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the CXX compiler understands ansi for scopes passed with " - "the following output:\n${OUTPUT}\n\n") else () message(CHECK_FAIL "not found") set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL "Does the compiler support ansi for scope.") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the CXX compiler understands ansi for scopes failed with " - "the following output:\n${OUTPUT}\n\n") endif () endif() diff --git a/Modules/TestForANSIStreamHeaders.cxx b/Modules/TestForANSIStreamHeaders.cxx index d314d58..0ae9723 100644 --- a/Modules/TestForANSIStreamHeaders.cxx +++ b/Modules/TestForANSIStreamHeaders.cxx @@ -1,6 +1,6 @@ #include <iostream> -int main(int, char* []) +int main(int, char*[]) { return 0; } diff --git a/Modules/TestForAnsiForScope.cxx b/Modules/TestForAnsiForScope.cxx index 4bc2c67..1632cae 100644 --- a/Modules/TestForAnsiForScope.cxx +++ b/Modules/TestForAnsiForScope.cxx @@ -1,4 +1,4 @@ -int main(int, char* []) +int main(int, char*[]) { int i; for (int i = 0; i < 1; ++i) diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake index 9a09ac7..e2cc5b0 100644 --- a/Modules/TestForSSTREAM.cmake +++ b/Modules/TestForSSTREAM.cmake @@ -18,21 +18,15 @@ if(NOT DEFINED CMAKE_HAS_ANSI_STRING_STREAM) message(CHECK_START "Check for sstream") try_compile(CMAKE_HAS_ANSI_STRING_STREAM SOURCES ${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx - OUTPUT_VARIABLE OUTPUT) + ) if (CMAKE_HAS_ANSI_STRING_STREAM) message(CHECK_PASS "found") set (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL "Does the compiler support sstream") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the CXX compiler has sstream passed with " - "the following output:\n${OUTPUT}\n\n") else () message(CHECK_FAIL "not found") set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL "Does the compiler support sstream") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the CXX compiler has sstream failed with " - "the following output:\n${OUTPUT}\n\n") endif () endif() diff --git a/Modules/TestForSSTREAM.cxx b/Modules/TestForSSTREAM.cxx index 83a75e4..59f13a3 100644 --- a/Modules/TestForSSTREAM.cxx +++ b/Modules/TestForSSTREAM.cxx @@ -1,5 +1,5 @@ #include <sstream> -int main(int, char* []) +int main(int, char*[]) { std::ostringstream os; os << "12345"; diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake index cd9c782..61e922d 100644 --- a/Modules/TestForSTDNamespace.cmake +++ b/Modules/TestForSTDNamespace.cmake @@ -18,21 +18,15 @@ if(NOT DEFINED CMAKE_STD_NAMESPACE) message(CHECK_START "Check for STD namespace") try_compile(CMAKE_STD_NAMESPACE SOURCES ${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx - OUTPUT_VARIABLE OUTPUT) + ) if (CMAKE_STD_NAMESPACE) message(CHECK_PASS "found") set (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL "Does the compiler support std::.") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the CXX compiler has std namespace passed with " - "the following output:\n${OUTPUT}\n\n") else () message(CHECK_FAIL "not found") set (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL "Does the compiler support std::.") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the CXX compiler has std namespace failed with " - "the following output:\n${OUTPUT}\n\n") endif () endif() diff --git a/Modules/TestForSTDNamespace.cxx b/Modules/TestForSTDNamespace.cxx index 62951ff..b537d44 100644 --- a/Modules/TestForSTDNamespace.cxx +++ b/Modules/TestForSTDNamespace.cxx @@ -1,5 +1,5 @@ #include <list> -int main(int, char* []) +int main(int, char*[]) { std::list<int>(); return 0; diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake index eed0410..b428a61 100644 --- a/Modules/UsewxWidgets.cmake +++ b/Modules/UsewxWidgets.cmake @@ -38,18 +38,6 @@ AUTHOR Jan Woetzel <jw -at- mip.informatik.uni-kiel.de> #]=======================================================================] -# debug message and logging. -# comment these out for distribution -if (NOT LOGFILE ) - # set(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log") -endif () -macro(MSG _MSG) - # file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}\n") - # message(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") -endmacro() - - -MSG("wxWidgets_FOUND=${wxWidgets_FOUND}") if (wxWidgets_FOUND) if (wxWidgets_INCLUDE_DIRS) if(wxWidgets_INCLUDE_DIRS_NO_SYSTEM) @@ -57,45 +45,28 @@ if (wxWidgets_FOUND) else() include_directories(SYSTEM ${wxWidgets_INCLUDE_DIRS}) endif() - MSG("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}") endif() if (wxWidgets_LIBRARY_DIRS) link_directories(${wxWidgets_LIBRARY_DIRS}) - MSG("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}") endif() if (wxWidgets_DEFINITIONS) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS}) - MSG("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}") endif() if (wxWidgets_DEFINITIONS_DEBUG) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG}) - MSG("wxWidgets_DEFINITIONS_DEBUG=${wxWidgets_DEFINITIONS_DEBUG}") endif() if (wxWidgets_CXX_FLAGS) # Flags are expected to be a string here, not a list. string(REPLACE ";" " " wxWidgets_CXX_FLAGS_str "${wxWidgets_CXX_FLAGS}") string(APPEND CMAKE_CXX_FLAGS " ${wxWidgets_CXX_FLAGS_str}") - MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS_str}") unset(wxWidgets_CXX_FLAGS_str) endif() - - # DEPRECATED JW - # just for backward compatibility: add deps to all targets - # library projects better use advanced find_package(wxWidgets) directly. - #if(wxWidgets_LIBRARIES) - # link_libraries(${wxWidgets_LIBRARIES}) - # # BUG: str too long: MSG("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}") - # if(LOGFILE) - # file(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${wxWidgets_LIBRARIES}\n") - # endif() - #endif() - else () message("wxWidgets requested but not found.") endif() diff --git a/Source/.gitattributes b/Source/.gitattributes index d0aedc2..4b868dd 100644 --- a/Source/.gitattributes +++ b/Source/.gitattributes @@ -1,4 +1,4 @@ CMakeVersion.cmake export-subst # Do not format third-party sources. -/kwsys/** -format.clang-format-6.0 +/kwsys/** -format.clang-format diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index c786604..d7b5ea2 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 20230117) +set(CMake_VERSION_PATCH 20230123) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 9dd8fe3..bc14eb4 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -585,7 +585,7 @@ std::string cmCPackIFWGenerator::GetRootPackageName() // Configure from root group cmCPackIFWPackage package; package.Generator = this; - package.ConfigureFromGroup(optIFW_PACKAGE_GROUP); + package.ConfigureFromGroup(*optIFW_PACKAGE_GROUP); name = package.Name; } else if (cmValue optIFW_PACKAGE_NAME = this->GetOption("CPACK_IFW_PACKAGE_NAME")) { diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 2feca75..69440d9 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -77,19 +77,20 @@ void cmCPackIFWInstaller::ConfigureFromOptions() // ApplicationIcon if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_ICON")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->InstallerApplicationIcon = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_ICON", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_ICON", *option); } } // WindowIcon if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_WINDOW_ICON")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->InstallerWindowIcon = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WINDOW_ICON", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WINDOW_ICON", + *option); } } @@ -104,37 +105,37 @@ void cmCPackIFWInstaller::ConfigureFromOptions() // Logo if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_LOGO")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->Logo = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_LOGO", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_LOGO", *option); } } // Watermark if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_WATERMARK")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->Watermark = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WATERMARK", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_WATERMARK", *option); } } // Banner if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_BANNER")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->Banner = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BANNER", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BANNER", *option); } } // Background if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_BACKGROUND")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->Background = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BACKGROUND", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_BACKGROUND", *option); } } @@ -155,10 +156,11 @@ void cmCPackIFWInstaller::ConfigureFromOptions() // StyleSheet if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_STYLE_SHEET")) { - if (cmSystemTools::FileExists(option)) { + if (cmSystemTools::FileExists(*option)) { this->StyleSheet = *option; } else { - this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_STYLE_SHEET", option); + this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_STYLE_SHEET", + *option); } } @@ -276,9 +278,9 @@ void cmCPackIFWInstaller::ConfigureFromOptions() // Control script if (cmValue optIFW_CONTROL_SCRIPT = this->GetOption("CPACK_IFW_PACKAGE_CONTROL_SCRIPT")) { - if (!cmSystemTools::FileExists(optIFW_CONTROL_SCRIPT)) { + if (!cmSystemTools::FileExists(*optIFW_CONTROL_SCRIPT)) { this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_CONTROL_SCRIPT", - optIFW_CONTROL_SCRIPT); + *optIFW_CONTROL_SCRIPT); } else { this->ControlScript = *optIFW_CONTROL_SCRIPT; } @@ -653,9 +655,9 @@ void cmCPackIFWInstaller::GeneratePackageFiles() package.Installer = this; // Check package group if (cmValue option = this->GetOption("CPACK_IFW_PACKAGE_GROUP")) { - package.ConfigureFromGroup(option); + package.ConfigureFromGroup(*option); std::string forcedOption = "CPACK_IFW_COMPONENT_GROUP_" + - cmsys::SystemTools::UpperCase(option) + "_FORCED_INSTALLATION"; + cmsys::SystemTools::UpperCase(*option) + "_FORCED_INSTALLATION"; if (!this->GetOption(forcedOption)) { package.ForcedInstallation = "true"; } diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index c2109c9..1668fb5 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -382,7 +382,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) if (this->IsSetToEmpty(option)) { this->DisplayName.clear(); } else if (cmValue value = this->GetOption(option)) { - cmCPackIFWPackage::ExpandListArgument(value, this->DisplayName); + cmCPackIFWPackage::ExpandListArgument(*value, this->DisplayName); } // Description @@ -390,7 +390,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) if (this->IsSetToEmpty(option)) { this->Description.clear(); } else if (cmValue value = this->GetOption(option)) { - cmCPackIFWPackage::ExpandListArgument(value, this->Description); + cmCPackIFWPackage::ExpandListArgument(*value, this->Description); } // Release date @@ -484,7 +484,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) if (this->IsSetToEmpty(option)) { this->Default.clear(); } else if (cmValue value = this->GetOption(option)) { - std::string lowerValue = cmsys::SystemTools::LowerCase(value); + std::string lowerValue = cmsys::SystemTools::LowerCase(*value); if (lowerValue == "true") { this->Default = "true"; } else if (lowerValue == "false") { diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 5dae966..aeb3db3 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -422,9 +422,9 @@ void cmCPackWIXGenerator::CopyDefinition(cmWIXSourceWriter& source, cmValue value = GetOption(name); if (value) { if (type == DefinitionType::PATH) { - AddDefinition(source, name, CMakeToWixPath(value)); + AddDefinition(source, name, CMakeToWixPath(*value)); } else { - AddDefinition(source, name, value); + AddDefinition(source, name, *value); } } } @@ -504,7 +504,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() } featureDefinitions.AddAttribute("Title", featureTitle); if (cmValue desc = GetOption("CPACK_WIX_ROOT_FEATURE_DESCRIPTION")) { - featureDefinitions.AddAttribute("Description", desc); + featureDefinitions.AddAttribute("Description", *desc); } featureDefinitions.AddAttribute("Level", "1"); this->Patch->ApplyFragment("#PRODUCTFEATURE", featureDefinitions); @@ -512,7 +512,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() cmValue package = GetOption("CPACK_WIX_CMAKE_PACKAGE_REGISTRY"); if (package) { featureDefinitions.CreateCMakePackageRegistryEntry( - package, GetOption("CPACK_WIX_UPGRADE_GUID")); + *package, GetOption("CPACK_WIX_UPGRADE_GUID")); } if (!CreateFeatureHierarchy(featureDefinitions)) { diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 894c24b..c9c069c 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -80,10 +80,10 @@ std::string cmCPackArchiveGenerator::GetArchiveComponentFileName( *this->GetOption("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME"); } else if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) { packageFileName += this->GetComponentPackageFileName( - this->GetOption("CPACK_ARCHIVE_FILE_NAME"), component, isGroupName); + *this->GetOption("CPACK_ARCHIVE_FILE_NAME"), component, isGroupName); } else { packageFileName += this->GetComponentPackageFileName( - this->GetOption("CPACK_PACKAGE_FILE_NAME"), component, isGroupName); + *this->GetOption("CPACK_PACKAGE_FILE_NAME"), component, isGroupName); } packageFileName += this->GetOutputExtension(); @@ -357,9 +357,9 @@ int cmCPackArchiveGenerator::GetThreadCount() const // CPACK_ARCHIVE_THREADS overrides CPACK_THREADS if (this->IsSet("CPACK_ARCHIVE_THREADS")) { - threads = std::stoi(this->GetOption("CPACK_ARCHIVE_THREADS")); + threads = std::stoi(*this->GetOption("CPACK_ARCHIVE_THREADS")); } else if (this->IsSet("CPACK_THREADS")) { - threads = std::stoi(this->GetOption("CPACK_THREADS")); + threads = std::stoi(*this->GetOption("CPACK_THREADS")); } return threads; diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index a3b9434..6ba28d1 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -124,8 +124,8 @@ DebGenerator::DebGenerator( << debianCompressionType << std::endl); } - if (numThreads != nullptr) { - if (!cmStrToLong(numThreads, &this->NumThreads)) { + if (numThreads) { + if (!cmStrToLong(*numThreads, &this->NumThreads)) { this->NumThreads = 1; cmCPackLogger(cmCPackLog::LOG_ERROR, "Unrecognized number of threads: " << numThreads @@ -703,7 +703,7 @@ bool cmCPackDebGenerator::createDebPackages() &cmCPackDebGenerator::createDeb); cmValue dbgsymdir_path = this->GetOption("GEN_DBGSYMDIR"); if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE") && dbgsymdir_path) { - retval = make_package(dbgsymdir_path, "GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME", + retval = make_package(*dbgsymdir_path, "GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME", &cmCPackDebGenerator::createDbgsymDDeb) && retval; } diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index edd8490..4c92592 100644 --- a/Source/CPack/cmCPackExternalGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -63,7 +63,7 @@ int cmCPackExternalGenerator::PackageFiles() cmValue packageScript = this->GetOption("CPACK_EXTERNAL_PACKAGE_SCRIPT"); if (cmNonempty(packageScript)) { - if (!cmSystemTools::FileIsFullPath(packageScript)) { + if (!cmSystemTools::FileIsFullPath(*packageScript)) { cmCPackLogger( cmCPackLog::LOG_ERROR, "CPACK_EXTERNAL_PACKAGE_SCRIPT does not contain a full file path" @@ -71,7 +71,7 @@ int cmCPackExternalGenerator::PackageFiles() return 0; } - bool res = this->MakefileMap->ReadListFile(packageScript); + bool res = this->MakefileMap->ReadListFile(*packageScript); if (cmSystemTools::GetErrorOccurredFlag() || !res) { return 0; diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 90d15f8..2ac5b3d 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -91,7 +91,7 @@ int cmCPackGenerator::PrepareNames() "CPACK_PACKAGE_FILE_NAME not specified" << std::endl); return 0; } - std::string outName = pfname; + std::string outName = *pfname; tempDirectory += "/" + outName; if (!this->GetOutputExtension()) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -106,7 +106,7 @@ int cmCPackGenerator::PrepareNames() return 0; } - std::string destFile = pdir; + std::string destFile = *pdir; this->SetOptionIfNotSet("CPACK_OUTPUT_FILE_PREFIX", destFile); destFile += "/" + outName; std::string outFile = topDirectory + "/" + outName; @@ -126,17 +126,17 @@ int cmCPackGenerator::PrepareNames() cmValue descFileName = this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE"); if (descFileName && !this->GetOption("CPACK_PACKAGE_DESCRIPTION")) { cmCPackLogger(cmCPackLog::LOG_DEBUG, - "Look for: " << descFileName << std::endl); - if (!cmSystemTools::FileExists(descFileName)) { + "Look for: " << *descFileName << std::endl); + if (!cmSystemTools::FileExists(*descFileName)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find description file name: [" - << descFileName << "]" << std::endl); + << *descFileName << "]" << std::endl); return 0; } cmsys::ifstream ifs(descFileName->c_str()); if (!ifs) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Cannot open description file name: " << descFileName + "Cannot open description file name: " << *descFileName << std::endl); return 0; } @@ -144,14 +144,14 @@ int cmCPackGenerator::PrepareNames() std::string line; cmCPackLogger(cmCPackLog::LOG_VERBOSE, - "Read description file: " << descFileName << std::endl); + "Read description file: " << *descFileName << std::endl); while (ifs && cmSystemTools::GetLineFromStream(ifs, line)) { ostr << cmXMLSafe(line) << std::endl; } this->SetOption("CPACK_PACKAGE_DESCRIPTION", ostr.str()); cmValue defFileName = this->GetOption("CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE"); - if (defFileName && (defFileName == descFileName)) { + if (defFileName && (*defFileName == *descFileName)) { this->SetOption("CPACK_USED_DEFAULT_PACKAGE_DESCRIPTION_FILE", "ON"); } } @@ -636,7 +636,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( std::unique_ptr<cmGlobalGenerator> globalGenerator = this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator( - cmakeGenerator); + *cmakeGenerator); if (!globalGenerator) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Specified package generator not found. " @@ -1050,14 +1050,14 @@ int cmCPackGenerator::DoPackage() if (cmIsOn(this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY"))) { cmValue toplevelDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); - if (cmSystemTools::FileExists(toplevelDirectory)) { + if (toplevelDirectory && cmSystemTools::FileExists(*toplevelDirectory)) { cmCPackLogger(cmCPackLog::LOG_VERBOSE, - "Remove toplevel directory: " << toplevelDirectory + "Remove toplevel directory: " << *toplevelDirectory << std::endl); - if (!cmSystemTools::RepeatedRemoveDirectory(toplevelDirectory)) { + if (!cmSystemTools::RepeatedRemoveDirectory(*toplevelDirectory)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem removing toplevel directory: " - << toplevelDirectory << std::endl); + << *toplevelDirectory << std::endl); return 0; } } @@ -1091,10 +1091,10 @@ int cmCPackGenerator::DoPackage() "Package files to: " << (tempPackageFileName ? *tempPackageFileName : "(NULL)") << std::endl); - if (cmSystemTools::FileExists(tempPackageFileName)) { + if (tempPackageFileName && cmSystemTools::FileExists(*tempPackageFileName)) { cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Remove old package file" << std::endl); - cmSystemTools::RemoveFile(tempPackageFileName); + cmSystemTools::RemoveFile(*tempPackageFileName); } if (cmIsOn(this->GetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))) { tempDirectory = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); @@ -1211,7 +1211,7 @@ int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf) // Load the project specific config file cmValue config = this->GetOption("CPACK_PROJECT_CONFIG_FILE"); if (config) { - mf->ReadListFile(config); + mf->ReadListFile(*config); } int result = this->InitializeInternal(); if (cmSystemTools::GetErrorOccurredFlag()) { @@ -1581,7 +1581,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent( cmValue groupName = this->GetOption(macroPrefix + "_GROUP"); if (cmNonempty(groupName)) { - component->Group = this->GetComponentGroup(projectName, groupName); + component->Group = this->GetComponentGroup(projectName, *groupName); component->Group->Components.push_back(component); } else { component->Group = nullptr; @@ -1644,7 +1644,7 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup( cmValue parentGroupName = this->GetOption(macroPrefix + "_PARENT_GROUP"); if (cmNonempty(parentGroupName)) { group->ParentGroup = - this->GetComponentGroup(projectName, parentGroupName); + this->GetComponentGroup(projectName, *parentGroupName); group->ParentGroup->Subgroups.push_back(group); } else { group->ParentGroup = nullptr; diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 65156ab..8078d9f 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -344,8 +344,14 @@ private: #define cmCPackTypeMacro(klass, superclass) \ using Superclass = superclass; \ - const char* GetNameOfClass() override { return #klass; } \ - static cmCPackGenerator* CreateGenerator() { return new klass; } \ + const char* GetNameOfClass() override \ + { \ + return #klass; \ + } \ + static cmCPackGenerator* CreateGenerator() \ + { \ + return new klass; \ + } \ class cmCPackTypeMacro_UseTrailingSemicolon #define cmCPackLogger(logType, msg) \ diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 6ca5783..d7119c5 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -473,7 +473,7 @@ int cmCPackNSISGenerator::InitializeInternal() this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLE", "makensis"); nsisPath = cmSystemTools::FindProgram( - this->GetOption("CPACK_NSIS_EXECUTABLE"), path, false); + *this->GetOption("CPACK_NSIS_EXECUTABLE"), path, false); if (nsisPath.empty()) { cmCPackLogger( diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index 7b9f6cf..76ef091 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -58,16 +58,17 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName, ? cmStrCat("CPACK_", genName, "_BACKGROUND") : cmStrCat("CPACK_", genName, "_BACKGROUND_", paramSuffix); cmValue bgFileName = this->GetOption(opt); - if (bgFileName == nullptr) { + if (!bgFileName) { return; } - std::string bgFilePath = cmStrCat(metapackageFile, "/Contents/", bgFileName); + std::string bgFilePath = + cmStrCat(metapackageFile, "/Contents/", *bgFileName); if (!cmSystemTools::FileExists(bgFilePath)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Background image doesn't exist in the resource directory: " - << bgFileName << std::endl); + << *bgFileName << std::endl); return; } @@ -77,16 +78,16 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName, xout.StartElement(cmStrCat("background-", themeName)); } - xout.Attribute("file", bgFileName); + xout.Attribute("file", *bgFileName); cmValue param = this->GetOption(cmStrCat(opt, "_ALIGNMENT")); if (param != nullptr) { - xout.Attribute("alignment", param); + xout.Attribute("alignment", *param); } param = this->GetOption(cmStrCat(opt, "_SCALING")); if (param != nullptr) { - xout.Attribute("scaling", param); + xout.Attribute("scaling", *param); } // Apple docs say that you must provide either mime-type or uti @@ -94,12 +95,12 @@ void cmCPackPKGGenerator::CreateBackground(const char* themeName, // doesn't have them, so don't make them mandatory. param = this->GetOption(cmStrCat(opt, "_MIME_TYPE")); if (param != nullptr) { - xout.Attribute("mime-type", param); + xout.Attribute("mime-type", *param); } param = this->GetOption(cmStrCat(opt, "_UTI")); if (param != nullptr) { - xout.Attribute("uti", param); + xout.Attribute("uti", *param); } xout.EndElement(); diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index c228f07..2257118 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -233,9 +233,6 @@ int main(int argc, char const* const* argv) cminst.GetCurrentSnapshot().SetDefaultDefinitions(); cmGlobalGenerator cmgg(&cminst); cmMakefile globalMF(&cmgg, cminst.GetCurrentSnapshot()); -#if defined(__CYGWIN__) - globalMF.AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0"); -#endif bool parsed = true; for (std::size_t i = 0; i < inputArgs.size(); i++) { diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 66c30c0..c6387ab 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -671,10 +671,10 @@ bool cmCTestBuildHandler::IsLaunchedWarningFile(const char* fname) cmHasLiteralSuffix(fname, ".xml")); } -//###################################################################### -//###################################################################### -//###################################################################### -//###################################################################### +// ###################################################################### +// ###################################################################### +// ###################################################################### +// ###################################################################### class cmCTestBuildHandler::LaunchHelper { @@ -963,10 +963,10 @@ int cmCTestBuildHandler::RunMakeCommand(const std::string& command, return result; } -//###################################################################### -//###################################################################### -//###################################################################### -//###################################################################### +// ###################################################################### +// ###################################################################### +// ###################################################################### +// ###################################################################### void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length, size_t& tick, size_t tick_len, diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 5a66f82..ee06b29 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -326,10 +326,6 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) this->Makefile->AddDefinition("CTEST_SCRIPT_ARG", script_arg); } -#if defined(__CYGWIN__) - this->Makefile->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0"); -#endif - // set a callback function to update the elapsed time this->Makefile->OnExecuteCommand([this] { this->UpdateElapsedTime(); }); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index da085a6..2bc270e 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -718,7 +718,7 @@ int cmCTestSubmitHandler::ProcessHandler() cmValue cdashUploadFile = this->GetOption("CDashUploadFile"); cmValue cdashUploadType = this->GetOption("CDashUploadType"); if (cdashUploadFile && cdashUploadType) { - return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType); + return this->HandleCDashUploadFile(*cdashUploadFile, *cdashUploadType); } const std::string& buildDirectory = diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index daaf5fd..1c8c713 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -363,10 +363,10 @@ void cmCTestTestHandler::PopulateCustomVectors(cmMakefile* mf) cmValue dval = mf->GetDefinition("CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION"); if (dval) { - if (!this->SetTestOutputTruncation(dval)) { + if (!this->SetTestOutputTruncation(*dval)) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Invalid value for CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION: " - << dval << std::endl); + << *dval << std::endl); } } } @@ -520,7 +520,7 @@ bool cmCTestTestHandler::ProcessOptions() if (cmValue repeat = this->GetOption("Repeat")) { cmsys::RegularExpression repeatRegex( "^(UNTIL_FAIL|UNTIL_PASS|AFTER_TIMEOUT):([0-9]+)$"); - if (repeatRegex.find(repeat)) { + if (repeatRegex.find(*repeat)) { std::string const& count = repeatRegex.match(2); unsigned long n = 1; cmStrToULong(count, &n); // regex guarantees success @@ -537,12 +537,13 @@ bool cmCTestTestHandler::ProcessOptions() } } else { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Repeat option invalid value: " << repeat << std::endl); + "Repeat option invalid value: " << *repeat << std::endl); return false; } } if (this->GetOption("ParallelLevel")) { - this->CTest->SetParallelLevel(std::stoi(this->GetOption("ParallelLevel"))); + this->CTest->SetParallelLevel( + std::stoi(*this->GetOption("ParallelLevel"))); } if (this->GetOption("StopOnFailure")) { @@ -556,12 +557,12 @@ bool cmCTestTestHandler::ProcessOptions() cmValue val = this->GetOption("IncludeRegularExpression"); if (val) { this->UseIncludeRegExp(); - this->SetIncludeRegExp(val); + this->SetIncludeRegExp(*val); } val = this->GetOption("ExcludeRegularExpression"); if (val) { this->UseExcludeRegExp(); - this->SetExcludeRegExp(val); + this->SetExcludeRegExp(*val); } val = this->GetOption("ExcludeFixtureRegularExpression"); if (val) { @@ -2110,9 +2111,9 @@ void cmCTestTestHandler::SetTestsToRunInformation(cmValue in) this->TestsToRunString = *in; // if the argument is a file, then read it and use the contents as the // string - if (cmSystemTools::FileExists(in)) { + if (cmSystemTools::FileExists(*in)) { cmsys::ifstream fin(in->c_str()); - unsigned long filelen = cmSystemTools::FileLength(in); + unsigned long filelen = cmSystemTools::FileLength(*in); auto buff = cm::make_unique<char[]>(filelen + 1); fin.getline(buff.get(), filelen); buff[fin.gcount()] = 0; diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index d448c76..045eb84 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -123,7 +123,7 @@ int cmCTestUpdateHandler::ProcessHandler() } cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Updating the repository: " << sourceDirectory + " Updating the repository: " << *sourceDirectory << std::endl, this->Quiet); @@ -163,7 +163,7 @@ int cmCTestUpdateHandler::ProcessHandler() break; } vc->SetCommandLineTool(this->UpdateCommand); - vc->SetSourceDirectory(sourceDirectory); + vc->SetSourceDirectory(*sourceDirectory); // Cleanup the working tree. vc->Cleanup(); diff --git a/Source/CursesDialog/form/.gitattributes b/Source/CursesDialog/form/.gitattributes index 6dfa627..6e255e4 100644 --- a/Source/CursesDialog/form/.gitattributes +++ b/Source/CursesDialog/form/.gitattributes @@ -1,2 +1,2 @@ * -whitespace -* -format.clang-format-6.0 +* -format.clang-format diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index f29983c..e992b4b 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -68,7 +68,7 @@ public: ~Entry() { archive_entry_free(this->Object); } Entry(const Entry&) = delete; Entry& operator=(const Entry&) = delete; - operator struct archive_entry*() { return this->Object; } + operator struct archive_entry *() { return this->Object; } }; struct cmArchiveWrite::Callback diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h index 0d8a366..13a93b7 100644 --- a/Source/cmCPluginAPI.h +++ b/Source/cmCPluginAPI.h @@ -201,7 +201,7 @@ typedef const char*(CCONV* CM_DOC_FUNCTION)(); /* NOLINTNEXTLINE(modernize-use-using) */ typedef int(CCONV* CM_INITIAL_PASS_FUNCTION)(void* info, void* mf, int argc, - char* []); + char*[]); /* NOLINTNEXTLINE(modernize-use-using) */ typedef void(CCONV* CM_FINAL_PASS_FUNCTION)(void* info, void* mf); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 72cd8cd..5899a61 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1066,10 +1066,10 @@ int cmCTest::GetTestModelFromString(const std::string& str) return cmCTest::EXPERIMENTAL; } -//###################################################################### -//###################################################################### -//###################################################################### -//###################################################################### +// ###################################################################### +// ###################################################################### +// ###################################################################### +// ###################################################################### int cmCTest::RunMakeCommand(const std::string& command, std::string& output, int* retVal, const char* dir, cmDuration timeout, @@ -1185,10 +1185,10 @@ int cmCTest::RunMakeCommand(const std::string& command, std::string& output, return result; } -//###################################################################### -//###################################################################### -//###################################################################### -//###################################################################### +// ###################################################################### +// ###################################################################### +// ###################################################################### +// ###################################################################### int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, int* retVal, std::ostream* log, cmDuration testTimeOut, diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 8cbdcaa..8e05fac 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -260,8 +260,8 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target, "LINK_LIBRARY_OVERRIDE", nullptr, nullptr }; auto overrideFeature = cmGeneratorExpression::Evaluate( - feature, this->Target->GetLocalGenerator(), config, this->Target, - &dag, this->Target, linkLanguage); + *feature, this->Target->GetLocalGenerator(), config, + this->Target, &dag, this->Target, linkLanguage); this->LinkLibraryOverride.emplace(item, overrideFeature); } } @@ -274,7 +274,7 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target, "LINK_LIBRARY_OVERRIDE", nullptr, nullptr }; auto overrideValue = cmGeneratorExpression::Evaluate( - linkLibraryOverride, target->GetLocalGenerator(), config, target, &dag, + *linkLibraryOverride, target->GetLocalGenerator(), config, target, &dag, target, linkLanguage); auto overrideList = cmTokenize(overrideValue, ","_s); diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 6cfdf62..ad8fb8b 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -30,7 +30,7 @@ #include "cmValue.h" #include "cmake.h" -//#define CM_COMPUTE_LINK_INFO_DEBUG +// #define CM_COMPUTE_LINK_INFO_DEBUG /* Notes about linking on various platforms: @@ -366,7 +366,7 @@ cmComputeLinkInformation::cmComputeLinkInformation( this->LibraryFeatureDescriptors.emplace( "__CMAKE_LINK_EXECUTABLE", LibraryFeatureDescriptor{ "__CMAKE_LINK_EXECUTABLE", - cmStrCat(this->LoaderFlag, "<LIBRARY>") }); + cmStrCat(*this->LoaderFlag, "<LIBRARY>") }); } // To link framework using a full path this->LibraryFeatureDescriptors.emplace( @@ -858,8 +858,8 @@ bool cmComputeLinkInformation::AddLibraryFeature(std::string const& feature) return false; } - auto items = - cmExpandListWithBacktrace(langFeature, this->Target->GetBacktrace(), true); + auto items = cmExpandListWithBacktrace(*langFeature, + this->Target->GetBacktrace(), true); if ((items.size() == 1 && !IsValidFeatureFormat(items.front().Value)) || (items.size() == 3 && !IsValidFeatureFormat(items[1].Value))) { @@ -1016,8 +1016,8 @@ cmComputeLinkInformation::GetGroupFeature(std::string const& feature) .first->second; } - auto items = - cmExpandListWithBacktrace(langFeature, this->Target->GetBacktrace(), true); + auto items = cmExpandListWithBacktrace(*langFeature, + this->Target->GetBacktrace(), true); // replace LINKER: pattern this->Target->ResolveLinkerWrapper(items, this->LinkLanguage, true); diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 2084b33..618c794 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -39,12 +39,14 @@ constexpr size_t lang_property_start = 0; constexpr size_t lang_property_size = 4; constexpr size_t pie_property_start = 4; constexpr size_t pie_property_size = 2; +/* clang-format off */ #define SETUP_LANGUAGE(name, lang) \ static const std::string name[lang_property_size + pie_property_size + 1] = \ { "CMAKE_" #lang "_COMPILER_EXTERNAL_TOOLCHAIN", \ "CMAKE_" #lang "_COMPILER_TARGET", \ "CMAKE_" #lang "_LINK_NO_PIE_SUPPORTED", \ "CMAKE_" #lang "_PIE_SUPPORTED", "" } +/* clang-format on */ // NOLINTNEXTLINE(bugprone-suspicious-missing-comma) SETUP_LANGUAGE(c_properties, C); diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index ba4b326..a07acdc 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -67,7 +67,7 @@ cmExtraEclipseCDT4Generator::GetFactory() if (factory.GetSupportedGlobalGenerators().empty()) { // TODO: Verify if __CYGWIN__ should be checked. -//#if defined(_WIN32) && !defined(__CYGWIN__) +// #if defined(_WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) factory.AddSupportedGlobalGenerator("NMake Makefiles"); factory.AddSupportedGlobalGenerator("MinGW Makefiles"); diff --git a/Source/cmFileAPIConfigureLog.cxx b/Source/cmFileAPIConfigureLog.cxx index 50189cb..ad0997c 100644 --- a/Source/cmFileAPIConfigureLog.cxx +++ b/Source/cmFileAPIConfigureLog.cxx @@ -52,6 +52,7 @@ Json::Value ConfigureLog::DumpEventKindNames() // major version of the configureLog object kind is needed. Json::Value eventKindNames = Json::arrayValue; if (this->Version == 1) { + eventKindNames.append("message-v1"); // WriteMessageEvent eventKindNames.append("try_compile-v1"); // WriteTryCompileEvent eventKindNames.append("try_run-v1"); // WriteTryRunEvent } diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index b8d345f..4df81d5 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -344,7 +344,7 @@ struct entry_to_remove { if (cmValue to_skip = makefile->GetDefinition( cmStrCat("_CMAKE_SYSTEM_PREFIX_PATH_", name, "_PREFIX_COUNT"))) { - cmStrToLong(to_skip, &count); + cmStrToLong(*to_skip, &count); } if (cmValue prefix_value = makefile->GetDefinition( cmStrCat("_CMAKE_SYSTEM_PREFIX_PATH_", name, "_PREFIX_VALUE"))) { diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 71c7e13..c1b82ab 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -2204,7 +2204,7 @@ void cmFindPackageCommand::FillPrefixesCMakeSystemVariable() std::string install_path_to_remove; if (cmValue to_skip = this->Makefile->GetDefinition( "_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_COUNT")) { - cmStrToLong(to_skip, &install_prefix_count); + cmStrToLong(*to_skip, &install_prefix_count); } if (cmValue install_value = this->Makefile->GetDefinition( "_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_VALUE")) { diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index d0d339d..30aa99b 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -572,12 +572,7 @@ std::string cmGeneratorTarget::GetFilePrefix( cmValue prefix = this->GetFilePrefixInternal(config, artifact); return prefix ? *prefix : std::string(); } - - std::string prefix; - std::string suffix; - std::string base; - this->GetFullNameInternal(config, artifact, prefix, base, suffix); - return prefix; + return this->GetFullNameInternalComponents(config, artifact).prefix; } std::string cmGeneratorTarget::GetFileSuffix( const std::string& config, cmStateEnums::ArtifactType artifact) const @@ -586,12 +581,7 @@ std::string cmGeneratorTarget::GetFileSuffix( cmValue suffix = this->GetFileSuffixInternal(config, artifact); return suffix ? *suffix : std::string(); } - - std::string prefix; - std::string suffix; - std::string base; - this->GetFullNameInternal(config, artifact, prefix, base, suffix); - return suffix; + return this->GetFullNameInternalComponents(config, artifact).suffix; } std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const @@ -755,6 +745,8 @@ void cmGeneratorTarget::ClearSourcesCache() this->PrecompileHeadersCache.clear(); this->LinkOptionsCache.clear(); this->LinkDirectoriesCache.clear(); + this->RuntimeBinaryFullNameCache.clear(); + this->ImportLibraryFullNameCache.clear(); } void cmGeneratorTarget::ClearLinkInterfaceCache() @@ -2180,23 +2172,21 @@ std::set<std::string> cmGeneratorTarget::GetAllConfigCompileLanguages() const std::string cmGeneratorTarget::GetCompilePDBName( const std::string& config) const { - std::string prefix; - std::string base; - std::string suffix; - this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact, - prefix, base, suffix); - // Check for a per-configuration output directory target property. std::string configUpper = cmSystemTools::UpperCase(config); std::string configProp = cmStrCat("COMPILE_PDB_NAME_", configUpper); cmValue config_name = this->GetProperty(configProp); if (cmNonempty(config_name)) { - return prefix + *config_name + ".pdb"; + NameComponents const& components = GetFullNameInternalComponents( + config, cmStateEnums::RuntimeBinaryArtifact); + return components.prefix + *config_name + ".pdb"; } cmValue name = this->GetProperty("COMPILE_PDB_NAME"); if (cmNonempty(name)) { - return prefix + *name + ".pdb"; + NameComponents const& components = GetFullNameInternalComponents( + config, cmStateEnums::RuntimeBinaryArtifact); + return components.prefix + *name + ".pdb"; } return ""; @@ -2939,11 +2929,11 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config, } } -void cmGeneratorTarget::GetFullNameComponents( - std::string& prefix, std::string& base, std::string& suffix, - const std::string& config, cmStateEnums::ArtifactType artifact) const +cmGeneratorTarget::NameComponents const& +cmGeneratorTarget::GetFullNameComponents( + std::string const& config, cmStateEnums::ArtifactType artifact) const { - this->GetFullNameInternal(config, artifact, prefix, base, suffix); + return this->GetFullNameInternalComponents(config, artifact); } std::string cmGeneratorTarget::BuildBundleDirectory( @@ -3572,7 +3562,7 @@ void cmGeneratorTarget::AddCUDAArchitectureFlags(cmBuildStep compileOrLink, if (ipoEnabled && compileOrLink == cmBuildStep::Link) { if (cmValue cudaIPOFlags = this->Makefile->GetDefinition("CMAKE_CUDA_LINK_OPTIONS_IPO")) { - flags += cudaIPOFlags; + flags += *cudaIPOFlags; } } @@ -5261,32 +5251,33 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetLibraryNames( } // Get the components of the library name. - std::string prefix; - std::string suffix; - this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact, - prefix, targetNames.Base, suffix); + NameComponents const& components = this->GetFullNameInternalComponents( + config, cmStateEnums::RuntimeBinaryArtifact); // The library name. - targetNames.Output = prefix + targetNames.Base + suffix; + targetNames.Base = components.base; + targetNames.Output = + components.prefix + targetNames.Base + components.suffix; if (this->IsFrameworkOnApple()) { - targetNames.Real = prefix; + targetNames.Real = components.prefix; if (!this->Makefile->PlatformIsAppleEmbedded()) { targetNames.Real += "Versions/"; targetNames.Real += this->GetFrameworkVersion(); targetNames.Real += "/"; } - targetNames.Real += targetNames.Base + suffix; - targetNames.SharedObject = targetNames.Real + suffix; + targetNames.Real += targetNames.Base + components.suffix; + targetNames.SharedObject = targetNames.Real + components.suffix; } else { // The library's soname. - this->ComputeVersionedName(targetNames.SharedObject, prefix, - targetNames.Base, suffix, targetNames.Output, - soversion); + this->ComputeVersionedName(targetNames.SharedObject, components.prefix, + targetNames.Base, components.suffix, + targetNames.Output, soversion); // The library's real name on disk. - this->ComputeVersionedName(targetNames.Real, prefix, targetNames.Base, - suffix, targetNames.Output, version); + this->ComputeVersionedName(targetNames.Real, components.prefix, + targetNames.Base, components.suffix, + targetNames.Output, version); } // The import library name. @@ -5330,17 +5321,17 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetExecutableNames( #endif // Get the components of the executable name. - std::string prefix; - std::string suffix; - this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact, - prefix, targetNames.Base, suffix); + NameComponents const& components = this->GetFullNameInternalComponents( + config, cmStateEnums::RuntimeBinaryArtifact); // The executable name. - targetNames.Output = prefix + targetNames.Base + suffix; + targetNames.Base = components.base; + targetNames.Output = + components.prefix + targetNames.Base + components.suffix; // The executable's real name on disk. #if defined(__CYGWIN__) - targetNames.Real = prefix + targetNames.Base; + targetNames.Real = components.prefix + targetNames.Base; #else targetNames.Real = targetNames.Output; #endif @@ -5349,7 +5340,7 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetExecutableNames( targetNames.Real += *version; } #if defined(__CYGWIN__) - targetNames.Real += suffix; + targetNames.Real += components.suffix; #endif // The import library name. @@ -5365,11 +5356,9 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetExecutableNames( std::string cmGeneratorTarget::GetFullNameInternal( const std::string& config, cmStateEnums::ArtifactType artifact) const { - std::string prefix; - std::string base; - std::string suffix; - this->GetFullNameInternal(config, artifact, prefix, base, suffix); - return prefix + base + suffix; + NameComponents const& components = + this->GetFullNameInternalComponents(config, artifact); + return components.prefix + components.base + components.suffix; } std::string cmGeneratorTarget::ImportedGetLocation( @@ -5387,19 +5376,27 @@ std::string cmGeneratorTarget::GetFullNameImported( this->Target->ImportedGetFullPath(config, artifact)); } -void cmGeneratorTarget::GetFullNameInternal( - const std::string& config, cmStateEnums::ArtifactType artifact, - std::string& outPrefix, std::string& outBase, std::string& outSuffix) const +cmGeneratorTarget::NameComponents const& +cmGeneratorTarget::GetFullNameInternalComponents( + std::string const& config, cmStateEnums::ArtifactType artifact) const { + assert(artifact == cmStateEnums::RuntimeBinaryArtifact || + artifact == cmStateEnums::ImportLibraryArtifact); + FullNameCache& cache = artifact == cmStateEnums::RuntimeBinaryArtifact + ? RuntimeBinaryFullNameCache + : ImportLibraryFullNameCache; + auto search = cache.find(config); + if (search != cache.end()) { + return search->second; + } // Use just the target name for non-main target types. if (this->GetType() != cmStateEnums::STATIC_LIBRARY && this->GetType() != cmStateEnums::SHARED_LIBRARY && this->GetType() != cmStateEnums::MODULE_LIBRARY && this->GetType() != cmStateEnums::EXECUTABLE) { - outPrefix.clear(); - outBase = this->GetName(); - outSuffix.clear(); - return; + NameComponents components; + components.base = this->GetName(); + return cache.emplace(config, std::move(components)).first->second; } const bool isImportedLibraryArtifact = @@ -5408,12 +5405,14 @@ void cmGeneratorTarget::GetFullNameInternal( // Return an empty name for the import library if this platform // does not support import libraries. if (isImportedLibraryArtifact && !this->NeedImportLibraryName(config)) { - outPrefix.clear(); - outBase.clear(); - outSuffix.clear(); - return; + return cache.emplace(config, NameComponents()).first->second; } + NameComponents parts; + std::string& outPrefix = parts.prefix; + std::string& outBase = parts.base; + std::string& outSuffix = parts.suffix; + // retrieve prefix and suffix std::string ll = this->GetLinkerLanguage(config); cmValue targetPrefix = this->GetFilePrefixInternal(config, artifact, ll); @@ -5474,6 +5473,8 @@ void cmGeneratorTarget::GetFullNameInternal( // Append the suffix. outSuffix = targetSuffix ? *targetSuffix : ""; + + return cache.emplace(config, std::move(parts)).first->second; } std::string cmGeneratorTarget::GetLinkerLanguage( @@ -5509,11 +5510,8 @@ std::string cmGeneratorTarget::GetPDBOutputName( std::string cmGeneratorTarget::GetPDBName(const std::string& config) const { - std::string prefix; - std::string base; - std::string suffix; - this->GetFullNameInternal(config, cmStateEnums::RuntimeBinaryArtifact, - prefix, base, suffix); + NameComponents const& parts = this->GetFullNameInternalComponents( + config, cmStateEnums::RuntimeBinaryArtifact); std::vector<std::string> props; std::string configUpper = cmSystemTools::UpperCase(config); @@ -5527,11 +5525,10 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const for (std::string const& p : props) { if (cmValue outName = this->GetProperty(p)) { - base = *outName; - break; + return parts.prefix + *outName + ".pdb"; } } - return prefix + base + ".pdb"; + return parts.prefix + parts.base + ".pdb"; } std::string cmGeneratorTarget::GetObjectDirectory( @@ -5987,7 +5984,7 @@ std::string valueAsString<std::string>(std::string value) template <> std::string valueAsString<cmValue>(cmValue value) { - return value ? value : std::string("(unset)"); + return value ? *value : std::string("(unset)"); } template <> std::string valueAsString<std::nullptr_t>(std::nullptr_t /*unused*/) diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 7fa662d..dd10c64 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -348,10 +348,16 @@ public: /** Get the soname of the target. Allowed only for a shared library. */ std::string GetSOName(const std::string& config) const; - void GetFullNameComponents(std::string& prefix, std::string& base, - std::string& suffix, const std::string& config, - cmStateEnums::ArtifactType artifact = - cmStateEnums::RuntimeBinaryArtifact) const; + struct NameComponents + { + std::string prefix; + std::string base; + std::string suffix; + }; + NameComponents const& GetFullNameComponents( + std::string const& config, + cmStateEnums::ArtifactType artifact = + cmStateEnums::RuntimeBinaryArtifact) const; /** Append to @a base the bundle directory hierarchy up to a certain @a level * and return it. */ @@ -940,10 +946,14 @@ private: std::string GetFullNameInternal(const std::string& config, cmStateEnums::ArtifactType artifact) const; - void GetFullNameInternal(const std::string& config, - cmStateEnums::ArtifactType artifact, - std::string& outPrefix, std::string& outBase, - std::string& outSuffix) const; + + using FullNameCache = std::map<std::string, NameComponents>; + + mutable FullNameCache RuntimeBinaryFullNameCache; + mutable FullNameCache ImportLibraryFullNameCache; + + NameComponents const& GetFullNameInternalComponents( + std::string const& config, cmStateEnums::ArtifactType artifact) const; mutable std::string LinkerLanguage; using LinkClosureMapType = std::map<std::string, LinkClosure>; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 8ca6ee6..4cfec22 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -4,11 +4,13 @@ #include <algorithm> #include <cassert> +#include <chrono> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <initializer_list> +#include <iomanip> #include <iterator> #include <sstream> #include <utility> @@ -947,7 +949,7 @@ void cmGlobalGenerator::PrintCompilerAdvice(std::ostream& os, // Subclasses override this method if they do not support this advice. os << "Tell CMake where to find the compiler by setting "; if (envVar) { - os << "either the environment variable \"" << envVar << "\" or "; + os << "either the environment variable \"" << *envVar << "\" or "; } os << "the CMake cache entry CMAKE_" << lang << "_COMPILER " @@ -1303,6 +1305,8 @@ void cmGlobalGenerator::CreateLocalGenerators() void cmGlobalGenerator::Configure() { + auto startTime = std::chrono::steady_clock::now(); + this->FirstTimeProgress = 0.0f; this->ClearGeneratorMembers(); this->NextDeferId = 0; @@ -1350,20 +1354,17 @@ void cmGlobalGenerator::Configure() "number of local generators", cmStateEnums::INTERNAL); + auto endTime = std::chrono::steady_clock::now(); + if (this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE) { std::ostringstream msg; if (cmSystemTools::GetErrorOccurredFlag()) { msg << "Configuring incomplete, errors occurred!"; - const char* logs[] = { "CMakeOutput.log", "CMakeError.log", nullptr }; - for (const char** log = logs; *log; ++log) { - std::string f = cmStrCat(this->CMakeInstance->GetHomeOutputDirectory(), - "/CMakeFiles/", *log); - if (cmSystemTools::FileExists(f)) { - msg << "\nSee also \"" << f << "\"."; - } - } } else { - msg << "Configuring done"; + auto ms = std::chrono::duration_cast<std::chrono::milliseconds>( + endTime - startTime); + msg << "Configuring done (" << std::fixed << std::setprecision(1) + << ms.count() / 1000.0L << "s)"; } this->CMakeInstance->UpdateProgress(msg.str(), -1); } @@ -1606,6 +1607,8 @@ bool cmGlobalGenerator::Compute() void cmGlobalGenerator::Generate() { + auto startTime = std::chrono::steady_clock::now(); + // Create a map from local generator to the complete set of targets // it builds by default. this->InitializeProgressMarks(); @@ -1688,7 +1691,13 @@ void cmGlobalGenerator::Generate() w.str()); } - this->CMakeInstance->UpdateProgress("Generating done", -1); + auto endTime = std::chrono::steady_clock::now(); + auto ms = + std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime); + std::ostringstream msg; + msg << "Generating done (" << std::fixed << std::setprecision(1) + << ms.count() / 1000.0L << "s)"; + this->CMakeInstance->UpdateProgress(msg.str(), -1); } bool cmGlobalGenerator::ComputeTargetDepends() @@ -2040,7 +2049,7 @@ int cmGlobalGenerator::TryCompile(int jobs, const std::string& srcdir, cmBuildOptions defaultBuildOptions(false, fast, PackageResolveMode::Disable); return this->Build(jobs, srcdir, bindir, projectName, newTarget, output, "", - config, defaultBuildOptions, false, + config, defaultBuildOptions, true, this->TryCompileTimeout); } diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx index 18c48d7..3da15f6 100644 --- a/Source/cmGlobalGhsMultiGenerator.cxx +++ b/Source/cmGlobalGhsMultiGenerator.cxx @@ -100,10 +100,10 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts, cmValue prevTool = mf->GetDefinition("CMAKE_MAKE_PROGRAM"); /* check if the toolset changed from last generate */ - if (cmNonempty(prevTool) && !cmSystemTools::ComparePath(gbuild, prevTool)) { + if (cmNonempty(prevTool) && !cmSystemTools::ComparePath(gbuild, *prevTool)) { std::string const& e = cmStrCat("toolset build tool: ", gbuild, - "\nDoes not match the previously used build tool: ", prevTool, + "\nDoes not match the previously used build tool: ", *prevTool, "\nEither remove the CMakeCache.txt file and CMakeFiles " "directory or choose a different binary directory."); mf->IssueMessage(MessageType::FATAL_ERROR, e); @@ -354,7 +354,7 @@ void cmGlobalGhsMultiGenerator::WriteProjectLine( * unsupported target type and should be skipped. */ if (projFile && projType) { - std::string path = cmSystemTools::RelativePath(rootBinaryDir, projFile); + std::string path = cmSystemTools::RelativePath(rootBinaryDir, *projFile); fout << path; fout << ' ' << *projType << '\n'; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index c24b1e3..a1eadb9 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -8,6 +8,7 @@ #include <cstdio> #include <functional> #include <sstream> +#include <tuple> #include <utility> #include <cm/iterator> @@ -584,7 +585,7 @@ void cmGlobalNinjaGenerator::Generate() } for (auto& it : this->Configs) { - it.second.TargetDependsClosures.clear(); + it.second.TargetDependsClosureLocalOutputs.clear(); } this->InitOutputPathPrefix(); @@ -1360,70 +1361,85 @@ void cmGlobalNinjaGenerator::AppendTargetDependsClosure( cmGeneratorTarget const* target, cmNinjaDeps& outputs, const std::string& config, const std::string& fileConfig, bool genexOutput) { - cmNinjaOuts outs; - this->AppendTargetDependsClosure(target, outs, config, fileConfig, - genexOutput, true); - cm::append(outputs, outs); -} + struct Entry + { + Entry(cmGeneratorTarget const* target_, std::string config_, + std::string fileConfig_) + : target(target_) + , config(std::move(config_)) + , fileConfig(std::move(fileConfig_)) + { + } -void cmGlobalNinjaGenerator::AppendTargetDependsClosure( - cmGeneratorTarget const* target, cmNinjaOuts& outputs, - const std::string& config, const std::string& fileConfig, bool genexOutput, - bool omit_self) -{ + bool operator<(Entry const& other) const + { + return std::tie(target, config, fileConfig) < + std::tie(other.target, other.config, other.fileConfig); + } - // try to locate the target in the cache - ByConfig::TargetDependsClosureKey key{ - target, - config, - genexOutput, + cmGeneratorTarget const* target; + std::string config; + std::string fileConfig; }; - auto find = this->Configs[fileConfig].TargetDependsClosures.lower_bound(key); - - if (find == this->Configs[fileConfig].TargetDependsClosures.end() || - find->first != key) { - // We now calculate the closure outputs by inspecting the dependent - // targets recursively. - // For that we have to distinguish between a local result set that is only - // relevant for filling the cache entries properly isolated and a global - // result set that is relevant for the result of the top level call to - // AppendTargetDependsClosure. - cmNinjaOuts this_outs; // this will be the new cache entry - - for (auto const& dep_target : this->GetTargetDirectDepends(target)) { + + cmNinjaOuts outputSet; + std::vector<Entry> stack; + stack.emplace_back(target, config, fileConfig); + std::set<Entry> seen = { stack.back() }; + + do { + Entry entry = std::move(stack.back()); + stack.pop_back(); + + // generate the outputs of the target itself, if applicable + if (entry.target != target) { + // try to locate the target in the cache + ByConfig::TargetDependsClosureKey localCacheKey{ + entry.target, + entry.config, + genexOutput, + }; + auto& configs = this->Configs[entry.fileConfig]; + auto lb = + configs.TargetDependsClosureLocalOutputs.lower_bound(localCacheKey); + + if (lb == configs.TargetDependsClosureLocalOutputs.end() || + lb->first != localCacheKey) { + cmNinjaDeps outs; + this->AppendTargetOutputs(entry.target, outs, entry.config, + DependOnTargetArtifact); + configs.TargetDependsClosureLocalOutputs.emplace_hint( + lb, localCacheKey, outs); + for (auto& value : outs) { + outputSet.emplace(std::move(value)); + } + } else { + outputSet.insert(lb->second.begin(), lb->second.end()); + } + } + + // push next dependencies + for (const auto& dep_target : this->GetTargetDirectDepends(entry.target)) { if (!dep_target->IsInBuildSystem()) { continue; } - if (!this->IsSingleConfigUtility(target) && + if (!this->IsSingleConfigUtility(entry.target) && !this->IsSingleConfigUtility(dep_target) && this->EnableCrossConfigBuild() && !dep_target.IsCross() && !genexOutput) { continue; } - if (dep_target.IsCross()) { - this->AppendTargetDependsClosure(dep_target, this_outs, fileConfig, - fileConfig, genexOutput, false); - } else { - this->AppendTargetDependsClosure(dep_target, this_outs, config, - fileConfig, genexOutput, false); + auto emplaceRes = seen.emplace( + dep_target, dep_target.IsCross() ? entry.fileConfig : entry.config, + entry.fileConfig); + if (emplaceRes.second) { + stack.emplace_back(*emplaceRes.first); } } - find = this->Configs[fileConfig].TargetDependsClosures.emplace_hint( - find, key, std::move(this_outs)); - } - - // now fill the outputs of the final result from the newly generated cache - // entry - outputs.insert(find->second.begin(), find->second.end()); - - // finally generate the outputs of the target itself, if applicable - cmNinjaDeps outs; - if (!omit_self) { - this->AppendTargetOutputs(target, outs, config, DependOnTargetArtifact); - } - outputs.insert(outs.begin(), outs.end()); + } while (!stack.empty()); + cm::append(outputs, outputSet); } void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias, diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 775e792..2b6d1cd 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -354,11 +354,6 @@ public: const std::string& config, const std::string& fileConfig, bool genexOutput); - void AppendTargetDependsClosure(cmGeneratorTarget const* target, - cmNinjaOuts& outputs, - const std::string& config, - const std::string& fileConfig, - bool genexOutput, bool omit_self); void AppendDirectoryForConfig(const std::string& prefix, const std::string& config, @@ -615,7 +610,8 @@ private: bool GenexOutput; }; - std::map<TargetDependsClosureKey, cmNinjaOuts> TargetDependsClosures; + std::map<TargetDependsClosureKey, cmNinjaDeps> + TargetDependsClosureLocalOutputs; TargetAliasMap TargetAliases; diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 192663d..1e01dd6 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -773,9 +773,9 @@ std::string cmGlobalVisualStudio10Generator::FindMSBuildCommand() std::string mskey; // Search in standard location. - mskey = cmStrCat( - R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\)", - this->GetToolsVersion(), ";MSBuildToolsPath"); + mskey = + cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\)", + this->GetToolsVersion(), ";MSBuildToolsPath"); if (cmSystemTools::ReadRegistryValue(mskey, msbuild, cmSystemTools::KeyWOW64_32)) { cmSystemTools::ConvertToUnixSlashes(msbuild); @@ -1498,6 +1498,17 @@ bool cmGlobalVisualStudio10Generator::IsMsBuildRestoreSupported() const cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer15_7_5)); } +bool cmGlobalVisualStudio10Generator::IsBuildInParallelSupported() const +{ + if (this->Version >= VSVersion::VS16) { + return true; + } + + static std::string const vsVer15_8_0 = "15.8.27705.0"; + cm::optional<std::string> vsVer = this->GetVSInstanceVersion(); + return (vsVer && + cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer15_8_0)); +} std::string cmGlobalVisualStudio10Generator::GetClFlagTableName() const { std::string const& toolset = this->GetPlatformToolsetString(); diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 63c21c5..deed206 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -168,6 +168,7 @@ public: cmIDEFlagTable const* GetNasmFlagTable() const; bool IsMsBuildRestoreSupported() const; + bool IsBuildInParallelSupported() const; protected: cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name, diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 06fd61c..de13924 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -168,7 +168,7 @@ void cmGlobalVisualStudio71Generator::WriteExternalProject( cmValue typeGuid, const std::set<BT<std::pair<std::string, bool>>>& depends) { fout << "Project(\"{" - << (typeGuid ? typeGuid + << (typeGuid ? *typeGuid : std::string( cmGlobalVisualStudio71Generator::ExternalProjectType( location))) diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index c375d60..d483135 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -168,9 +168,9 @@ std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand() } // Search where VS15Preview places it. - vskey = cmStrCat( - R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7;)", - this->GetIDEVersion()); + vskey = + cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7;)", + this->GetIDEVersion()); if (cmSystemTools::ReadRegistryValue(vskey, vscmd, cmSystemTools::KeyWOW64_32)) { cmSystemTools::ConvertToUnixSlashes(vscmd); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index f19dfd5..5f28fc6 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2516,10 +2516,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, } // Get the product name components. - std::string pnprefix; - std::string pnbase; - std::string pnsuffix; - gtgt->GetFullNameComponents(pnprefix, pnbase, pnsuffix, configName); + cmGeneratorTarget::NameComponents const& components = + gtgt->GetFullNameComponents(configName); cmValue version = gtgt->GetProperty("VERSION"); cmValue soversion = gtgt->GetProperty("SOVERSION"); @@ -2534,8 +2532,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, version = soversion; } - std::string realName = pnbase; - std::string soName = pnbase; + std::string realName = components.base; + std::string soName = components.base; if (version && soversion) { realName += "."; realName += *version; @@ -2565,15 +2563,15 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt, gtgt->GetType() == cmStateEnums::SHARED_LIBRARY || gtgt->GetType() == cmStateEnums::MODULE_LIBRARY || gtgt->GetType() == cmStateEnums::EXECUTABLE) { - + std::string prefix = components.prefix; if (gtgt->IsFrameworkOnApple() || gtgt->IsCFBundleOnApple()) { - pnprefix = ""; + prefix = ""; } buildSettings->AddAttribute("EXECUTABLE_PREFIX", - this->CreateString(pnprefix)); + this->CreateString(prefix)); buildSettings->AddAttribute("EXECUTABLE_SUFFIX", - this->CreateString(pnsuffix)); + this->CreateString(components.suffix)); } // Store the product name for all target types. diff --git a/Source/cmJSONHelpers.h b/Source/cmJSONHelpers.h index 48decbc..f7151b5 100644 --- a/Source/cmJSONHelpers.h +++ b/Source/cmJSONHelpers.h @@ -36,26 +36,24 @@ struct cmJSONHelperBuilder Object& Bind(const cm::string_view& name, M U::*member, F func, bool required = true) { - return this->BindPrivate(name, - [func, member](T& out, const Json::Value* value, - CallState&&... state) -> E { - return func(out.*member, value, - std::forward(state)...); - }, - required); + return this->BindPrivate( + name, + [func, member](T& out, const Json::Value* value, CallState&&... state) + -> E { return func(out.*member, value, std::forward(state)...); }, + required); } template <typename M, typename F> Object& Bind(const cm::string_view& name, std::nullptr_t, F func, bool required = true) { - return this->BindPrivate(name, - [func](T& /*out*/, const Json::Value* value, - CallState&&... state) -> E { - M dummy; - return func(dummy, value, - std::forward(state)...); - }, - required); + return this->BindPrivate( + name, + [func](T& /*out*/, const Json::Value* value, + CallState&&... state) -> E { + M dummy; + return func(dummy, value, std::forward(state)...); + }, + required); } template <typename F> Object& Bind(const cm::string_view& name, F func, bool required = true) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index cedb367..75ec694 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -430,7 +430,7 @@ void cmLocalGenerator::GenerateInstallRules() // Compute the install prefix. cmValue installPrefix = this->Makefile->GetDefinition("CMAKE_INSTALL_PREFIX"); - std::string prefix = installPrefix; + std::string prefix = *installPrefix; #if defined(_WIN32) && !defined(__CYGWIN__) if (!installPrefix) { @@ -869,7 +869,7 @@ std::string cmLocalGenerator::GetIncludeFlags( cmStrCat("CMAKE_INCLUDE_FLAG_SEP_", lang))) { // if there is a separator then the flag is not repeated but is only // given once i.e. -classpath a:b:c - sep = incSep; + sep = *incSep; repeatFlag = false; } @@ -1397,7 +1397,7 @@ void cmLocalGenerator::GetDeviceLinkFlags( if (ipoEnabled) { if (cmValue cudaIPOFlags = this->Makefile->GetDefinition( "CMAKE_CUDA_DEVICE_LINK_OPTIONS_IPO")) { - linkFlags += cudaIPOFlags; + linkFlags += *cudaIPOFlags; } } @@ -1408,7 +1408,7 @@ void cmLocalGenerator::GetDeviceLinkFlags( linkPath); } - // iterate link deps and see if any of them need IPO + this->AddVisibilityPresetFlags(linkFlags, target, "CUDA"); std::vector<std::string> linkOpts; target->GetLinkOptions(linkOpts, config, "CUDA"); @@ -1848,7 +1848,7 @@ bool cmLocalGenerator::AllAppleArchSysrootsAreTheSame( [this, sysroot](std::string const& arch) -> bool { std::string const& archSysroot = this->AppleArchSysroots[arch]; - return cmIsOff(archSysroot) || sysroot == archSysroot; + return cmIsOff(archSysroot) || *sysroot == archSysroot; }); } diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx index e7a1f93..759ee7b 100644 --- a/Source/cmLocalXCodeGenerator.cxx +++ b/Source/cmLocalXCodeGenerator.cxx @@ -147,7 +147,7 @@ void cmLocalXCodeGenerator::AddXCConfigSources(cmGeneratorTarget* target) for (auto& config : configs) { auto file = cmGeneratorExpression::Evaluate( - xcconfig, + *xcconfig, this, config); if (!file.empty()) { target->AddSource(file); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index db8f785..d26f383 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -983,7 +983,8 @@ void cmMakefile::Generate(cmLocalGenerator& lg) this->DoGenerate(lg); cmValue oldValue = this->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); if (oldValue && - cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, oldValue, "2.4")) { + cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, *oldValue, + "2.4")) { this->GetCMakeInstance()->IssueMessage( MessageType::FATAL_ERROR, "You have set CMAKE_BACKWARDS_COMPATIBILITY to a CMake version less " diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index fa29ec9..205f01f 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -8,6 +8,7 @@ #include <cm/string_view> #include <cmext/string_view> +#include "cmConfigureLog.h" #include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmMessageType.h" @@ -64,6 +65,25 @@ void ReportCheckResult(cm::string_view what, std::string result, } } +namespace { +#ifndef CMAKE_BOOTSTRAP +void WriteMessageEvent(cmConfigureLog& log, cmMakefile const& mf, + std::string const& message) +{ + // Keep in sync with cmFileAPIConfigureLog's DumpEventKindNames. + static const std::vector<unsigned long> LogVersionsWithMessageV1{ 1 }; + + if (log.IsAnyLogVersionEnabled(LogVersionsWithMessageV1)) { + log.BeginEvent("message-v1"); + log.WriteBacktrace(mf); + log.WriteChecks(mf); + log.WriteLiteralTextBlock("message"_s, message); + log.EndEvent(); + } +} +#endif +} + } // anonymous namespace // cmLibraryCommand @@ -121,6 +141,14 @@ bool cmMessageCommand(std::vector<std::string> const& args, level = Message::LogLevel::LOG_STATUS; checkingType = CheckingType::CHECK_FAIL; ++i; + } else if (*i == "CONFIGURE_LOG") { +#ifndef CMAKE_BOOTSTRAP + if (cmConfigureLog* log = mf.GetCMakeInstance()->GetConfigureLog()) { + ++i; + WriteMessageEvent(*log, mf, cmJoin(cmMakeRange(i, args.cend()), ""_s)); + } +#endif + return true; } else if (*i == "STATUS") { level = Message::LogLevel::LOG_STATUS; ++i; diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 6ec1781..d481b64 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -644,14 +644,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd( } break; case cmStateEnums::SHARED_LIBRARY: case cmStateEnums::MODULE_LIBRARY: - break; case cmStateEnums::EXECUTABLE: - if (this->TargetLinkLanguage(config) == "Swift") { - if (this->GeneratorTarget->IsExecutableWithExports()) { - this->Makefile->GetDefExpandList("CMAKE_EXE_EXPORTS_Swift_FLAG", - linkCmds); - } - } break; default: assert(false && "Unexpected target type"); @@ -1112,7 +1105,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( this->GetObjectFilePath(source, config)); } } - if (targetType != cmStateEnums::EXECUTABLE) { + if (targetType != cmStateEnums::EXECUTABLE || + gt->IsExecutableWithExports()) { linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]); } } else { @@ -1228,16 +1222,14 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( if (!this->SetMsvcTargetPdbVariable(vars, config)) { // It is common to place debug symbols at a specific place, // so we need a plain target name in the rule available. - std::string prefix; - std::string base; - std::string suffix; - gt->GetFullNameComponents(prefix, base, suffix, config); + cmGeneratorTarget::NameComponents const& components = + gt->GetFullNameComponents(config); std::string dbg_suffix = ".dbg"; // TODO: Where to document? if (cmValue d = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) { dbg_suffix = *d; } - vars["TARGET_PDB"] = base + suffix + dbg_suffix; + vars["TARGET_PDB"] = components.base + components.suffix + dbg_suffix; } const std::string objPath = diff --git a/Source/cmRange.h b/Source/cmRange.h index 30af7d2..85cb8ea 100644 --- a/Source/cmRange.h +++ b/Source/cmRange.h @@ -76,9 +76,9 @@ class TransformIterator { public: using iterator_category = std::bidirectional_iterator_tag; - using value_type = - typename std::remove_cv<typename std::remove_reference<decltype( - std::declval<UnaryFunction>()(*std::declval<Iter>()))>::type>::type; + using value_type = typename std::remove_cv< + typename std::remove_reference<decltype(std::declval<UnaryFunction>()( + *std::declval<Iter>()))>::type>::type; using difference_type = typename std::iterator_traits<Iter>::difference_type; using pointer = value_type const*; using reference = value_type const&; diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index 44f37cb..d5f6f0d 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -179,7 +179,7 @@ void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths, cmValue arch = this->FC->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE"); if (cmNonempty(arch)) { - std::string archNoUnknown = arch; + std::string archNoUnknown = *arch; auto unknownAtPos = archNoUnknown.find("-unknown-"); bool foundUnknown = unknownAtPos != std::string::npos; if (foundUnknown) { diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 521cf63..de1e3b0 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -619,10 +619,9 @@ bool HandleSource(cmSourceFile* sf, const std::string& propertyName, if (propertyName == "GENERATED") { SetPropertyCommand::PropertyOp op = (remove) ? SetPropertyCommand::PropertyOp::Remove - : (appendAsString) - ? SetPropertyCommand::PropertyOp::AppendAsString - : (appendMode) ? SetPropertyCommand::PropertyOp::Append - : SetPropertyCommand::PropertyOp::Set; + : (appendAsString) ? SetPropertyCommand::PropertyOp::AppendAsString + : (appendMode) ? SetPropertyCommand::PropertyOp::Append + : SetPropertyCommand::PropertyOp::Set; return SetPropertyCommand::HandleAndValidateSourceFilePropertyGENERATED( sf, propertyValue, op); } diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index cb5f11f..e230702 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -301,14 +301,6 @@ void cmStateSnapshot::SetDefaultDefinitions() this->SetDefinition("UNIX", "1"); this->SetDefinition("CMAKE_HOST_UNIX", "1"); } -#if defined(__CYGWIN__) - std::string legacy; - if (cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32", legacy) && - cmIsOn(legacy)) { - this->SetDefinition("WIN32", "1"); - this->SetDefinition("CMAKE_HOST_WIN32", "1"); - } -#endif #if defined(__APPLE__) this->SetDefinition("APPLE", "1"); this->SetDefinition("CMAKE_HOST_APPLE", "1"); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index f94c4d3..0b29b0d 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -3044,7 +3044,7 @@ static cm::optional<bool> SetRPathELF(std::string const& file, { auto adjustCallback = [newRPath](cm::optional<std::string>& outRPath, const std::string& inRPath, - const char* /*se_name*/, std::string * + const char* /*se_name*/, std::string* /*emsg*/) -> bool { if (inRPath != newRPath) { outRPath = newRPath; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9734414..5065876 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -550,7 +550,7 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile( e1.Element("Platform", this->Platform); cmValue projLabel = this->GeneratorTarget->GetProperty("PROJECT_LABEL"); - e1.Element("ProjectName", projLabel ? projLabel : this->Name); + e1.Element("ProjectName", projLabel ? *projLabel : this->Name); { cm::optional<std::string> targetFramework; cm::optional<std::string> targetFrameworkVersion; @@ -1807,7 +1807,8 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule( outputs.str(), comment, ccg); } else { this->WriteCustomRuleCpp(*spe2, c, script, additional_inputs.str(), - outputs.str(), comment, ccg, symbolic); + outputs.str(), comment, ccg, symbolic, + command.GetUsesTerminal()); } } } @@ -1816,9 +1817,12 @@ void cmVisualStudio10TargetGenerator::WriteCustomRuleCpp( Elem& e2, std::string const& config, std::string const& script, std::string const& additional_inputs, std::string const& outputs, std::string const& comment, cmCustomCommandGenerator const& ccg, - bool symbolic) + bool symbolic, bool uses_terminal) { const std::string cond = this->CalcCondition(config); + if (this->GlobalGenerator->IsBuildInParallelSupported() && !uses_terminal) { + e2.WritePlatformConfigTag("BuildInParallel", cond, "true"); + } e2.WritePlatformConfigTag("Message", cond, comment); e2.WritePlatformConfigTag("Command", cond, script); e2.WritePlatformConfigTag("AdditionalInputs", cond, additional_inputs); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 166cdf7..194fbaa 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -157,7 +157,8 @@ private: std::string const& additional_inputs, std::string const& outputs, std::string const& comment, - cmCustomCommandGenerator const& ccg, bool symbolic); + cmCustomCommandGenerator const& ccg, bool symbolic, + bool uses_terminal); void WriteCustomRuleCSharp(Elem& e0, std::string const& config, std::string const& commandName, std::string const& script, diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 0d947a5..468ff73 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2416,9 +2416,6 @@ int cmake::ActualConfigure() // info to save time if (!this->GetIsInTryCompile()) { this->GlobalGenerator->ClearEnabledLanguages(); - - this->TruncateOutputLog("CMakeOutput.log"); - this->TruncateOutputLog("CMakeError.log"); } #if !defined(CMAKE_BOOTSTRAP) diff --git a/Source/kwsys/CONTRIBUTING.rst b/Source/kwsys/CONTRIBUTING.rst index 32e7b83..ebd3ed3 100644 --- a/Source/kwsys/CONTRIBUTING.rst +++ b/Source/kwsys/CONTRIBUTING.rst @@ -27,7 +27,7 @@ copies of KWSys within dependent projects can be updated to get the changes. Code Style ========== -We use `clang-format`_ version **6.0** to define our style for C++ code in +We use `clang-format`_ version **15** to define our style for C++ code in the KWSys source tree. See the `.clang-format`_ configuration file for our style settings. Use the `clang-format.bash`_ script to format source code. It automatically runs ``clang-format`` on the set of source files diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx index e45db36..ccd5f6d 100644 --- a/Source/kwsys/CommandLineArguments.cxx +++ b/Source/kwsys/CommandLineArguments.cxx @@ -319,7 +319,7 @@ void CommandLineArguments::DeleteRemainingArguments(int argc, char*** argv) { int cc; for (cc = 0; cc < argc; ++cc) { - delete[](*argv)[cc]; + delete[] (*argv)[cc]; } delete[] * argv; } diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx index fa2c295..92eae41 100644 --- a/Source/kwsys/Glob.cxx +++ b/Source/kwsys/Glob.cxx @@ -390,8 +390,8 @@ bool Glob::FindFiles(const std::string& inexpr, GlobMessages* messages) #endif // Handle drive letters on Windows if (expr[1] == ':' && expr[0] != '/') { - skip = 2; - } + skip = 2; + } } if (skip > 0) { diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c index 17e1507..0b43b4a 100644 --- a/Source/kwsys/ProcessWin32.c +++ b/Source/kwsys/ProcessWin32.c @@ -2406,8 +2406,9 @@ static int kwsysProcess_List__Next_NT4(kwsysProcess_List* self) { if (self->CurrentInfo) { if (self->CurrentInfo->NextEntryDelta > 0) { - self->CurrentInfo = ((PSYSTEM_PROCESS_INFORMATION)( - (char*)self->CurrentInfo + self->CurrentInfo->NextEntryDelta)); + self->CurrentInfo = + ((PSYSTEM_PROCESS_INFORMATION)((char*)self->CurrentInfo + + self->CurrentInfo->NextEntryDelta)); return 1; } self->CurrentInfo = 0; diff --git a/Source/kwsys/RegularExpression.cxx b/Source/kwsys/RegularExpression.cxx index fb4e380..c96a96d 100644 --- a/Source/kwsys/RegularExpression.cxx +++ b/Source/kwsys/RegularExpression.cxx @@ -366,9 +366,9 @@ bool RegularExpression::compile(const char* exp) } // Allocate space. - //#ifndef _WIN32 + // #ifndef _WIN32 delete[] this->program; - //#endif + // #endif this->program = new char[comp.regsize]; this->progsize = static_cast<int>(comp.regsize); diff --git a/Source/kwsys/RegularExpression.hxx.in b/Source/kwsys/RegularExpression.hxx.in index 2709cde..2cb7f5e 100644 --- a/Source/kwsys/RegularExpression.hxx.in +++ b/Source/kwsys/RegularExpression.hxx.in @@ -456,9 +456,9 @@ inline RegularExpression::RegularExpression(const std::string& s) */ inline RegularExpression::~RegularExpression() { - //#ifndef _WIN32 + // #ifndef _WIN32 delete[] this->program; - //#endif + // #endif } /** @@ -556,9 +556,9 @@ inline bool RegularExpression::is_valid() const inline void RegularExpression::set_invalid() { - //#ifndef _WIN32 + // #ifndef _WIN32 delete[] this->program; - //#endif + // #endif this->program = nullptr; } diff --git a/Source/kwsys/kwsysPrivate.h b/Source/kwsys/kwsysPrivate.h index dd9c127..2f5c2fa 100644 --- a/Source/kwsys/kwsysPrivate.h +++ b/Source/kwsys/kwsysPrivate.h @@ -27,7 +27,7 @@ */ # define KWSYS_NAMESPACE_STRING KWSYS_NAMESPACE_STRING0(KWSYS_NAMESPACE) # define KWSYS_NAMESPACE_STRING0(x) KWSYS_NAMESPACE_STRING1(x) -# define KWSYS_NAMESPACE_STRING1(x) # x +# define KWSYS_NAMESPACE_STRING1(x) #x #else # error "kwsysPrivate.h included multiple times." diff --git a/Source/kwsys/testConfigure.cxx b/Source/kwsys/testConfigure.cxx index a3c2ed3..4a34e1c 100644 --- a/Source/kwsys/testConfigure.cxx +++ b/Source/kwsys/testConfigure.cxx @@ -22,7 +22,7 @@ static bool testFallthrough(int n) return r == 2; } -int testConfigure(int, char* []) +int testConfigure(int, char*[]) { bool res = true; res = testFallthrough(1) && res; diff --git a/Source/kwsys/testConsoleBuf.cxx b/Source/kwsys/testConsoleBuf.cxx index 4b7ddf0..f9b826d 100644 --- a/Source/kwsys/testConsoleBuf.cxx +++ b/Source/kwsys/testConsoleBuf.cxx @@ -743,7 +743,7 @@ static int testConsole() #endif -int testConsoleBuf(int, char* []) +int testConsoleBuf(int, char*[]) { int ret = 0; diff --git a/Source/kwsys/testDirectory.cxx b/Source/kwsys/testDirectory.cxx index 79bdc98..8c73af2 100644 --- a/Source/kwsys/testDirectory.cxx +++ b/Source/kwsys/testDirectory.cxx @@ -19,7 +19,7 @@ file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ #include <testSystemTools.h> -static int _doLongPathTest() +static int doLongPathTest() { using namespace kwsys; static const int LONG_PATH_THRESHOLD = 512; @@ -77,7 +77,7 @@ static int _doLongPathTest() return res; } -static int _nonExistentDirectoryTest() +static int nonExistentDirectoryTest() { using namespace kwsys; int res = 0; @@ -105,7 +105,7 @@ static int _nonExistentDirectoryTest() return res; } -static int _copyDirectoryTest() +static int copyDirectoryTest() { using namespace kwsys; const std::string source(TEST_SYSTEMTOOLS_BINARY_DIR @@ -136,8 +136,7 @@ static int _copyDirectoryTest() return 0; } -int testDirectory(int, char* []) +int testDirectory(int, char*[]) { - return _doLongPathTest() + _nonExistentDirectoryTest() + - _copyDirectoryTest(); + return doLongPathTest() + nonExistentDirectoryTest() + copyDirectoryTest(); } diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx index 1d605cb..3acb6c8 100644 --- a/Source/kwsys/testEncoding.cxx +++ b/Source/kwsys/testEncoding.cxx @@ -266,7 +266,7 @@ static int testToWindowsExtendedPath() #endif } -int testEncoding(int, char* []) +int testEncoding(int, char*[]) { const char* loc = setlocale(LC_ALL, ""); if (loc) { diff --git a/Source/kwsys/testFStream.cxx b/Source/kwsys/testFStream.cxx index 3325e20..9897a58 100644 --- a/Source/kwsys/testFStream.cxx +++ b/Source/kwsys/testFStream.cxx @@ -136,7 +136,7 @@ static int testBOMIO() return 0; } -int testFStream(int, char* []) +int testFStream(int, char*[]) { int ret = 0; diff --git a/Source/kwsys/testStatus.cxx b/Source/kwsys/testStatus.cxx index 0a767a8..9cadada 100644 --- a/Source/kwsys/testStatus.cxx +++ b/Source/kwsys/testStatus.cxx @@ -16,7 +16,7 @@ file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ # include <windows.h> #endif -int testStatus(int, char* []) +int testStatus(int, char*[]) { bool res = true; { diff --git a/Source/kwsys/testSystemInformation.cxx b/Source/kwsys/testSystemInformation.cxx index 4f0c522..7ae94ff 100644 --- a/Source/kwsys/testSystemInformation.cxx +++ b/Source/kwsys/testSystemInformation.cxx @@ -19,7 +19,7 @@ #define printMethod3(info, m, unit) \ std::cout << #m << ": " << info.m << " " << unit << "\n" -int testSystemInformation(int, char* []) +int testSystemInformation(int, char*[]) { std::cout << "CTEST_FULL_OUTPUT\n"; // avoid truncation diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx index 487da8d..8afcb68 100644 --- a/Source/kwsys/testSystemTools.cxx +++ b/Source/kwsys/testSystemTools.cxx @@ -1209,7 +1209,7 @@ static bool CheckSplitString() return ret; } -int testSystemTools(int, char* []) +int testSystemTools(int, char*[]) { bool res = true; diff --git a/Tests/CMakeGUI/CatchShow.h b/Tests/CMakeGUI/CatchShow.h index 0254c15..7d370b6 100644 --- a/Tests/CMakeGUI/CatchShow.h +++ b/Tests/CMakeGUI/CatchShow.h @@ -30,12 +30,13 @@ void CatchShow::setCallback(F&& func) this->m_callback = [this, func](QObject* obj) { auto* d = qobject_cast<T*>(obj); if (d) { - QMetaObject::invokeMethod(obj, - [this, func, d]() { - ++this->m_count; - func(d); - }, - Qt::QueuedConnection); + QMetaObject::invokeMethod( + obj, + [this, func, d]() { + ++this->m_count; + func(d); + }, + Qt::QueuedConnection); } }; } diff --git a/Tests/CMakeLib/testArgumentParser.cxx b/Tests/CMakeLib/testArgumentParser.cxx index e044794..2647fef 100644 --- a/Tests/CMakeLib/testArgumentParser.cxx +++ b/Tests/CMakeLib/testArgumentParser.cxx @@ -365,7 +365,7 @@ bool testArgumentParserStaticBool() } // namespace -int testArgumentParser(int /*unused*/, char* /*unused*/ []) +int testArgumentParser(int /*unused*/, char* /*unused*/[]) { if (!testArgumentParserDynamic()) { std::cout << "While executing testArgumentParserDynamic().\n"; diff --git a/Tests/CMakeLib/testCMExtAlgorithm.cxx b/Tests/CMakeLib/testCMExtAlgorithm.cxx index b8319c3..c909f24 100644 --- a/Tests/CMakeLib/testCMExtAlgorithm.cxx +++ b/Tests/CMakeLib/testCMExtAlgorithm.cxx @@ -110,7 +110,7 @@ void testAppend() } } -int testCMExtAlgorithm(int /*unused*/, char* /*unused*/ []) +int testCMExtAlgorithm(int /*unused*/, char* /*unused*/[]) { testAppend(); diff --git a/Tests/CMakeLib/testCMExtEnumSet.cxx b/Tests/CMakeLib/testCMExtEnumSet.cxx index dbb0a54..ecf6d11 100644 --- a/Tests/CMakeLib/testCMExtEnumSet.cxx +++ b/Tests/CMakeLib/testCMExtEnumSet.cxx @@ -203,7 +203,7 @@ void testEdition() } } -int testCMExtEnumSet(int /*unused*/, char* /*unused*/ []) +int testCMExtEnumSet(int /*unused*/, char* /*unused*/[]) { testDeclaration(); testIteration(); diff --git a/Tests/CMakeLib/testCMExtMemory.cxx b/Tests/CMakeLib/testCMExtMemory.cxx index d8932ce..0143515 100644 --- a/Tests/CMakeLib/testCMExtMemory.cxx +++ b/Tests/CMakeLib/testCMExtMemory.cxx @@ -55,7 +55,7 @@ bool testReferenceCast() } } -int testCMExtMemory(int /*unused*/, char* /*unused*/ []) +int testCMExtMemory(int /*unused*/, char* /*unused*/[]) { if (!testReferenceCast()) { return 1; diff --git a/Tests/CMakeLib/testCMFilesystemPath.cxx b/Tests/CMakeLib/testCMFilesystemPath.cxx index 579ba99..52cb43a 100644 --- a/Tests/CMakeLib/testCMFilesystemPath.cxx +++ b/Tests/CMakeLib/testCMFilesystemPath.cxx @@ -969,7 +969,7 @@ bool testNonMemberFunctions() } } -int testCMFilesystemPath(int /*unused*/, char* /*unused*/ []) +int testCMFilesystemPath(int /*unused*/, char* /*unused*/[]) { int result = 0; diff --git a/Tests/CMakeLib/testCTestBinPacker.cxx b/Tests/CMakeLib/testCTestBinPacker.cxx index 772f417..038ceea 100644 --- a/Tests/CMakeLib/testCTestBinPacker.cxx +++ b/Tests/CMakeLib/testCTestBinPacker.cxx @@ -275,7 +275,7 @@ static bool TestExpectedPackResult(const ExpectedPackResult& expected) return true; } -int testCTestBinPacker(int /*unused*/, char* /*unused*/ []) +int testCTestBinPacker(int /*unused*/, char* /*unused*/[]) { int retval = 0; diff --git a/Tests/CMakeLib/testCTestResourceGroups.cxx b/Tests/CMakeLib/testCTestResourceGroups.cxx index 776d65d..b68301f 100644 --- a/Tests/CMakeLib/testCTestResourceGroups.cxx +++ b/Tests/CMakeLib/testCTestResourceGroups.cxx @@ -127,7 +127,7 @@ static bool TestExpectedParseResult(const ExpectedParseResult& expected) return true; } -int testCTestResourceGroups(int /*unused*/, char* /*unused*/ []) +int testCTestResourceGroups(int /*unused*/, char* /*unused*/[]) { int retval = 0; diff --git a/Tests/CMakeLib/testFindPackageCommand.cxx b/Tests/CMakeLib/testFindPackageCommand.cxx index bfd429f..30749be 100644 --- a/Tests/CMakeLib/testFindPackageCommand.cxx +++ b/Tests/CMakeLib/testFindPackageCommand.cxx @@ -14,7 +14,7 @@ std::cout << "FAILED: " << (m) << "\n"; \ failed = 1 -int testFindPackageCommand(int /*unused*/, char* /*unused*/ []) +int testFindPackageCommand(int /*unused*/, char* /*unused*/[]) { int failed = 0; diff --git a/Tests/CMakeLib/testGeneratedFileStream.cxx b/Tests/CMakeLib/testGeneratedFileStream.cxx index de44a0b..ad1c9e5 100644 --- a/Tests/CMakeLib/testGeneratedFileStream.cxx +++ b/Tests/CMakeLib/testGeneratedFileStream.cxx @@ -10,7 +10,7 @@ std::cout << "FAILED: " << (m1) << (m2) << "\n"; \ failed = 1 -int testGeneratedFileStream(int /*unused*/, char* /*unused*/ []) +int testGeneratedFileStream(int /*unused*/, char* /*unused*/[]) { int failed = 0; cmGeneratedFileStream gm; diff --git a/Tests/CMakeLib/testJSONHelpers.cxx b/Tests/CMakeLib/testJSONHelpers.cxx index 2cd3f75..053c163 100644 --- a/Tests/CMakeLib/testJSONHelpers.cxx +++ b/Tests/CMakeLib/testJSONHelpers.cxx @@ -457,7 +457,7 @@ bool testRequired() } } -int testJSONHelpers(int /*unused*/, char* /*unused*/ []) +int testJSONHelpers(int /*unused*/, char* /*unused*/[]) { if (!testInt()) { return 1; diff --git a/Tests/CMakeLib/testOptional.cxx b/Tests/CMakeLib/testOptional.cxx index 2007fff..785f031 100644 --- a/Tests/CMakeLib/testOptional.cxx +++ b/Tests/CMakeLib/testOptional.cxx @@ -760,7 +760,7 @@ static bool testMemoryRange(std::vector<Event>& expected) return true; } -int testOptional(int /*unused*/, char* /*unused*/ []) +int testOptional(int /*unused*/, char* /*unused*/[]) { int retval = 0; diff --git a/Tests/CMakeLib/testRange.cxx b/Tests/CMakeLib/testRange.cxx index 4efe98e..36c1e18 100644 --- a/Tests/CMakeLib/testRange.cxx +++ b/Tests/CMakeLib/testRange.cxx @@ -15,7 +15,7 @@ } \ } while (false) -int testRange(int /*unused*/, char* /*unused*/ []) +int testRange(int /*unused*/, char* /*unused*/[]) { std::vector<int> const testData = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx index 5a9cad1..af34a2f 100644 --- a/Tests/CMakeLib/testString.cxx +++ b/Tests/CMakeLib/testString.cxx @@ -1163,7 +1163,7 @@ static bool testStability() return true; } -int testString(int /*unused*/, char* /*unused*/ []) +int testString(int /*unused*/, char* /*unused*/[]) { if (!testConstructDefault()) { return 1; diff --git a/Tests/CMakeLib/testStringAlgorithms.cxx b/Tests/CMakeLib/testStringAlgorithms.cxx index cb5f886..1bb23df 100644 --- a/Tests/CMakeLib/testStringAlgorithms.cxx +++ b/Tests/CMakeLib/testStringAlgorithms.cxx @@ -14,7 +14,7 @@ #include "cmStringAlgorithms.h" -int testStringAlgorithms(int /*unused*/, char* /*unused*/ []) +int testStringAlgorithms(int /*unused*/, char* /*unused*/[]) { int failed = 0; diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx index 92f5275..754205e 100644 --- a/Tests/CMakeLib/testSystemTools.cxx +++ b/Tests/CMakeLib/testSystemTools.cxx @@ -25,7 +25,7 @@ } \ } while (false) -int testSystemTools(int /*unused*/, char* /*unused*/ []) +int testSystemTools(int /*unused*/, char* /*unused*/[]) { int failed = 0; // ---------------------------------------------------------------------- diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx index 1bf88cf..fc0b539 100644 --- a/Tests/CMakeLib/testUTF8.cxx +++ b/Tests/CMakeLib/testUTF8.cxx @@ -164,7 +164,7 @@ static bool is_invalid(const char* s) return true; } -int testUTF8(int /*unused*/, char* /*unused*/ []) +int testUTF8(int /*unused*/, char* /*unused*/[]) { int result = 0; for (test_utf8_entry const* e = good_entry; e->n; ++e) { diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx index fd88e24..0bdd44c 100644 --- a/Tests/CMakeLib/testUVRAII.cxx +++ b/Tests/CMakeLib/testUVRAII.cxx @@ -30,8 +30,7 @@ static bool testAsyncShutdown() std::thread([&] { std::this_thread::sleep_for(std::chrono::seconds(2)); signal.send(); - }) - .detach(); + }).detach(); if (uv_run(&Loop, UV_RUN_DEFAULT) != 0) { std::cerr << "Unclean exit state in testAsyncDtor" << std::endl; diff --git a/Tests/CMakeLib/testUVStreambuf.cxx b/Tests/CMakeLib/testUVStreambuf.cxx index 760fa29..f9ed6af 100644 --- a/Tests/CMakeLib/testUVStreambuf.cxx +++ b/Tests/CMakeLib/testUVStreambuf.cxx @@ -404,12 +404,13 @@ static bool testUVStreambufRead( << std::endl; goto end; } - uv_timer_start(timer, - [](uv_timer_t* handle) { - auto buf = static_cast<cmUVStreambuf*>(handle->data); - buf->close(); - }, - 0, 0); + uv_timer_start( + timer, + [](uv_timer_t* handle) { + auto buf = static_cast<cmUVStreambuf*>(handle->data); + buf->close(); + }, + 0, 0); if ((readLen = inputBuf.sgetn(inputData.data(), 128)) != 0) { std::cout << "sgetn() returned " << readLen << ", should be 0" << std::endl; diff --git a/Tests/CMakeLib/testVisualStudioSlnParser.cxx b/Tests/CMakeLib/testVisualStudioSlnParser.cxx index 7fdba9a..c1bf3d4 100644 --- a/Tests/CMakeLib/testVisualStudioSlnParser.cxx +++ b/Tests/CMakeLib/testVisualStudioSlnParser.cxx @@ -27,7 +27,7 @@ static bool parsedRight(cmVisualStudioSlnParser& parser, return false; } -int testVisualStudioSlnParser(int, char* []) +int testVisualStudioSlnParser(int, char*[]) { cmVisualStudioSlnParser parser; diff --git a/Tests/CMakeLib/testXMLParser.cxx b/Tests/CMakeLib/testXMLParser.cxx index 8617cc1..32ee3ec 100644 --- a/Tests/CMakeLib/testXMLParser.cxx +++ b/Tests/CMakeLib/testXMLParser.cxx @@ -4,7 +4,7 @@ #include "cmXMLParser.h" -int testXMLParser(int /*unused*/, char* /*unused*/ []) +int testXMLParser(int /*unused*/, char* /*unused*/[]) { // TODO: Derive from parser and check attributes. cmXMLParser parser; diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx index dc62eb9..f0bd9c9 100644 --- a/Tests/CMakeLib/testXMLSafe.cxx +++ b/Tests/CMakeLib/testXMLSafe.cxx @@ -25,7 +25,7 @@ static test_pair const pairs[] = { { nullptr, nullptr } }; -int testXMLSafe(int /*unused*/, char* /*unused*/ []) +int testXMLSafe(int /*unused*/, char* /*unused*/[]) { int result = 0; for (test_pair const* p = pairs; p->in; ++p) { diff --git a/Tests/CSharpLinkFromCxx/.gitattributes b/Tests/CSharpLinkFromCxx/.gitattributes index cf9d355..57a39049 100644 --- a/Tests/CSharpLinkFromCxx/.gitattributes +++ b/Tests/CSharpLinkFromCxx/.gitattributes @@ -1 +1 @@ -UsefulManagedCppClass.* -format.clang-format-6.0 +UsefulManagedCppClass.* -format.clang-format diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake index 36293f5..1e943a1 100644 --- a/Tests/CheckFortran.cmake +++ b/Tests/CheckFortran.cmake @@ -33,6 +33,7 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" RESULT_VARIABLE result ) include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran/result.cmake OPTIONAL) + # FIXME: Replace with message(CONFIGURE_LOG) when CMake version is high enough. if(CMAKE_Fortran_COMPILER AND "${result}" STREQUAL "0") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "${_desc} passed with the following output:\n" diff --git a/Tests/CheckSwift.cmake b/Tests/CheckSwift.cmake index 099c298..86ea603 100644 --- a/Tests/CheckSwift.cmake +++ b/Tests/CheckSwift.cmake @@ -42,6 +42,7 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckSwift/result.cmake OPTIONAL) + # FIXME: Replace with message(CONFIGURE_LOG) when CMake version is high enough. if(CMAKE_Swift_COMPILER AND "${result}" STREQUAL "0") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "${_desc} passed with the following output:\n" diff --git a/Tests/CompileFeatures/.gitattributes b/Tests/CompileFeatures/.gitattributes index 95a8956..83da28d 100644 --- a/Tests/CompileFeatures/.gitattributes +++ b/Tests/CompileFeatures/.gitattributes @@ -1,2 +1,2 @@ # Do not format a source containing C++11 '>>' syntax as C++98. -cxx_right_angle_brackets.cpp -format.clang-format-6.0 +cxx_right_angle_brackets.cpp -format.clang-format diff --git a/Tests/CompileFeatures/cxx_attribute_deprecated.cpp b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp index 8faeca8..5482db8 100644 --- a/Tests/CompileFeatures/cxx_attribute_deprecated.cpp +++ b/Tests/CompileFeatures/cxx_attribute_deprecated.cpp @@ -1,5 +1,8 @@ -[[deprecated]] int foo() { return 0; } +[[deprecated]] int foo() +{ + return 0; +} int someFunc() { diff --git a/Tests/CompileFeatures/cxx_attributes.cpp b/Tests/CompileFeatures/cxx_attributes.cpp index 1434317..543a3f5 100644 --- a/Tests/CompileFeatures/cxx_attributes.cpp +++ b/Tests/CompileFeatures/cxx_attributes.cpp @@ -1,5 +1,5 @@ -void unusedFunc[[noreturn]]() +void unusedFunc [[noreturn]] () { throw 1; } diff --git a/Tests/Cuda/SeparableCompCXXOnly/main.cpp b/Tests/Cuda/SeparableCompCXXOnly/main.cpp index 8135246..ed913ff 100644 --- a/Tests/Cuda/SeparableCompCXXOnly/main.cpp +++ b/Tests/Cuda/SeparableCompCXXOnly/main.cpp @@ -1,5 +1,5 @@ -int main(int, char const* []) +int main(int, char const*[]) { return 0; } diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index 17069e3..ca73b1a 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -15,6 +15,9 @@ get_property(sep_comp TARGET CUDASeparateLibA PROPERTY CUDA_SEPARABLE_COMPILATIO if(NOT sep_comp) message(FATAL_ERROR "CUDA_SEPARABLE_COMPILATION not initialized") endif() +set_target_properties(CUDASeparateLibA + PROPERTIES + POSITION_INDEPENDENT_CODE ON) unset(CMAKE_CUDA_SEPARABLE_COMPILATION) if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC") @@ -26,17 +29,24 @@ if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC") target_compile_options(CUDASeparateLibA PRIVATE -Xcompiler=-bigobj) endif() -#Having file4/file5 in a shared library causes serious problems -#with the nvcc linker and it will generate bad entries that will -#cause a segv when trying to run the executable +#Have file4 and file5 in different shared libraries so that we +#verify that hidden visibility is passed to the device linker. +#Otherwise we will get a segv when trying to run the executable # -add_library(CUDASeparateLibB STATIC file4.cu file5.cu) +add_library(CUDASeparateLibB SHARED file4.cu) target_compile_features(CUDASeparateLibB PRIVATE cuda_std_11) target_link_libraries(CUDASeparateLibB PRIVATE CUDASeparateLibA) -set_target_properties(CUDASeparateLibA - CUDASeparateLibB - PROPERTIES CUDA_SEPARABLE_COMPILATION ON - POSITION_INDEPENDENT_CODE ON) +add_library(CUDASeparateLibC SHARED file5.cu) +target_compile_features(CUDASeparateLibC PRIVATE cuda_std_11) +target_link_libraries(CUDASeparateLibC PRIVATE CUDASeparateLibA) + +set_target_properties(CUDASeparateLibB + CUDASeparateLibC + PROPERTIES + CUDA_SEPARABLE_COMPILATION ON + POSITION_INDEPENDENT_CODE ON + CUDA_VISIBILITY_PRESET hidden + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/main") add_subdirectory(main) diff --git a/Tests/CudaOnly/SeparateCompilation/file1.h b/Tests/CudaOnly/SeparateCompilation/file1.h index ff1945c..1cedc20 100644 --- a/Tests/CudaOnly/SeparateCompilation/file1.h +++ b/Tests/CudaOnly/SeparateCompilation/file1.h @@ -1,5 +1,14 @@ #pragma once + +#ifdef _WIN32 +# define EXPORT __declspec(dllexport) +# define IMPORT __declspec(dllimport) +#else +# define EXPORT __attribute__((__visibility__("default"))) +# define IMPORT +#endif + struct result_type { int input; diff --git a/Tests/CudaOnly/SeparateCompilation/file4.cu b/Tests/CudaOnly/SeparateCompilation/file4.cu index 2e3e01e..cc24a46 100644 --- a/Tests/CudaOnly/SeparateCompilation/file4.cu +++ b/Tests/CudaOnly/SeparateCompilation/file4.cu @@ -15,7 +15,7 @@ static __global__ void file4_kernel(result_type& r, int x) result_type_dynamic rd = file2_func(x); } -int file4_launch_kernel(int x) +EXPORT int file4_launch_kernel(int x) { result_type r; file4_kernel<<<1, 1>>>(r, x); diff --git a/Tests/CudaOnly/SeparateCompilation/file5.cu b/Tests/CudaOnly/SeparateCompilation/file5.cu index fee8e9e..38cbeb2 100644 --- a/Tests/CudaOnly/SeparateCompilation/file5.cu +++ b/Tests/CudaOnly/SeparateCompilation/file5.cu @@ -15,7 +15,7 @@ static __global__ void file5_kernel(result_type& r, int x) result_type_dynamic rd = file2_func(x); } -int file5_launch_kernel(int x) +EXPORT int file5_launch_kernel(int x) { result_type r; file5_kernel<<<1, 1>>>(r, x); diff --git a/Tests/CudaOnly/SeparateCompilation/main/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/main/CMakeLists.txt index c181078..ce066c6 100644 --- a/Tests/CudaOnly/SeparateCompilation/main/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/main/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(CudaOnlySeparateCompilation main.cu) -target_link_libraries(CudaOnlySeparateCompilation PRIVATE CUDASeparateLibB) +target_link_libraries(CudaOnlySeparateCompilation PRIVATE CUDASeparateLibB CUDASeparateLibC) set_target_properties(CudaOnlySeparateCompilation PROPERTIES CUDA_STANDARD 11 CUDA_STANDARD_REQUIRED TRUE diff --git a/Tests/CudaOnly/SeparateCompilation/main/main.cu b/Tests/CudaOnly/SeparateCompilation/main/main.cu index 2b6e8f4..c3f7ce7 100644 --- a/Tests/CudaOnly/SeparateCompilation/main/main.cu +++ b/Tests/CudaOnly/SeparateCompilation/main/main.cu @@ -4,8 +4,8 @@ #include "../file1.h" #include "../file2.h" -int file4_launch_kernel(int x); -int file5_launch_kernel(int x); +IMPORT int file4_launch_kernel(int x); +IMPORT int file5_launch_kernel(int x); int choose_cuda_device() { diff --git a/Tests/FindOpenACC/CXXTest/main.cxx b/Tests/FindOpenACC/CXXTest/main.cxx index 7369045..14b912b 100644 --- a/Tests/FindOpenACC/CXXTest/main.cxx +++ b/Tests/FindOpenACC/CXXTest/main.cxx @@ -8,7 +8,7 @@ void vecaddgpu(float* r, float* a, float* b, std::size_t n) r[i] = a[i] + b[i]; } -int main(int, char* []) +int main(int, char*[]) { const std::size_t n = 100000; /* vector length */ std::vector<float> a(n); /* input vector 1 */ diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index b07c214..fc71a18 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -56,8 +56,6 @@ add_custom_target(checksayhello ALL ) add_dependencies(checksayhello sayhello) -set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log) -file(REMOVE "${err_log}") include(CheckFortranSourceCompiles) unset(HAVE_PRINT CACHE) CHECK_Fortran_SOURCE_COMPILES([[ @@ -66,10 +64,24 @@ CHECK_Fortran_SOURCE_COMPILES([[ END ]] HAVE_PRINT) if(NOT HAVE_PRINT) - if(EXISTS "${err_log}") - file(READ "${err_log}" err) + set(configure_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml") + if(EXISTS "${configure_log}") + file(READ "${configure_log}" log_content) + else() + set(log_content "") + endif() + if(log_content MATCHES [[( - + kind: "try_compile-v1"( ++ [^ +]+)+ + checks: + - "Performing Test HAVE_PRINT"( ++ [^ +]+)+)]]) + set(err "${CMAKE_MATCH_1}") + else() + set(err "") endif() - string(REPLACE "\n" "\n " err " ${err}") message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n" "${err}") endif() diff --git a/Tests/PositionIndependentTargets/.gitattributes b/Tests/PositionIndependentTargets/.gitattributes index 61b2751..ed36631 100644 --- a/Tests/PositionIndependentTargets/.gitattributes +++ b/Tests/PositionIndependentTargets/.gitattributes @@ -1,2 +1,2 @@ # Do not format a source where we want a long line preserved. -pic_test.h -format.clang-format-6.0 +pic_test.h -format.clang-format diff --git a/Tests/QtAutogen/Complex/calwidget.cpp b/Tests/QtAutogen/Complex/calwidget.cpp index f58b182..202ed49 100644 --- a/Tests/QtAutogen/Complex/calwidget.cpp +++ b/Tests/QtAutogen/Complex/calwidget.cpp @@ -433,4 +433,4 @@ QComboBox* Window::createColorComboBox() return comboBox; } -//#include "moc_calwidget.cpp" +// #include "moc_calwidget.cpp" diff --git a/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt b/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt index c23ab89..f32056a 100644 --- a/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt +++ b/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt @@ -1,2 +1,2 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt index 55bb894..da548a6 100644 --- a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt +++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt @@ -1,2 +1 @@ -- Configuring incomplete, errors occurred! -See also ".*/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-build/CMakeFiles/CMakeOutput\.log". diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx index b872ae9..3b3d313 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/importable.cxx @@ -1,5 +1,5 @@ export module importable; -import : internal_partition; +import :internal_partition; #include "internal-partitions_export.h" diff --git a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx index b15f53c..c828612 100644 --- a/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx +++ b/Tests/RunCMake/CXXModules/examples/internal-partitions/partition.cxx @@ -1,4 +1,4 @@ -module importable : internal_partition; +module importable:internal_partition; int from_partition() { diff --git a/Tests/RunCMake/CXXModules/examples/partitions/importable.cxx b/Tests/RunCMake/CXXModules/examples/partitions/importable.cxx index d0ac2f4..fbd5f90 100644 --- a/Tests/RunCMake/CXXModules/examples/partitions/importable.cxx +++ b/Tests/RunCMake/CXXModules/examples/partitions/importable.cxx @@ -1,5 +1,5 @@ export module importable; -export import : partition; +export import :partition; #include "partitions_export.h" diff --git a/Tests/RunCMake/CXXModules/examples/partitions/partition.cxx b/Tests/RunCMake/CXXModules/examples/partitions/partition.cxx index a47a4fd..20131cf 100644 --- a/Tests/RunCMake/CXXModules/examples/partitions/partition.cxx +++ b/Tests/RunCMake/CXXModules/examples/partitions/partition.cxx @@ -1,4 +1,4 @@ -export module importable : partition; +export module importable:partition; #include "partitions_export.h" diff --git a/Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx b/Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx index be77b0d..cab19ec 100644 --- a/Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx +++ b/Tests/RunCMake/CXXModules/sources/module-internal-part-impl.cxx @@ -1,6 +1,6 @@ #ifdef _MSC_VER // Only MSVC supports this pattern. -module M : internal_part; +module M:internal_part; #else module M; #endif diff --git a/Tests/RunCMake/CXXModules/sources/module-internal-part.cxx b/Tests/RunCMake/CXXModules/sources/module-internal-part.cxx index fa82afb..0dc749f 100644 --- a/Tests/RunCMake/CXXModules/sources/module-internal-part.cxx +++ b/Tests/RunCMake/CXXModules/sources/module-internal-part.cxx @@ -1,3 +1,3 @@ -module M : internal_part; +module M:internal_part; int i(); diff --git a/Tests/RunCMake/CXXModules/sources/module-part-impl.cxx b/Tests/RunCMake/CXXModules/sources/module-part-impl.cxx index 46d5d9f..f3b6ba8 100644 --- a/Tests/RunCMake/CXXModules/sources/module-part-impl.cxx +++ b/Tests/RunCMake/CXXModules/sources/module-part-impl.cxx @@ -1,11 +1,11 @@ #ifdef _MSC_VER // Only MSVC supports this pattern. -module M : part; +module M:part; #else module M; #endif -import M : internal_part; +import M:internal_part; int p() { diff --git a/Tests/RunCMake/CXXModules/sources/module-part.cxx b/Tests/RunCMake/CXXModules/sources/module-part.cxx index 137c16f..307781b 100644 --- a/Tests/RunCMake/CXXModules/sources/module-part.cxx +++ b/Tests/RunCMake/CXXModules/sources/module-part.cxx @@ -1,3 +1,3 @@ -export module M : part; +export module M:part; int p(); diff --git a/Tests/RunCMake/CXXModules/sources/module.cxx b/Tests/RunCMake/CXXModules/sources/module.cxx index a631354..37eedeb 100644 --- a/Tests/RunCMake/CXXModules/sources/module.cxx +++ b/Tests/RunCMake/CXXModules/sources/module.cxx @@ -1,5 +1,5 @@ export module M; -export import M : part; -import M : internal_part; +export import M:part; +import M:internal_part; int f(); diff --git a/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes b/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes index d9a4db4..9c22288 100644 --- a/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes +++ b/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes @@ -1,2 +1,2 @@ # Do not format a source encoded in UTF-16. -test_UTF-16LE.h -format.clang-format-6.0 +test_UTF-16LE.h -format.clang-format diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test.c b/Tests/RunCMake/CommandLine/cmake_depends/test.c index 92c056f..5b42255 100644 --- a/Tests/RunCMake/CommandLine/cmake_depends/test.c +++ b/Tests/RunCMake/CommandLine/cmake_depends/test.c @@ -1,2 +1,3 @@ #include "test.h" + #include "test_UTF-16LE.h" diff --git a/Tests/RunCMake/Configure/CopyFileABI-stdout.txt b/Tests/RunCMake/Configure/CopyFileABI-stdout.txt index 6a856a4..2176554 100644 --- a/Tests/RunCMake/Configure/CopyFileABI-stdout.txt +++ b/Tests/RunCMake/Configure/CopyFileABI-stdout.txt @@ -1,4 +1,4 @@ -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done.* --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) diff --git a/Tests/RunCMake/Configure/ErrorLogs-result.txt b/Tests/RunCMake/Configure/ErrorLogs-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/Configure/ErrorLogs-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt deleted file mode 100644 index 4eee45d..0000000 --- a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at ErrorLogs.cmake:3 \(message\): - Some error! -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Configure/ErrorLogs-stdout.txt b/Tests/RunCMake/Configure/ErrorLogs-stdout.txt deleted file mode 100644 index c467b62..0000000 --- a/Tests/RunCMake/Configure/ErrorLogs-stdout.txt +++ /dev/null @@ -1,3 +0,0 @@ --- Configuring incomplete, errors occurred! -See also ".*/Tests/RunCMake/Configure/ErrorLogs-build/CMakeFiles/CMakeOutput\.log"\. -See also ".*/Tests/RunCMake/Configure/ErrorLogs-build/CMakeFiles/CMakeError\.log"\. diff --git a/Tests/RunCMake/Configure/ErrorLogs.cmake b/Tests/RunCMake/Configure/ErrorLogs.cmake deleted file mode 100644 index e8cf062..0000000 --- a/Tests/RunCMake/Configure/ErrorLogs.cmake +++ /dev/null @@ -1,3 +0,0 @@ -file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Some detailed error information!\n") -message(SEND_ERROR "Some error!") diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake index 750fa3c..df6849e 100644 --- a/Tests/RunCMake/Configure/RunCMakeTest.cmake +++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake @@ -3,7 +3,6 @@ include(RunCMake) run_cmake(ContinueAfterError) run_cmake(CopyFileABI) run_cmake(CustomTargetAfterError) -run_cmake(ErrorLogs) # Use a single build tree for a few tests without cleaning. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build) diff --git a/Tests/RunCMake/FileAPI/configureLog-v1-check.py b/Tests/RunCMake/FileAPI/configureLog-v1-check.py index ea5beb4..05c7893 100644 --- a/Tests/RunCMake/FileAPI/configureLog-v1-check.py +++ b/Tests/RunCMake/FileAPI/configureLog-v1-check.py @@ -14,7 +14,7 @@ def check_object_configureLog(o): assert os.path.exists(path) eventKindNames = o["eventKindNames"] assert is_list(eventKindNames) - assert sorted(eventKindNames) == ["try_compile-v1", "try_run-v1"] + assert sorted(eventKindNames) == ["message-v1", "try_compile-v1", "try_run-v1"] assert is_dict(index) assert sorted(index.keys()) == ["cmake", "objects", "reply"] diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt index 013c4f2..9af0573 100644 --- a/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt +++ b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt @@ -1,5 +1,5 @@ CMake Error at OUTPUT_NAME-recursion.cmake:[0-9]+ \(add_executable\): - Target 'empty2' OUTPUT_NAME depends on itself. + Target 'empty1' OUTPUT_NAME depends on itself. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes b/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes index d9b566e..883a7f1 100644 --- a/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes +++ b/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes @@ -1,2 +1,2 @@ # Exclude reference content from formatting. -* -format.clang-format-6.0 +* -format.clang-format diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt index 8877451..8c1c301 100644 --- a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt +++ b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt @@ -1,4 +1,4 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: [^ ]*/Tests/RunCMake/NinjaMultiConfig/Simple-build diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt index 8877451..8c1c301 100644 --- a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt +++ b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt @@ -1,4 +1,4 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: [^ ]*/Tests/RunCMake/NinjaMultiConfig/Simple-build diff --git a/Tests/RunCMake/Swift/NoWorkToDo.cmake b/Tests/RunCMake/Swift/NoWorkToDo.cmake index e86a861..51c2ff3 100644 --- a/Tests/RunCMake/Swift/NoWorkToDo.cmake +++ b/Tests/RunCMake/Swift/NoWorkToDo.cmake @@ -1,2 +1,5 @@ enable_language(Swift) -add_executable(hello hello.swift) +add_executable(hello1 hello.swift) +set_target_properties(hello1 PROPERTIES ENABLE_EXPORTS TRUE) + +add_executable(hello2 hello.swift) diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt index 34c873c..9f4f24e 100644 --- a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt +++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt @@ -1,3 +1,3 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt index 34c873c..9f4f24e 100644 --- a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt +++ b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt @@ -1,3 +1,3 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/message/ConfigureLog-config.txt b/Tests/RunCMake/message/ConfigureLog-config.txt new file mode 100644 index 0000000..49c12de --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLog-config.txt @@ -0,0 +1,30 @@ +^ +--- +events: + - + kind: "message-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + message: | + Message 0 + - + kind: "message-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 1" + message: | + Message 1 + - + kind: "message-v1" + backtrace: + - "ConfigureLog.cmake:[0-9]+ \(message\)" + - "CMakeLists.txt:[0-9]+ \(include\)" + checks: + - "Check 2" + - "Check 1" + message: | + Message 2 +\.\.\.$ diff --git a/Tests/RunCMake/message/ConfigureLog-stdout.txt b/Tests/RunCMake/message/ConfigureLog-stdout.txt new file mode 100644 index 0000000..ba32642 --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLog-stdout.txt @@ -0,0 +1,4 @@ +-- Check 1 +-- Check 2 +-- Check 2 - passed +-- Check 1 - passed diff --git a/Tests/RunCMake/message/ConfigureLog.cmake b/Tests/RunCMake/message/ConfigureLog.cmake new file mode 100644 index 0000000..6f2c1b0 --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLog.cmake @@ -0,0 +1,7 @@ +message(CONFIGURE_LOG "Message 0") +message(CHECK_START "Check 1") +message(CONFIGURE_LOG "Message 1") +message(CHECK_START "Check 2") +message(CONFIGURE_LOG "Message 2") +message(CHECK_PASS "passed") +message(CHECK_PASS "passed") diff --git a/Tests/RunCMake/message/ConfigureLogScript-config.txt b/Tests/RunCMake/message/ConfigureLogScript-config.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLogScript-config.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/message/ConfigureLogScript-stdout.txt b/Tests/RunCMake/message/ConfigureLogScript-stdout.txt new file mode 100644 index 0000000..ba32642 --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLogScript-stdout.txt @@ -0,0 +1,4 @@ +-- Check 1 +-- Check 2 +-- Check 2 - passed +-- Check 1 - passed diff --git a/Tests/RunCMake/message/ConfigureLogScript.cmake b/Tests/RunCMake/message/ConfigureLogScript.cmake new file mode 100644 index 0000000..e1cd21b --- /dev/null +++ b/Tests/RunCMake/message/ConfigureLogScript.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/ConfigureLog.cmake") diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index 1233838..c54e8f2 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -1,7 +1,9 @@ include(RunCMake) +run_cmake_script(ConfigureLogScript) run_cmake_script(newline) +run_cmake(ConfigureLog) run_cmake(defaultmessage) run_cmake(nomessage) run_cmake(message-internal-warning) diff --git a/Tests/RunCMake/try_compile/CMP0128-common.cmake b/Tests/RunCMake/try_compile/CMP0128-common.cmake index 0b8a12b..64b1a77 100644 --- a/Tests/RunCMake/try_compile/CMP0128-common.cmake +++ b/Tests/RunCMake/try_compile/CMP0128-common.cmake @@ -1,10 +1,6 @@ cmake_policy(SET CMP0067 NEW) enable_language(CXX) -# Isolate the one try_compile below in the error log. -set(CMakeError_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log") -file(REMOVE "${CMakeError_log}") - # Add our own -std= flag to the try_compile check. set(CMAKE_REQUIRED_FLAGS -std=c++11) @@ -24,8 +20,21 @@ int main() } " SRC_COMPILED) if(NOT SRC_COMPILED) - if(EXISTS "${CMakeError_log}") - file(READ "${CMakeError_log}" err_log) + message("Check failed to compile:") + set(configure_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml") + if(EXISTS "${configure_log}") + file(READ "${configure_log}" log_content) + else() + set(log_content "") + endif() + if(log_content MATCHES [[( - + kind: "try_compile-v1"( ++ [^ +]+)+ + checks: + - "Performing Test SRC_COMPILED"( ++ [^ +]+)+)]]) + message("${configure_log} contains:\n${CMAKE_MATCH_1}") endif() - message("${err_log}") endif() diff --git a/Tests/RunCMake/try_compile/ConfigureLog-config.txt b/Tests/RunCMake/try_compile/ConfigureLog-config.txt index 262ed3c..1f848bf 100644 --- a/Tests/RunCMake/try_compile/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_compile/ConfigureLog-config.txt @@ -1,6 +1,13 @@ ^ --- -events: +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -17,7 +24,14 @@ events: variable: "CMAKE_C_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* - kind: "try_compile-v1" backtrace: diff --git a/Tests/RunCMake/try_compile/ISPCTargets-stderr.txt b/Tests/RunCMake/try_compile/ISPCTargets-stderr.txt index 72e0a01..91dfa6d 100644 --- a/Tests/RunCMake/try_compile/ISPCTargets-stderr.txt +++ b/Tests/RunCMake/try_compile/ISPCTargets-stderr.txt @@ -1 +1 @@ -.*Linking ISPC static library* +(Linking ISPC static library|[ \/]libcmTC_[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\.a|out:([A-Za-z]+[\/])?cmTC_[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\.lib) diff --git a/Tests/RunCMake/try_compile/Inspect-config.txt b/Tests/RunCMake/try_compile/Inspect-config.txt index e09fe55..7a39335 100644 --- a/Tests/RunCMake/try_compile/Inspect-config.txt +++ b/Tests/RunCMake/try_compile/Inspect-config.txt @@ -1,6 +1,13 @@ ^ --- -events: +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -17,7 +24,14 @@ events: variable: "CMAKE_C_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -34,5 +48,12 @@ events: variable: "CMAKE_CXX_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* \.\.\.$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt index b0438f5..a5ca781 100644 --- a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt @@ -1,5 +1,5 @@ Running CMake on RerunCMake FALSE --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt index 9c78b26..e37d210 100644 --- a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt @@ -1,3 +1,3 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt index 9c78b26..e37d210 100644 --- a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt +++ b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt @@ -1,3 +1,3 @@ --- Configuring done --- Generating done +-- Configuring done \([0-9]+\.[0-9]s\) +-- Generating done \([0-9]+\.[0-9]s\) -- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 51ccac8..29c0538 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -45,6 +45,8 @@ run_cmake(ProjectCopyFile) run_cmake(NonSourceCopyFile) run_cmake(NonSourceCompileDefinitions) +run_cmake(Verbose) + set(RunCMake_TEST_OPTIONS --debug-trycompile) run_cmake(PlatformVariables) run_cmake(WarnDeprecated) diff --git a/Tests/RunCMake/try_compile/SourceFromBadName-config.txt b/Tests/RunCMake/try_compile/SourceFromBadName-config.txt index 10f3293..cb76565 100644 --- a/Tests/RunCMake/try_compile/SourceFromBadName-config.txt +++ b/Tests/RunCMake/try_compile/SourceFromBadName-config.txt @@ -1 +1,11 @@ -^$ +^ +--- +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ +\.\.\.$ diff --git a/Tests/RunCMake/try_compile/Verbose.c b/Tests/RunCMake/try_compile/Verbose.c new file mode 100644 index 0000000..5953879 --- /dev/null +++ b/Tests/RunCMake/try_compile/Verbose.c @@ -0,0 +1,7 @@ +#ifndef EXAMPLE_DEFINITION +# error "EXAMPLE_DEFINITION not defined." +#endif +int main(void) +{ + return 0; +} diff --git a/Tests/RunCMake/try_compile/Verbose.cmake b/Tests/RunCMake/try_compile/Verbose.cmake new file mode 100644 index 0000000..3f2a7dd --- /dev/null +++ b/Tests/RunCMake/try_compile/Verbose.cmake @@ -0,0 +1,15 @@ +enable_language(C) + +try_compile(COMPILE_RESULT + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Verbose.c + COMPILE_DEFINITIONS -DEXAMPLE_DEFINITION + OUTPUT_VARIABLE out + ) +string(REPLACE "\n" "\n " out " ${out}") +if(NOT COMPILE_RESULT) + message(FATAL_ERROR "try_compile failed:\n${out}") +endif() +if(NOT out MATCHES "EXAMPLE_DEFINITION" + AND NOT CMAKE_GENERATOR MATCHES "NMake|Borland") + message(FATAL_ERROR "try_compile output does not contain EXAMPLE_DEFINITION:\n${out}") +endif() diff --git a/Tests/RunCMake/try_run/ConfigureLog-config.txt b/Tests/RunCMake/try_run/ConfigureLog-config.txt index ba396e0..bf3c3bd 100644 --- a/Tests/RunCMake/try_run/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_run/ConfigureLog-config.txt @@ -1,6 +1,13 @@ ^ --- -events: +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -16,7 +23,14 @@ events: variable: "CMAKE_C_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* - kind: "try_run-v1" backtrace: diff --git a/Tests/StringFileTest/StringFile.cxx b/Tests/StringFileTest/StringFile.cxx index c890e8e..073e30c 100644 --- a/Tests/StringFileTest/StringFile.cxx +++ b/Tests/StringFileTest/StringFile.cxx @@ -3,7 +3,7 @@ #include "OutputFile.h" -int main(int, char* []) +int main(int, char*[]) { int res = 0; diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt index fa8687d..13cf2b1 100644 --- a/Tests/SwiftOnly/CMakeLists.txt +++ b/Tests/SwiftOnly/CMakeLists.txt @@ -43,3 +43,14 @@ target_link_libraries(N PUBLIC # Dummy to make sure generation works with such targets. add_library(SwiftIface INTERFACE) target_link_libraries(SwiftOnly PRIVATE SwiftIface) + +# @_alwaysEmitIntoClient ensures that the function body is inserted into the +# swiftmodule instead of as a symbol in the binary itself. I'm doing this to +# avoid having to link the executable. There are some flags required in order to +# link an executable into a library that I didn't see CMake emitting for Swift +# on macOS. AEIC is the easiest workaround that still tests this functionality. +# Unfortunately, AEIC was only added recently (~Swift 5.2), so we need to check +# that it is available before using it. +if(CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.2) + add_subdirectory("SwiftPlugin") +endif() diff --git a/Tests/SwiftOnly/SwiftPlugin/CMakeLists.txt b/Tests/SwiftOnly/SwiftPlugin/CMakeLists.txt new file mode 100644 index 0000000..4069f16 --- /dev/null +++ b/Tests/SwiftOnly/SwiftPlugin/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable(main main.swift) +set_target_properties(main PROPERTIES ENABLE_EXPORTS TRUE) + +add_library(plugin plugin.swift) +target_link_libraries(plugin PRIVATE main) diff --git a/Tests/SwiftOnly/SwiftPlugin/main.swift b/Tests/SwiftOnly/SwiftPlugin/main.swift new file mode 100644 index 0000000..f5aac51 --- /dev/null +++ b/Tests/SwiftOnly/SwiftPlugin/main.swift @@ -0,0 +1,4 @@ +@_alwaysEmitIntoClient +public func exported() -> Int { 32 } + +print(exported()) diff --git a/Tests/SwiftOnly/SwiftPlugin/plugin.swift b/Tests/SwiftOnly/SwiftPlugin/plugin.swift new file mode 100644 index 0000000..e84f248 --- /dev/null +++ b/Tests/SwiftOnly/SwiftPlugin/plugin.swift @@ -0,0 +1,3 @@ +import main + +public func importing() -> Int { main.exported() + 1 } diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt index db54612..9a2c4eb 100644 --- a/Tests/SystemInformation/CMakeLists.txt +++ b/Tests/SystemInformation/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.0) project(SystemInformation) -include_directories("This does not exists") +include_directories("This does not exist") get_directory_property(incl INCLUDE_DIRECTORIES) set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}") diff --git a/Tests/SystemInformation/DumpInformation.cxx b/Tests/SystemInformation/DumpInformation.cxx index 4328675..913e4c4 100644 --- a/Tests/SystemInformation/DumpInformation.cxx +++ b/Tests/SystemInformation/DumpInformation.cxx @@ -53,7 +53,7 @@ void cmDumpInformationPrintFile(const char* name, FILE* fout) } } -int main(int, char* []) +int main(int, char*[]) { const char* files[] = { DumpInformation_BINARY_DIR "/SystemInformation.out", @@ -63,13 +63,9 @@ int main(int, char* []) DumpInformation_BINARY_DIR "/OtherProperties.txt", DumpInformation_BINARY_DIR "/../../Source/cmConfigure.h", DumpInformation_BINARY_DIR "/../../CMakeCache.txt", - DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeOutput.log", - DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeError.log", DumpInformation_BINARY_DIR "/../../Bootstrap.cmk/cmake_bootstrap.log", DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.hxx", DumpInformation_BINARY_DIR "/../../Source/cmsys/Configure.h", - DumpInformation_BINARY_DIR "/CMakeFiles/CMakeOutput.log", - DumpInformation_BINARY_DIR "/CMakeFiles/CMakeError.log", 0 }; diff --git a/Tests/VSWinStorePhone/Direct3DApp1/.gitattributes b/Tests/VSWinStorePhone/Direct3DApp1/.gitattributes index 78a5469..601c97b 100644 --- a/Tests/VSWinStorePhone/Direct3DApp1/.gitattributes +++ b/Tests/VSWinStorePhone/Direct3DApp1/.gitattributes @@ -1 +1 @@ -Direct3DApp1.cpp -format.clang-format-6.0 +Direct3DApp1.cpp -format.clang-format diff --git a/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h b/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h index 56bd398..ccbbcda 100644 --- a/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h +++ b/Tests/VSWinStorePhone/Direct3DApp1/BasicTimer.h @@ -52,13 +52,19 @@ public: // Update(). property float Total { - float get() { return m_total; } + float get() + { + return m_total; + } } // Duration in seconds between the previous two calls to Update(). property float Delta { - float get() { return m_delta; } + float get() + { + return m_delta; + } } private: diff --git a/Tests/Wrapping/Wrap.c b/Tests/Wrapping/Wrap.c index e8fb8a5..30ac173 100644 --- a/Tests/Wrapping/Wrap.c +++ b/Tests/Wrapping/Wrap.c @@ -1,7 +1,8 @@ #include <stdio.h> #ifdef __CLASSIC_C__ -int main(argc, argv) int argc; +int main(argc, argv) +int argc; char** argv; #else int main(int argc, const char* argv[]) diff --git a/Utilities/.gitattributes b/Utilities/.gitattributes index 81bbf26..c43b55d 100644 --- a/Utilities/.gitattributes +++ b/Utilities/.gitattributes @@ -3,6 +3,6 @@ SetupForDevelopment.sh export-ignore # Do not format third-party sources. -/KWIML/** -format.clang-format-6.0 -/cm*/** -format.clang-format-6.0 -/cmcurl/curltest.c format.clang-format-6.0 +/KWIML/** -format.clang-format +/cm*/** -format.clang-format +/cmcurl/curltest.c format.clang-format=15 diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash index 7ca4433..27ed40f 100755 --- a/Utilities/Scripts/clang-format.bash +++ b/Utilities/Scripts/clang-format.bash @@ -40,7 +40,7 @@ Example to format files modified by the most recent commit: Utilities/Scripts/clang-format.bash --amend -Example to format all files: +Example to format all files tracked by Git: Utilities/Scripts/clang-format.bash --tracked @@ -78,7 +78,7 @@ test "$#" = 0 || die "$usage" # Find a default tool. tools=' - clang-format-6.0 + clang-format-15 clang-format ' if test "x$clang_format" = "x"; then @@ -96,8 +96,8 @@ if ! type -p "$clang_format" >/dev/null; then exit 1 fi -if ! "$clang_format" --version | grep 'clang-format version 6\.0' >/dev/null 2>/dev/null; then - echo "clang-format version 6.0 is required (exactly)" +if ! "$clang_format" --version | grep 'clang-format version 15' >/dev/null 2>/dev/null; then + echo "clang-format version 15 is required (exactly)" exit 1 fi @@ -115,10 +115,8 @@ esac $git_ls | # Select sources with our attribute. - git check-attr --stdin format.clang-format-6.0 | - grep -e ': format\.clang-format-6\.0: set$' | - sed -n 's/:[^:]*:[^:]*$//p' | + git check-attr --stdin format.clang-format | + sed -n '/: format\.clang-format: \(set\|15\)$/ {s/:[^:]*:[^:]*$//p}' | # Update sources in-place. - tr '\n' '\0' | - xargs -0 "$clang_format" -i + xargs -d '\n' "$clang_format" -i diff --git a/Utilities/std/cm/bits/string_view.cxx b/Utilities/std/cm/bits/string_view.cxx index 5381fe6..af5ae78 100644 --- a/Utilities/std/cm/bits/string_view.cxx +++ b/Utilities/std/cm/bits/string_view.cxx @@ -82,8 +82,8 @@ int string_view::compare(size_type pos1, size_type count1, const char* s, return substr(pos1, count1).compare(string_view(s, count2)); } -string_view::size_type string_view::find(string_view v, size_type pos) const - noexcept +string_view::size_type string_view::find(string_view v, + size_type pos) const noexcept { for (; pos + v.size_ <= size_; ++pos) { if (std::char_traits<char>::compare(data_ + pos, v.data_, v.size_) == 0) { @@ -109,8 +109,8 @@ string_view::size_type string_view::find(const char* s, size_type pos) const return find(string_view(s), pos); } -string_view::size_type string_view::rfind(string_view v, size_type pos) const - noexcept +string_view::size_type string_view::rfind(string_view v, + size_type pos) const noexcept { if (size_ >= v.size_) { for (pos = std::min(pos, size_ - v.size_) + 1; pos > 0;) { @@ -151,8 +151,8 @@ string_view::size_type string_view::find_first_of(string_view v, return npos; } -string_view::size_type string_view::find_first_of(char c, size_type pos) const - noexcept +string_view::size_type string_view::find_first_of(char c, + size_type pos) const noexcept { return find_first_of(string_view(&c, 1), pos); } @@ -183,8 +183,8 @@ string_view::size_type string_view::find_last_of(string_view v, return npos; } -string_view::size_type string_view::find_last_of(char c, size_type pos) const - noexcept +string_view::size_type string_view::find_last_of(char c, + size_type pos) const noexcept { return find_last_of(string_view(&c, 1), pos); } @@ -201,9 +201,8 @@ string_view::size_type string_view::find_last_of(const char* s, return find_last_of(string_view(s), pos); } -string_view::size_type string_view::find_first_not_of(string_view v, - size_type pos) const - noexcept +string_view::size_type string_view::find_first_not_of( + string_view v, size_type pos) const noexcept { for (; pos < size_; ++pos) { if (!traits_type::find(v.data_, v.size_, data_[pos])) { @@ -213,9 +212,8 @@ string_view::size_type string_view::find_first_not_of(string_view v, return npos; } -string_view::size_type string_view::find_first_not_of(char c, - size_type pos) const - noexcept +string_view::size_type string_view::find_first_not_of( + char c, size_type pos) const noexcept { return find_first_not_of(string_view(&c, 1), pos); } @@ -233,9 +231,8 @@ string_view::size_type string_view::find_first_not_of(const char* s, return find_first_not_of(string_view(s), pos); } -string_view::size_type string_view::find_last_not_of(string_view v, - size_type pos) const - noexcept +string_view::size_type string_view::find_last_not_of( + string_view v, size_type pos) const noexcept { if (size_ > 0) { for (pos = std::min(pos, size_ - 1) + 1; pos > 0;) { @@ -248,9 +245,8 @@ string_view::size_type string_view::find_last_not_of(string_view v, return npos; } -string_view::size_type string_view::find_last_not_of(char c, - size_type pos) const - noexcept +string_view::size_type string_view::find_last_not_of( + char c, size_type pos) const noexcept { return find_last_not_of(string_view(&c, 1), pos); } diff --git a/Utilities/std/cm/string_view b/Utilities/std/cm/string_view index 35cf5d9..320e1e7 100644 --- a/Utilities/std/cm/string_view +++ b/Utilities/std/cm/string_view @@ -157,8 +157,8 @@ public: size_type count) const; size_type find_first_not_of(const char* s, size_type pos = 0) const; - size_type find_last_not_of(string_view v, size_type pos = npos) const - noexcept; + size_type find_last_not_of(string_view v, + size_type pos = npos) const noexcept; size_type find_last_not_of(char c, size_type pos = npos) const noexcept; size_type find_last_not_of(const char* s, size_type pos, size_type count) const; diff --git a/Utilities/std/cmext/iterator b/Utilities/std/cmext/iterator index 83d7890..eba10dd 100644 --- a/Utilities/std/cmext/iterator +++ b/Utilities/std/cmext/iterator @@ -39,10 +39,10 @@ using is_input_range = std::is_pointer<Range>::value || std::is_array<Range>::value>; #else - cm::bool_constant<cm::is_input_iterator<decltype( - std::begin(std::declval<const Range>()))>::value && - cm::is_input_iterator<decltype( - std::end(std::declval<const Range>()))>::value>; + cm::bool_constant<cm::is_input_iterator<decltype(std::begin( + std::declval<const Range>()))>::value && + cm::is_input_iterator<decltype(std::end( + std::declval<const Range>()))>::value>; #endif } // namespace cm |