diff options
97 files changed, 838 insertions, 235 deletions
diff --git a/Help/cpack_gen/packagemaker.rst b/Help/cpack_gen/packagemaker.rst index 81acb9d..c2a450e 100644 --- a/Help/cpack_gen/packagemaker.rst +++ b/Help/cpack_gen/packagemaker.rst @@ -3,6 +3,11 @@ CPack PackageMaker Generator PackageMaker CPack generator (macOS). +.. deprecated:: 3.17 + + Xcode no longer distributes the PackageMaker tools. + This CPack generator will be removed in a future version of CPack. + Variables specific to CPack PackageMaker generator ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/Help/generator/Ninja Multi-Config.rst b/Help/generator/Ninja Multi-Config.rst index e7f362e..31e8ea9 100644 --- a/Help/generator/Ninja Multi-Config.rst +++ b/Help/generator/Ninja Multi-Config.rst @@ -12,35 +12,67 @@ multiple configurations at once with :variable:`CMAKE_CONFIGURATION_TYPES` instead of only one configuration with :variable:`CMAKE_BUILD_TYPE`. One ``build-<Config>.ninja`` file will be generated for each of these configurations (with ``<Config>`` being the configuration name.) No -``build.ninja`` file is generated, unless -:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE` is specified. You must specify -the desired ``build-<Config>.ninja`` file with ``ninja -f``. Running -``cmake --build . --config <Config> --target <target>`` will run Ninja with -``build-<Config>.ninja`` as the ``-f`` file and ``<target>`` as the build -target. - -If :variable:`CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE` is turned on, executables -and libraries of any configuration can be built regardless of which -``build-<Config>.ninja`` file is used, simply by specifying -``<target>:<OtherConfig>`` as the Ninja target. You can also specify -``<target>:all`` to build a target in all configurations. Each -``build-<Config>.ninja`` file will additionally have ``<target>`` targets which -are aliases for ``<target>:<Config>``. However, custom commands and custom -targets will always use the configuration specified in -``build-<Config>.ninja``. This is due to the fact that it is impossible in -Ninja for the same file to be output with different commands in the same build -graph. - -You can additionally use :variable:`CMAKE_NINJA_MULTI_CROSS_CONFIGS` to limit -the configurations that get cross-generated. If this variable is set, each -``build-<Config>.ninja`` file will only contain rules for the configurations -listed in the variable, plus their own configuration. This also affects which -configurations are built by the ``<target>:all`` target. - -If :variable:`CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE` is not enabled, you can -still build any target in ``build-<Config>.ninja`` by specifying -``<target>:<Config>`` or ``<target>``, but not ``<target>:<OtherConfig>`` or -``<target>:all``. +``build.ninja`` file is generated by default (see below for how to generate +it.) + +Each ``build-<Config>.ninja`` file contains ``<target>`` targets as well as +``<target>:<Config>`` targets, where ``<Config>`` is the same as the +configuration specified in ``build-<Config>.ninja`` Additionally, if +cross-config mode is enabled, ``build-<Config>.ninja`` may contain +``<target>:<OtherConfig>`` targets, where ``<OtherConfig>`` is a cross-config, +as well as ``<target>:all``, which builds the target in all cross-configs. See +below for how to enable cross-config mode. + +The ``Ninja Multi-Config`` generator recognizes the following variables: + +:variable:`CMAKE_CONFIGURATION_TYPES` + Specifies the total set of configurations to build. See the variable's + documentation for more information. + +:variable:`CMAKE_NMC_CROSS_CONFIGS` + Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of + configurations available from all ``build-<Config>.ninja`` files. + This variable activates cross-config mode. + Targets from each config specified in this variable can be built from any + ``build-<Config>.ninja`` file. Custom commands will use the configuration + native to ``build-<Config>.ninja``. If it is set to ``all``, all + configurations from :variable:`CMAKE_CONFIGURATION_TYPES` are cross-configs. + If it is not specified, or empty, each ``build-<Config>.ninja`` file will + only contain build rules for its own configuration. + + The value of this variable must be a subset of + :variable:`CMAKE_CONFIGURATION_TYPES`. + +:variable:`CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG` + Specifies the configuration to use by default in a ``build.ninja`` file. If + this variable is specified, a ``build.ninja`` file is generated which uses + build rules from ``build-<Config>.ninja`` by default. All custom commands are + executed with this configuration. If the variable is not specified, no + ``build.ninja`` file is generated. + + The value of this variable must be one of the items from + :variable:`CMAKE_CONFIGURATION_TYPES`. + +:variable:`CMAKE_NMC_DEFAULT_CONFIGS` + Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of + configurations to build for a target in ``build.ninja`` + if no ``:<Config>`` suffix is specified. If it is set to ``all``, all + configurations from :variable:`CMAKE_NMC_CROSS_CONFIGS` are used. If + it is not specified, it defaults to + :variable:`CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG`. + + For example, if you set + :variable:`CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG` to ``Release``, but + set :variable:`CMAKE_NMC_DEFAULT_CONFIGS` to ``Debug`` or ``all``, + all ``<target>`` aliases in ``build.ninja`` will resolve to + ``<target>:Debug`` or ``<target>:all``, but custom commands will still use + the ``Release`` configuration. + + The value of this variable must be a subset of + :variable:`CMAKE_NMC_CROSS_CONFIGS` or be the same as + :variable:`CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG`. It must not be + specified if :variable:`CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG` or + :variable:`CMAKE_NMC_CROSS_CONFIGS` is not used. Consider the following example: @@ -66,7 +98,7 @@ This would build the ``Debug`` configuration of ``generator``, which would be used to generate ``generated.c``, which would be used to build the ``Debug`` configuration of ``generated``. -But if :variable:`CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE` is enabled, and you +But if :variable:`CMAKE_NMC_CROSS_CONFIGS` is set to ``all``, and you run the following instead: .. code-block:: shell @@ -80,17 +112,3 @@ used to generate ``generated.c``, which would be used to build the ``Debug`` configuration of ``generated``. This is useful for running a release-optimized version of a generator utility while still building the debug version of the targets built with the generated code. - -As a convenience, ``Ninja Multi-Config`` offers a -:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE` setting. If this variable is -specified, a ``build.ninja`` file will be generated which points to the -specified ``build-<Config>.ninja`` file. In addition, if -:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE` is used in conjunction with -:variable:`CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE`, you can also specify -:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS`, which changes the config -of the ``<target>`` targets in ``build.ninja``. For example, if you set -:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE` to ``Release``, but set -:variable:`CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS` to ``Debug`` or ``all``, -all ``<target>`` aliases in ``build.ninja`` will resolve to ``<target>:Debug`` -or ``<target>:all``, but custom commands will still use the ``Release`` -configuration. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index bcf21a5..fb84378 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -104,6 +104,7 @@ Properties on Targets :maxdepth: 1 /prop_tgt/ADDITIONAL_CLEAN_FILES + /prop_tgt/AIX_EXPORT_ALL_SYMBOLS /prop_tgt/ALIASED_TARGET /prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS /prop_tgt/ANDROID_API diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 1bcd9bd..1023a66 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -323,6 +323,7 @@ Variables that Control the Build .. toctree:: :maxdepth: 1 + /variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS /variable/CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS /variable/CMAKE_ANDROID_API /variable/CMAKE_ANDROID_API_MIN @@ -427,10 +428,9 @@ Variables that Control the Build /variable/CMAKE_MODULE_LINKER_FLAGS_INIT /variable/CMAKE_MSVCIDE_RUN_PATH /variable/CMAKE_MSVC_RUNTIME_LIBRARY - /variable/CMAKE_NINJA_MULTI_CROSS_CONFIGS - /variable/CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE - /variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS - /variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE + /variable/CMAKE_NMC_CROSS_CONFIGS + /variable/CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG + /variable/CMAKE_NMC_DEFAULT_CONFIGS /variable/CMAKE_NINJA_OUTPUT_PATH_PREFIX /variable/CMAKE_NO_BUILTIN_CHRPATH /variable/CMAKE_NO_SYSTEM_FROM_IMPORTED diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst index 25cb639..2bfaafe 100644 --- a/Help/manual/ctest.1.rst +++ b/Help/manual/ctest.1.rst @@ -370,6 +370,14 @@ See `Build and Test Mode`_. This option will not run any tests, it will simply print the list of all labels associated with the test set. +``--no-tests=<[error|ignore]>`` + Regard no tests found either as error or ignore it. + + If no tests were found, the default behavior of CTest is to always log an + error message but to return an error code in script mode only. This option + unifies the behavior of CTest by either returning an error code if no tests + were found or by ignoring it. + .. include:: OPTIONS_HELP.txt .. _`Label and Subproject Summary`: diff --git a/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst b/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst new file mode 100644 index 0000000..15ddc0b --- /dev/null +++ b/Help/prop_tgt/AIX_EXPORT_ALL_SYMBOLS.rst @@ -0,0 +1,12 @@ +AIX_EXPORT_ALL_SYMBOLS +---------------------- + +On AIX, CMake automatically exports all symbols from shared libraries, and +from executables with the :prop_tgt:`ENABLE_EXPORTS` target property set. +Explicitly disable this boolean property to suppress the behavior and +export no symbols by default. In this case it is expected that the project +will use other means to export some symbols. + +This property is initialized by the value of +the :variable:`CMAKE_AIX_EXPORT_ALL_SYMBOLS` variable if it is set +when a target is created. diff --git a/Help/release/dev/aix-no-export-all.rst b/Help/release/dev/aix-no-export-all.rst new file mode 100644 index 0000000..fa9ed8d --- /dev/null +++ b/Help/release/dev/aix-no-export-all.rst @@ -0,0 +1,7 @@ +aix-no-export-all +----------------- + +* The :prop_tgt:`AIX_EXPORT_ALL_SYMBOLS` target property and associated + :variable:`CMAKE_AIX_EXPORT_ALL_SYMBOLS` variable were created to + optionally explicitly disbale automatic export of symbols from shared + libraries on AIX. diff --git a/Help/release/dev/cpack-deprecate-old-macos-generators.rst b/Help/release/dev/cpack-deprecate-old-macos-generators.rst new file mode 100644 index 0000000..15d121a --- /dev/null +++ b/Help/release/dev/cpack-deprecate-old-macos-generators.rst @@ -0,0 +1,6 @@ +cpack-deprecate-old-macos-generators +------------------------------------ + +* The :cpack_gen:`CPack PackageMaker Generator` generator has been + deprecated because Xcode no longer distributes the PackageMaker tools. + The undocumented ``OSXX11`` generator has also been deprecated. diff --git a/Help/release/dev/ctest-no-tests.rst b/Help/release/dev/ctest-no-tests.rst new file mode 100644 index 0000000..be0f28b --- /dev/null +++ b/Help/release/dev/ctest-no-tests.rst @@ -0,0 +1,6 @@ +ctest-no-tests +-------------- + +* The :manual:`ctest(1)` tool gained a ``--no-tests=<[error|ignore]>`` option + to explicitly set and unify the behavior between direct invocation and + script mode if no tests were found. diff --git a/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst b/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst new file mode 100644 index 0000000..c64dd48 --- /dev/null +++ b/Help/variable/CMAKE_AIX_EXPORT_ALL_SYMBOLS.rst @@ -0,0 +1,6 @@ +CMAKE_AIX_EXPORT_ALL_SYMBOLS +---------------------------- + +Default value for :prop_tgt:`AIX_EXPORT_ALL_SYMBOLS` target property. +This variable is used to initialize the property on each target as it is +created. diff --git a/Help/variable/CMAKE_NINJA_MULTI_CROSS_CONFIGS.rst b/Help/variable/CMAKE_NINJA_MULTI_CROSS_CONFIGS.rst deleted file mode 100644 index 48f6985..0000000 --- a/Help/variable/CMAKE_NINJA_MULTI_CROSS_CONFIGS.rst +++ /dev/null @@ -1,7 +0,0 @@ -CMAKE_NINJA_MULTI_CROSS_CONFIGS -------------------------------- - -Set which configurations get cross-built if -:variable:`CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE` is set. See the -documentation for the :generator:`Ninja Multi-Config` generator for more -information. diff --git a/Help/variable/CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE.rst b/Help/variable/CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE.rst deleted file mode 100644 index 0571d52..0000000 --- a/Help/variable/CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE.rst +++ /dev/null @@ -1,10 +0,0 @@ -CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE -------------------------------------- - -If this variable is enabled, cross-configuration building is enabled in the -:generator:`Ninja Multi-Config` generator. See the generator's description for -more details. This variable is ``OFF`` by default. - -This variable is meant to be set from the command line (via -``-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE:BOOL=ON``) and should not be set from -project code. diff --git a/Help/variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS.rst b/Help/variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS.rst deleted file mode 100644 index a997e9b..0000000 --- a/Help/variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS.rst +++ /dev/null @@ -1,6 +0,0 @@ -CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS -------------------------------------- - -Controls the config of ``<target>`` aliases in ``build.ninja`` for the -:generator:`Ninja Multi-Config` generator. See the generator's documentation -for more details. diff --git a/Help/variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE.rst b/Help/variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE.rst deleted file mode 100644 index 2b950e1..0000000 --- a/Help/variable/CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE.rst +++ /dev/null @@ -1,7 +0,0 @@ -CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE ------------------------------------- - -Specifies a configuration type to use as the default in ``build.ninja`` for the -:generator:`Ninja Multi-Config` generator. - -If this variable is not specified, no ``build.ninja`` file is generated. diff --git a/Help/variable/CMAKE_NMC_CROSS_CONFIGS.rst b/Help/variable/CMAKE_NMC_CROSS_CONFIGS.rst new file mode 100644 index 0000000..6eb6494 --- /dev/null +++ b/Help/variable/CMAKE_NMC_CROSS_CONFIGS.rst @@ -0,0 +1,7 @@ +CMAKE_NMC_CROSS_CONFIGS +------------------------------- + +Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of +configurations available from all ``build-<Config>.ninja`` files in the +:generator:`Ninja Multi-Config` generator. See the generator's +documentation for more details. diff --git a/Help/variable/CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG.rst b/Help/variable/CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG.rst new file mode 100644 index 0000000..c0eab56 --- /dev/null +++ b/Help/variable/CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG.rst @@ -0,0 +1,6 @@ +CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG +------------------------------------------- + +Specifies the configuration to use by default in a ``build.ninja`` file in the +:generator:`Ninja Multi-Config` generator. See the generator's documentation +for more details. diff --git a/Help/variable/CMAKE_NMC_DEFAULT_CONFIGS.rst b/Help/variable/CMAKE_NMC_DEFAULT_CONFIGS.rst new file mode 100644 index 0000000..e2bb017 --- /dev/null +++ b/Help/variable/CMAKE_NMC_DEFAULT_CONFIGS.rst @@ -0,0 +1,7 @@ +CMAKE_NMC_DEFAULT_CONFIGS +--------------------------------- + +Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of configurations +to build for a target in ``build.ninja`` if no ``:<Config>`` suffix is specified in +the :generator:`Ninja Multi-Config` generator. +See the generator's documentation for more details. diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake index 672d3f8..848934c 100644 --- a/Modules/CMakeSwiftInformation.cmake +++ b/Modules/CMakeSwiftInformation.cmake @@ -17,6 +17,8 @@ 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) set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -install_name -Xlinker ") @@ -81,7 +83,7 @@ if(NOT CMAKE_Swift_CREATE_SHARED_MODULE) endif() if(NOT CMAKE_Swift_LINK_EXECUTABLE) - set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -j ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} <LINK_LIBRARIES>") + set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -j ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>") endif() if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY) diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index f6f6320..684edae 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -563,8 +563,8 @@ if(NOT CPACK_GENERATOR) if(APPLE) option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF) option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF) - option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF) - option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" OFF) + option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages (deprecated)" OFF) + option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages (deprecated)" OFF) option(CPACK_BINARY_PRODUCTBUILD "Enable to build productbuild packages" OFF) mark_as_advanced( CPACK_BINARY_BUNDLE diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index ed11364..9b6d09c 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -161,14 +161,15 @@ macro(CHECK_BLAS_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _add set(${LIBRARIES}) set(_combined_name) + set(_extaddlibdir "${_addlibdir}") if(WIN32) - list(APPEND _addlibdir ENV LIB) + list(APPEND _extaddlibdir ENV LIB) elseif(APPLE) - list(APPEND _addlibdir ENV DYLD_LIBRARY_PATH) + list(APPEND _extaddlibdir ENV DYLD_LIBRARY_PATH) else() - list(APPEND _addlibdir ENV LD_LIBRARY_PATH) + list(APPEND _extaddlibdir ENV LD_LIBRARY_PATH) endif() - list(APPEND _addlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + list(APPEND _extaddlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") foreach(_library ${_list}) if(_library MATCHES "^-Wl,--(start|end)-group$") @@ -182,7 +183,7 @@ macro(CHECK_BLAS_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _add if(_libraries_work) find_library(${_prefix}_${_library}_LIBRARY NAMES ${_library} - PATHS ${_addlibdir} + PATHS ${_extaddlibdir} PATH_SUFFIXES ${_subdirs} ) #message("DEBUG: find_library(${_library}) got ${${_prefix}_${_library}_LIBRARY}") @@ -448,6 +449,12 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") endif() if(DEFINED ENV{MKLROOT}) set(BLAS_mkl_MKLROOT "$ENV{MKLROOT}") + # If MKLROOT points to the subdirectory 'mkl', use the parent directory instead + # so we can better detect other relevant libraries in 'compiler' or 'tbb': + get_filename_component(BLAS_mkl_MKLROOT_LAST_DIR "${BLAS_mkl_MKLROOT}" NAME) + if(BLAS_mkl_MKLROOT_LAST_DIR STREQUAL "mkl") + get_filename_component(BLAS_mkl_MKLROOT "${BLAS_mkl_MKLROOT}" DIRECTORY) + endif() endif() set(BLAS_mkl_LIB_PATH_SUFFIXES "compiler/lib" "compiler/lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}" @@ -478,6 +485,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") unset(BLAS_mkl_LM) unset(BLAS_mkl_LDL) unset(BLAS_mkl_MKLROOT) + unset(BLAS_mkl_MKLROOT_LAST_DIR) unset(BLAS_mkl_ARCH_NAME) unset(BLAS_mkl_OS_NAME) unset(BLAS_mkl_LIB_PATH_SUFFIXES) diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 3edea05..62749ed 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -766,6 +766,31 @@ if(CUDAToolkit_FOUND) _CUDAToolkit_find_and_add_import_lib(cudart) _CUDAToolkit_find_and_add_import_lib(cudart_static) + # setup dependencies that are required for cudart_static when building + # on linux. These are generally only required when using the CUDA toolkit + # when CUDA language is disabled + if(NOT TARGET CUDA::cudart_static_deps + AND TARGET CUDA::cudart_static) + + add_library(CUDA::cudart_static_deps IMPORTED INTERFACE) + target_link_libraries(CUDA::cudart_static INTERFACE CUDA::cudart_static_deps) + + if(UNIX AND (CMAKE_C_COMPILER OR CMAKE_CXX_COMPILER)) + find_package(Threads REQUIRED) + target_link_libraries(CUDA::cudart_static_deps INTERFACE Threads::Threads ${CMAKE_DL_LIBS}) + endif() + + if(UNIX AND NOT APPLE) + # On Linux, you must link against librt when using the static cuda runtime. + find_library(CUDAToolkit_rt_LIBRARY rt) + if(NOT CUDAToolkit_rt_LIBRARY) + message(WARNING "Could not find librt library, needed by CUDA::cudart_static") + else() + target_link_libraries(CUDA::cudart_static_deps INTERFACE ${CUDAToolkit_rt_LIBRARY}) + endif() + endif() + endif() + _CUDAToolkit_find_and_add_import_lib(culibos) # it's a static library foreach (cuda_lib cublas cufft curand cusparse nppc nvjpeg) _CUDAToolkit_find_and_add_import_lib(${cuda_lib}) diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index 8ade0b1..c962976 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -131,14 +131,15 @@ macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _a set(${LIBRARIES}) set(_combined_name) + set(_extaddlibdir "${_addlibdir}") if(WIN32) - list(APPEND _addlibdir ENV LIB) + list(APPEND _extaddlibdir ENV LIB) elseif(APPLE) - list(APPEND _addlibdir ENV DYLD_LIBRARY_PATH) + list(APPEND _extaddlibdir ENV DYLD_LIBRARY_PATH) else() - list(APPEND _addlibdir ENV LD_LIBRARY_PATH) + list(APPEND _extaddlibdir ENV LD_LIBRARY_PATH) endif() - list(APPEND _addlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + list(APPEND _extaddlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") foreach(_library ${_list}) if(_library MATCHES "^-Wl,--(start|end)-group$") @@ -149,7 +150,7 @@ macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _a if(_libraries_work) find_library(${_prefix}_${_library}_LIBRARY NAMES ${_library} - PATHS ${_addlibdir} + PATHS ${_extaddlibdir} PATH_SUFFIXES ${_subdirs} ) #message("DEBUG: find_library(${_library}) got ${${_prefix}_${_library}_LIBRARY}") @@ -267,6 +268,12 @@ if(BLAS_FOUND) endif() if(DEFINED ENV{MKLROOT}) set(LAPACK_mkl_MKLROOT "$ENV{MKLROOT}") + # If MKLROOT points to the subdirectory 'mkl', use the parent directory instead + # so we can better detect other relevant libraries in 'compiler' or 'tbb': + get_filename_component(LAPACK_mkl_MKLROOT_LAST_DIR "${LAPACK_mkl_MKLROOT}" NAME) + if(LAPACK_mkl_MKLROOT_LAST_DIR STREQUAL "mkl") + get_filename_component(LAPACK_mkl_MKLROOT "${LAPACK_mkl_MKLROOT}" DIRECTORY) + endif() endif() set(LAPACK_mkl_LIB_PATH_SUFFIXES "compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index 61d213a..5a532c7 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -23,11 +23,11 @@ macro(__aix_compiler_gnu lang) # Construct the export list ourselves to pass only the object files so # that we export only the symbols actually provided by the sources. set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp <OBJECTS>" - "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/exports.exp <AIX_EXPORTS> <OBJECTS>" + "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/exports.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" ) set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS - "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -l . <OBJECTS>" + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -l . <AIX_EXPORTS> <OBJECTS>" "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") endmacro() diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake index 2a67c4f..2a8c159 100644 --- a/Modules/Platform/AIX-XL.cmake +++ b/Modules/Platform/AIX-XL.cmake @@ -29,12 +29,12 @@ macro(__aix_compiler_xl lang) # Construct the export list ourselves to pass only the object files so # that we export only the symbols actually provided by the sources. set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/objects.exp${_OBJECTS}" - "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/exports.exp <AIX_EXPORTS>${_OBJECTS}" + "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/exports.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" ) set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS - "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -l . <OBJECTS>" + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -l . <AIX_EXPORTS> <OBJECTS>" "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") unset(_OBJECTS) diff --git a/Modules/Platform/AIX/ExportImportList b/Modules/Platform/AIX/ExportImportList index 4f67ef5..891bce7 100755 --- a/Modules/Platform/AIX/ExportImportList +++ b/Modules/Platform/AIX/ExportImportList @@ -5,7 +5,7 @@ # This script is internal to CMake and meant only to be # invoked by CMake-generated build systems on AIX. -usage='usage: ExportImportList -o <out-file> [-l <lib>] [--] <objects>...' +usage='usage: ExportImportList -o <out-file> [-l <lib>] [-n] [--] <objects>...' die() { echo "$@" 1>&2; exit 1 @@ -14,10 +14,12 @@ die() { # Process command-line arguments. out='' lib='' +no_objects='' while test "$#" != 0; do case "$1" in -l) shift; lib="$1" ;; -o) shift; out="$1" ;; + -n) no_objects='1' ;; --) shift; break ;; -*) die "$usage" ;; *) break ;; @@ -26,23 +28,28 @@ while test "$#" != 0; do done test -n "$out" || die "$usage" -# Collect symbols exported from all object files. +# Build a temporary file that atomically replaces the output later. out_tmp="$out.tmp$$" trap 'rm -f "$out_tmp"' EXIT INT TERM -for f in "$@"; do - dump -tov -X 32_64 "$f" | - awk ' - BEGIN { - V["EXPORTED"]=" export" - V["PROTECTED"]=" protected" - } - /^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / { - if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) { - print $NF V[$(NF-1)] +> "$out_tmp" + +# Collect symbols exported from all object files. +if test -z "$no_objects"; then + for f in "$@"; do + dump -tov -X 32_64 "$f" | + awk ' + BEGIN { + V["EXPORTED"]=" export" + V["PROTECTED"]=" protected" + } + /^\[[0-9]+\]\tm +[^ ]+ +\.(text|data|bss) +[^ ]+ +(extern|weak) +(EXPORTED|PROTECTED| ) / { + if (!match($NF,/^(\.|__sinit|__sterm|__[0-9]+__)/)) { + print $NF V[$(NF-1)] + } } - } - ' -done > "$out_tmp" + ' + done >> "$out_tmp" +fi # Generate the export/import file. { diff --git a/Modules/Platform/Android/Determine-Compiler-NDK.cmake b/Modules/Platform/Android/Determine-Compiler-NDK.cmake index e009c10..f56e1d5 100644 --- a/Modules/Platform/Android/Determine-Compiler-NDK.cmake +++ b/Modules/Platform/Android/Determine-Compiler-NDK.cmake @@ -23,6 +23,7 @@ if(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED) set(_ANDROID_TOOL_CXX_COMPILER_EXTERNAL_TOOLCHAIN "") set(_ANDROID_TOOL_CXX_TOOLCHAIN_PREFIX "${CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED}/bin/${CMAKE_ANDROID_ARCH_TRIPLE}-") set(_ANDROID_TOOL_CXX_TOOLCHAIN_SUFFIX "${_ANDROID_HOST_EXT}") + set(_CMAKE_TOOLCHAIN_PREFIX "${CMAKE_ANDROID_ARCH_TRIPLE}-") return() endif() diff --git a/Modules/Platform/Windows-Clang-ASM.cmake b/Modules/Platform/Windows-Clang-ASM.cmake new file mode 100644 index 0000000..345d77d --- /dev/null +++ b/Modules/Platform/Windows-Clang-ASM.cmake @@ -0,0 +1,2 @@ +include(Platform/Windows-Clang) +__windows_compiler_clang(ASM) diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake index c17cf6d..5eddd04 100644 --- a/Modules/Platform/Windows-Clang.cmake +++ b/Modules/Platform/Windows-Clang.cmake @@ -21,7 +21,9 @@ macro(__windows_compiler_clang_gnu lang) set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") set(CMAKE_SHARED_MODULE_SUFFIX ".dll") set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib") - set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <OBJECT> -MF <DEPFILE>") + if(NOT "${lang}" STREQUAL "ASM") + set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <OBJECT> -MF <DEPFILE>") + endif() set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "") set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib") @@ -61,23 +63,25 @@ macro(__windows_compiler_clang_gnu lang) set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> -fuse-ld=lld-link -nostartfiles -nostdlib <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Xlinker /implib:<TARGET_IMPLIB> -Xlinker /pdb:<TARGET_PDB> -Xlinker /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>") - set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -Xclang -flto-visibility-public-std -D_MT -Xclang --dependent-lib=libcmt) - set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -D_DLL -D_MT -Xclang --dependent-lib=msvcrt) - set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -D_DEBUG -Xclang -flto-visibility-public-std -D_MT -Xclang --dependent-lib=libcmtd) - set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd) + if(NOT "${lang}" STREQUAL "ASM") + set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -Xclang -flto-visibility-public-std -D_MT -Xclang --dependent-lib=libcmt) + set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -D_DLL -D_MT -Xclang --dependent-lib=msvcrt) + set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -D_DEBUG -Xclang -flto-visibility-public-std -D_MT -Xclang --dependent-lib=libcmtd) + set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd) - if(CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT) - set(__ADDED_FLAGS "") - set(__ADDED_FLAGS_DEBUG "") - else() - set(__ADDED_FLAGS_DEBUG "-D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd") - set(__ADDED_FLAGS "-D_DLL -D_MT -Xclang --dependent-lib=msvcrt") - endif() + if(CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT) + set(__ADDED_FLAGS "") + set(__ADDED_FLAGS_DEBUG "") + else() + set(__ADDED_FLAGS_DEBUG "-D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd") + set(__ADDED_FLAGS "-D_DLL -D_MT -Xclang --dependent-lib=msvcrt") + endif() - string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -Xclang -gcodeview -O0 ${__ADDED_FLAGS_DEBUG}") - string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG ${__ADDED_FLAGS}") - string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG ${__ADDED_FLAGS}") - string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG -Xclang -gcodeview ${__ADDED_FLAGS}") + string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g -Xclang -gcodeview -O0 ${__ADDED_FLAGS_DEBUG}") + string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG ${__ADDED_FLAGS}") + string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3 -DNDEBUG ${__ADDED_FLAGS}") + string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG -Xclang -gcodeview ${__ADDED_FLAGS}") + endif() set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ") set(CMAKE_PCH_EXTENSION .pch) diff --git a/Modules/Platform/Windows-GNU-ASM.cmake b/Modules/Platform/Windows-GNU-ASM.cmake new file mode 100644 index 0000000..8600892 --- /dev/null +++ b/Modules/Platform/Windows-GNU-ASM.cmake @@ -0,0 +1,2 @@ +include(Platform/Windows-GNU) +__windows_compiler_gnu(ASM) diff --git a/Modules/Platform/WindowsPhone-Clang-ASM.cmake b/Modules/Platform/WindowsPhone-Clang-ASM.cmake new file mode 100644 index 0000000..94f4ca7 --- /dev/null +++ b/Modules/Platform/WindowsPhone-Clang-ASM.cmake @@ -0,0 +1 @@ +include(Platform/Windows-Clang-ASM) diff --git a/Modules/Platform/WindowsPhone-GNU-ASM.cmake b/Modules/Platform/WindowsPhone-GNU-ASM.cmake new file mode 100644 index 0000000..140eea7 --- /dev/null +++ b/Modules/Platform/WindowsPhone-GNU-ASM.cmake @@ -0,0 +1 @@ +include(Platform/Windows-GNU-ASM) diff --git a/Modules/Platform/WindowsStore-Clang-ASM.cmake b/Modules/Platform/WindowsStore-Clang-ASM.cmake new file mode 100644 index 0000000..94f4ca7 --- /dev/null +++ b/Modules/Platform/WindowsStore-Clang-ASM.cmake @@ -0,0 +1 @@ +include(Platform/Windows-Clang-ASM) diff --git a/Modules/Platform/WindowsStore-GNU-ASM.cmake b/Modules/Platform/WindowsStore-GNU-ASM.cmake new file mode 100644 index 0000000..140eea7 --- /dev/null +++ b/Modules/Platform/WindowsStore-GNU-ASM.cmake @@ -0,0 +1 @@ +include(Platform/Windows-GNU-ASM) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0fc9864..76adb83 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 16) -set(CMake_VERSION_PATCH 20200202) +set(CMake_VERSION_PATCH 20200204) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 951c65f..5de4a6f 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -178,6 +178,9 @@ int cmCPackOSXX11Generator::PackageFiles() int cmCPackOSXX11Generator::InitializeInternal() { + cmCPackLogger(cmCPackLog::LOG_WARNING, + "The OSXX11 generator is deprecated " + "and will be removed in a future version.\n"); cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackOSXX11Generator::Initialize()" << std::endl); std::vector<std::string> path; diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 12ea97b..f51ea42 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -321,6 +321,9 @@ int cmCPackPackageMakerGenerator::PackageFiles() int cmCPackPackageMakerGenerator::InitializeInternal() { + cmCPackLogger(cmCPackLog::LOG_WARNING, + "The PackageMaker generator is deprecated " + "and will be removed in a future version.\n"); this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr"); // Starting with Xcode 4.3, PackageMaker is a separate app, and you diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index e70bc5a..78c68be 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -410,10 +410,15 @@ int cmCTestTestHandler::ProcessHandler() auto clock_finish = std::chrono::steady_clock::now(); + bool noTestsFoundError = false; if (passed.size() + failed.size() == 0) { - if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels()) { + if (!this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels() && + this->CTest->GetNoTestsMode() != cmCTest::NoTests::Ignore) { cmCTestLog(this->CTest, ERROR_MESSAGE, "No tests were found!!!" << std::endl); + if (this->CTest->GetNoTestsMode() == cmCTest::NoTests::Error) { + noTestsFoundError = true; + } } } else { if (this->HandlerVerbose && !passed.empty() && @@ -459,6 +464,12 @@ int cmCTestTestHandler::ProcessHandler() this->LogFile = nullptr; return -1; } + + if (noTestsFoundError) { + this->LogFile = nullptr; + return -1; + } + this->LogFile = nullptr; return 0; } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index f8d1aa7..d29b2ac 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -200,7 +200,8 @@ bool cmArchiveWrite::Add(std::string path, size_t skip, const char* prefix, bool cmArchiveWrite::AddPath(const char* path, size_t skip, const char* prefix, bool recursive) { - if (strcmp(path, ".") != 0 || this->Format != "zip") { + if (strcmp(path, ".") != 0 || + (this->Format != "zip" && this->Format != "7zip")) { if (!this->AddFile(path, skip, prefix)) { return false; } @@ -212,7 +213,7 @@ bool cmArchiveWrite::AddPath(const char* path, size_t skip, const char* prefix, cmsys::Directory d; if (d.Load(path)) { std::string next = cmStrCat(path, '/'); - if (next == "./" && this->Format == "zip") { + if (next == "./" && (this->Format == "zip" || this->Format == "7zip")) { next.clear(); } std::string::size_type end = next.size(); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 22a6e38..04f75bd 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -208,6 +208,8 @@ struct cmCTest::Private bool OutputColorCode = cmCTest::ColoredOutputSupportedByConsole(); std::map<std::string, std::string> Definitions; + + cmCTest::NoTests NoTestsMode = cmCTest::NoTests::Legacy; }; struct tm* cmCTest::GetNightlyTime(std::string const& str, bool tomorrowtag) @@ -2059,6 +2061,19 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, this->SetNotesFiles(args[i].c_str()); } + const std::string noTestsPrefix = "--no-tests="; + if (cmHasPrefix(arg, noTestsPrefix)) { + const std::string noTestsMode = arg.substr(noTestsPrefix.length()); + if (noTestsMode == "error") { + this->Impl->NoTestsMode = cmCTest::NoTests::Error; + } else if (noTestsMode != "ignore") { + errormsg = "'--no-tests=' given unknown value '" + noTestsMode + "'"; + return false; + } else { + this->Impl->NoTestsMode = cmCTest::NoTests::Ignore; + } + } + // options that control what tests are run if (this->CheckArgument(arg, "-I", "--tests-information") && i < args.size() - 1) { @@ -2896,6 +2911,11 @@ cmCTest::Repeat cmCTest::GetRepeatMode() const return this->Impl->RepeatMode; } +cmCTest::NoTests cmCTest::GetNoTestsMode() const +{ + return this->Impl->NoTestsMode; +} + void cmCTest::SetBuildID(const std::string& id) { this->Impl->BuildID = id; diff --git a/Source/cmCTest.h b/Source/cmCTest.h index e0ae100..7f8f913 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -442,6 +442,14 @@ public: }; Repeat GetRepeatMode() const; + enum class NoTests + { + Legacy, + Error, + Ignore + }; + NoTests GetNoTestsMode() const; + void GenerateSubprojectsOutput(cmXMLWriter& xml); std::vector<std::string> GetLabelsForSubprojects(); diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index b8d8b96..5ff6f8c 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -17,6 +17,7 @@ #include "cmSourceFile.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" +#include "cmTarget.h" cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt) : GeneratorTarget(gt) @@ -216,6 +217,20 @@ std::string cmCommonTargetGenerator::GetManifests(const std::string& config) return cmJoin(manifests, " "); } +std::string cmCommonTargetGenerator::GetAIXExports(std::string const&) +{ + std::string aixExports; + if (this->GeneratorTarget->Target->IsAIX()) { + if (const char* exportAll = + this->GeneratorTarget->GetProperty("AIX_EXPORT_ALL_SYMBOLS")) { + if (cmIsOff(exportAll)) { + aixExports = "-n"; + } + } + } + return aixExports; +} + void cmCommonTargetGenerator::AppendOSXVerFlag(std::string& flags, const std::string& lang, const char* name, bool so) diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h index 2796470..b40a2ed 100644 --- a/Source/cmCommonTargetGenerator.h +++ b/Source/cmCommonTargetGenerator.h @@ -55,6 +55,7 @@ protected: std::string GetDefines(const std::string& l, const std::string& config); std::string GetIncludes(std::string const& l, const std::string& config); std::string GetManifests(const std::string& config); + std::string GetAIXExports(std::string const& config); std::vector<std::string> GetLinkedTargetDirectories( const std::string& config) const; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index f6613d0..f7694ff 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -485,6 +485,9 @@ void cmGlobalNinjaGenerator::Generate() msg.str()); return; } + if (!this->InspectConfigTypeVariables()) { + return; + } if (!this->OpenBuildFileStreams()) { return; } @@ -544,6 +547,8 @@ void cmGlobalNinjaGenerator::CleanMetaData() auto run_ninja_tool = [this](std::vector<char const*> const& args) { std::vector<std::string> command; command.push_back(this->NinjaCommand); + command.emplace_back("-C"); + command.emplace_back(this->GetCMakeInstance()->GetHomeOutputDirectory()); command.emplace_back("-t"); for (auto const& arg : args) { command.emplace_back(arg); @@ -885,6 +890,28 @@ bool cmGlobalNinjaGenerator::OpenFileStream( return true; } +cm::optional<std::set<std::string>> cmGlobalNinjaGenerator::ListSubsetWithAll( + const std::set<std::string>& defaults, const std::vector<std::string>& items) +{ + std::set<std::string> result; + + for (auto const& item : items) { + if (item == "all") { + if (items.size() == 1) { + result = defaults; + } else { + return cm::nullopt; + } + } else if (defaults.count(item)) { + result.insert(item); + } else { + return cm::nullopt; + } + } + + return cm::make_optional(result); +} + void cmGlobalNinjaGenerator::CloseBuildFileStreams() { if (this->BuildFileStream) { @@ -1188,6 +1215,7 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias, // uses the output as an alias. for (std::string const& output : outputs) { this->TargetAliases[output].GeneratorTarget = nullptr; + this->DefaultTargetAliases[output].GeneratorTarget = nullptr; for (const std::string& config2 : this->Makefiles.front()->GetGeneratorConfigs()) { this->Configs[config2].TargetAliases[output].GeneratorTarget = nullptr; @@ -1199,18 +1227,28 @@ void cmGlobalNinjaGenerator::AddTargetAlias(const std::string& alias, TargetAlias ta; ta.GeneratorTarget = target; ta.Config = config; - std::pair<TargetAliasMap::iterator, bool> newAliasGlobal = + + auto newAliasGlobal = this->TargetAliases.insert(std::make_pair(buildAlias, ta)); if (newAliasGlobal.second && newAliasGlobal.first->second.GeneratorTarget != target) { newAliasGlobal.first->second.GeneratorTarget = nullptr; } - std::pair<TargetAliasMap::iterator, bool> newAliasConfig = + + auto newAliasConfig = this->Configs[config].TargetAliases.insert(std::make_pair(outputPath, ta)); if (newAliasConfig.second && newAliasConfig.first->second.GeneratorTarget != target) { newAliasConfig.first->second.GeneratorTarget = nullptr; } + if (this->DefaultConfigs.count(config)) { + auto newAliasDefaultGlobal = + this->DefaultTargetAliases.insert(std::make_pair(outputPath, ta)); + if (newAliasDefaultGlobal.second && + newAliasDefaultGlobal.first->second.GeneratorTarget != target) { + newAliasDefaultGlobal.first->second.GeneratorTarget = nullptr; + } + } } void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os) @@ -1235,7 +1273,7 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os) build.Outputs.front() = ta.first; build.ExplicitDeps.clear(); if (ta.second.Config == "all") { - for (auto const& config : this->GetCrossConfigs("")) { + for (auto const& config : this->CrossConfigs) { this->AppendTargetOutputs(ta.second.GeneratorTarget, build.ExplicitDeps, config); } @@ -1245,7 +1283,7 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os) } this->WriteBuild(this->EnableCrossConfigBuild() && (ta.second.Config == "all" || - this->GetCrossConfigs("").count(ta.second.Config)) + this->CrossConfigs.count(ta.second.Config)) ? os : *this->GetImplFileStream(ta.second.Config), build); @@ -1273,10 +1311,8 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os) } } - auto const* defaultConfig = this->GetDefaultBuildAlias(); - if (defaultConfig) { - std::string config = defaultConfig; - for (auto const& ta : this->Configs[config].TargetAliases) { + if (!this->DefaultConfigs.empty()) { + for (auto const& ta : this->DefaultTargetAliases) { // Don't write ambiguous aliases. if (!ta.second.GeneratorTarget) { continue; @@ -1290,13 +1326,7 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os) build.Outputs.front() = ta.first; build.ExplicitDeps.clear(); - if (config == "all") { - for (auto const& config2 : - this->Makefiles.front()->GetGeneratorConfigs()) { - this->AppendTargetOutputs(ta.second.GeneratorTarget, - build.ExplicitDeps, config2); - } - } else { + for (auto const& config : this->DefaultConfigs) { this->AppendTargetOutputs(ta.second.GeneratorTarget, build.ExplicitDeps, config); } @@ -1347,7 +1377,7 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os) } // Write target this->WriteBuild(this->EnableCrossConfigBuild() && - this->GetCrossConfigs("").count(config) + this->CrossConfigs.count(config) ? os : *this->GetImplFileStream(config), build); @@ -1363,11 +1393,12 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os) this->WriteBuild(*this->GetConfigFileStream(config), build); } - auto const* defaultConfig = this->GetDefaultBuildAlias(); - if (defaultConfig) { - std::string config = defaultConfig; - build.ExplicitDeps = { this->BuildAlias( - this->ConvertToNinjaPath(currentBinaryDir + "/all"), config) }; + if (!this->DefaultFileConfig.empty()) { + build.ExplicitDeps.clear(); + for (auto const& config : this->DefaultConfigs) { + build.ExplicitDeps.push_back(this->BuildAlias( + this->ConvertToNinjaPath(currentBinaryDir + "/all"), config)); + } build.Outputs.front() = this->ConvertToNinjaPath(currentBinaryDir + "/all"); this->WriteBuild(*this->GetDefaultFileStream(), build); @@ -1377,7 +1408,7 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os) // Add target for all configs if (this->EnableCrossConfigBuild()) { build.ExplicitDeps.clear(); - for (auto const& config : this->GetCrossConfigs("")) { + for (auto const& config : this->CrossConfigs) { build.ExplicitDeps.push_back(this->BuildAlias( this->ConvertToNinjaPath(currentBinaryDir + "/all"), config)); } @@ -1524,7 +1555,7 @@ void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os) this->WriteTargetDefault(*this->GetConfigFileStream(config)); } - if (this->GetDefaultBuildType()) { + if (!this->DefaultFileConfig.empty()) { this->WriteTargetDefault(*this->GetDefaultFileStream()); } } @@ -1832,7 +1863,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os) build.ExplicitDeps.clear(); if (additionalFiles) { - for (auto const& config : this->GetCrossConfigs("")) { + for (auto const& config : this->CrossConfigs) { build.ExplicitDeps.push_back(this->BuildAlias( this->NinjaOutputPath(this->GetAdditionalCleanTargetName()), config)); @@ -1840,7 +1871,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os) } std::vector<std::string> byproducts; - for (auto const& config : this->GetCrossConfigs("")) { + for (auto const& config : this->CrossConfigs) { byproducts.push_back( this->BuildAlias(GetByproductsForCleanTargetName(), config)); } @@ -1867,11 +1898,12 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os) this->WriteBuild(*this->GetConfigFileStream(config), build); } - auto const* defaultConfig = this->GetDefaultBuildAlias(); - if (defaultConfig) { - std::string config = defaultConfig; - build.ExplicitDeps.front() = this->BuildAlias( - this->NinjaOutputPath(this->GetCleanTargetName()), config); + if (!this->DefaultConfigs.empty()) { + build.ExplicitDeps.clear(); + for (auto const& config : this->DefaultConfigs) { + build.ExplicitDeps.push_back(this->BuildAlias( + this->NinjaOutputPath(this->GetCleanTargetName()), config)); + } this->WriteBuild(*this->GetDefaultFileStream(), build); } } @@ -2319,8 +2351,7 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile( bool cmGlobalNinjaGenerator::EnableCrossConfigBuild() const { - return this->IsMultiConfig() && - this->Makefiles.front()->IsOn("CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE"); + return !this->CrossConfigs.empty(); } int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg, @@ -2415,11 +2446,10 @@ void cmGlobalNinjaGenerator::AppendDirectoryForConfig( } std::set<std::string> cmGlobalNinjaGenerator::GetCrossConfigs( - const std::string& /*fileConfig*/) const + const std::string& fileConfig) const { - std::set<std::string> result; - result.insert( - this->Makefiles.front()->GetSafeDefinition("CMAKE_BUILD_TYPE")); + auto result = this->CrossConfigs; + result.insert(fileConfig); return result; } @@ -2455,15 +2485,14 @@ bool cmGlobalNinjaMultiGenerator::OpenBuildFileStreams() return false; } - auto const* defaultConfig = this->GetDefaultBuildType(); - if (defaultConfig) { + if (!this->DefaultFileConfig.empty()) { if (!this->OpenFileStream(this->DefaultFileStream, NINJA_BUILD_FILE)) { return false; } *this->DefaultFileStream << "# This file is a convenience file generated by\n" - << "# CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE.\n\n" - << "include " << GetNinjaImplFilename(defaultConfig) << "\n\n"; + << "# CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG.\n\n" + << "include " << GetNinjaImplFilename(this->DefaultFileConfig) << "\n\n"; } // Write a comment about this file. @@ -2555,8 +2584,7 @@ void cmGlobalNinjaMultiGenerator::AddRebuildManifestOutputs( outputs.push_back(this->NinjaOutputPath(GetNinjaImplFilename(config))); outputs.push_back(this->NinjaOutputPath(GetNinjaConfigFilename(config))); } - if (this->Makefiles.front()->GetDefinition( - "CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE")) { + if (!this->DefaultFileConfig.empty()) { outputs.push_back(this->NinjaOutputPath(NINJA_BUILD_FILE)); } } @@ -2571,43 +2599,70 @@ void cmGlobalNinjaMultiGenerator::GetQtAutoGenConfigs( } } -const char* cmGlobalNinjaMultiGenerator::GetDefaultBuildType() const +bool cmGlobalNinjaMultiGenerator::InspectConfigTypeVariables() { - return this->Makefiles.front()->GetDefinition( - "CMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE"); -} + auto configsVec = this->Makefiles.front()->GetGeneratorConfigs(); + std::set<std::string> configs(configsVec.cbegin(), configsVec.cend()); -const char* cmGlobalNinjaMultiGenerator::GetDefaultBuildAlias() const -{ - if (this->EnableCrossConfigBuild()) { - auto const* alias = this->Makefiles.front()->GetDefinition( - "CMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS"); - if (alias) { - return alias; - } + this->DefaultFileConfig = this->Makefiles.front()->GetSafeDefinition( + "CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG"); + if (!this->DefaultFileConfig.empty() && + !configs.count(this->DefaultFileConfig)) { + std::ostringstream msg; + msg << "The configuration specified by " + << "CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG (" << this->DefaultFileConfig + << ") is not present in CMAKE_CONFIGURATION_TYPES"; + this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, + msg.str()); + return false; } - return this->GetDefaultBuildType(); -} + std::vector<std::string> crossConfigsVec; + cmExpandList( + this->Makefiles.front()->GetSafeDefinition("CMAKE_NMC_CROSS_CONFIGS"), + crossConfigsVec); + auto crossConfigs = ListSubsetWithAll(configs, crossConfigsVec); + if (!crossConfigs) { + std::ostringstream msg; + msg << "CMAKE_NMC_CROSS_CONFIGS is not a subset of " + << "CMAKE_CONFIGURATION_TYPES"; + this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, + msg.str()); + return false; + } + this->CrossConfigs = *crossConfigs; -std::set<std::string> cmGlobalNinjaMultiGenerator::GetCrossConfigs( - const std::string& fileConfig) const -{ - std::vector<std::string> configs; - if (this->EnableCrossConfigBuild()) { - auto configsValue = this->Makefiles.front()->GetSafeDefinition( - "CMAKE_NINJA_MULTI_CROSS_CONFIGS"); - if (!configsValue.empty()) { - cmExpandList(configsValue, configs); - } else { - configs = this->Makefiles.front()->GetGeneratorConfigs(); - } + auto defaultConfigsString = + this->Makefiles.front()->GetSafeDefinition("CMAKE_NMC_DEFAULT_CONFIGS"); + if (defaultConfigsString.empty()) { + defaultConfigsString = this->DefaultFileConfig; + } + if (!defaultConfigsString.empty() && + (this->DefaultFileConfig.empty() || this->CrossConfigs.empty())) { + std::ostringstream msg; + msg << "CMAKE_NMC_DEFAULT_CONFIGS cannot be used without " + << "CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG or " + << "CMAKE_NMC_CROSS_CONFIGS"; + this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, + msg.str()); + return false; } - std::set<std::string> result(configs.cbegin(), configs.cend()); - if (!fileConfig.empty()) { - result.insert(fileConfig); + std::vector<std::string> defaultConfigsVec; + cmExpandList(defaultConfigsString, defaultConfigsVec); + if (!this->DefaultFileConfig.empty()) { + auto defaultConfigs = ListSubsetWithAll( + this->GetCrossConfigs(this->DefaultFileConfig), defaultConfigsVec); + if (!defaultConfigs) { + std::ostringstream msg; + msg << "CMAKE_NMC_DEFAULT_CONFIGS is not a subset of " + << "CMAKE_NMC_CROSS_CONFIGS"; + this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, + msg.str()); + return false; + } + this->DefaultConfigs = *defaultConfigs; } - return result; + return true; } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 9d5521a..3b45249 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -15,6 +15,8 @@ #include <utility> #include <vector> +#include <cm/optional> + #include "cm_codecvt.hxx" #include "cmGeneratedFileStream.h" @@ -408,12 +410,7 @@ public: bool EnableCrossConfigBuild() const; - virtual const char* GetDefaultBuildType() const { return nullptr; } - - virtual const char* GetDefaultBuildAlias() const { return nullptr; } - - virtual std::set<std::string> GetCrossConfigs( - const std::string& fileConfig) const; + std::set<std::string> GetCrossConfigs(const std::string& config) const; protected: void Generate() override; @@ -426,6 +423,16 @@ protected: bool OpenFileStream(std::unique_ptr<cmGeneratedFileStream>& stream, const std::string& name); + static cm::optional<std::set<std::string>> ListSubsetWithAll( + const std::set<std::string>& defaults, + const std::vector<std::string>& items); + + virtual bool InspectConfigTypeVariables() { return true; } + + std::set<std::string> CrossConfigs; + std::set<std::string> DefaultConfigs; + std::string DefaultFileConfig; + private: std::string GetEditCacheCommand() const override; bool FindMakeProgram(cmMakefile* mf) override; @@ -504,6 +511,7 @@ private: }; using TargetAliasMap = std::map<std::string, TargetAlias>; TargetAliasMap TargetAliases; + TargetAliasMap DefaultTargetAliases; /// the local cache for calls to ConvertToNinjaPath mutable std::unordered_map<std::string, std::string> ConvertToNinjaPathCache; @@ -623,12 +631,7 @@ public: void GetQtAutoGenConfigs(std::vector<std::string>& configs) const override; - const char* GetDefaultBuildType() const override; - - const char* GetDefaultBuildAlias() const override; - - std::set<std::string> GetCrossConfigs( - const std::string& fileConfig) const override; + bool InspectConfigTypeVariables() override; protected: bool OpenBuildFileStreams() override; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 1df5410..0471a45 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -196,6 +196,8 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule( this->CreateObjectLists(useLinkScript, false, useResponseFileForObjects, buildObjs, depends, useWatcomQuote); + std::string const& aixExports = this->GetAIXExports(this->GetConfigName()); + cmRulePlaceholderExpander::RuleVariables vars; std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); @@ -219,6 +221,7 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule( cmOutputConverter::SHELL); vars.Language = linkLanguage.c_str(); + vars.AIXExports = aixExports.c_str(); vars.Objects = buildObjs.c_str(); vars.ObjectDir = objectDir.c_str(); vars.Target = target.c_str(); diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 357e273..d3f3a4f 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -727,6 +727,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( cmOutputConverter::SHELL); } + std::string const& aixExports = this->GetAIXExports(this->GetConfigName()); + // maybe create .def file from list of objects this->GenDefFile(real_link_commands); @@ -756,6 +758,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( vars.CMTargetType = cmState::GetTargetTypeName(this->GeneratorTarget->GetType()); vars.Language = linkLanguage.c_str(); + vars.AIXExports = aixExports.c_str(); vars.Objects = buildObjs.c_str(); std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index a2fa3b1..d7e2de6 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -788,7 +788,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( driverMode = lang == "C" ? "gcc" : "g++"; } run_iwyu += this->LocalGenerator->EscapeForShell( - cmStrCat(tidy, ";--driver-mode=", driverMode)); + cmStrCat(tidy, ";--extra-arg-before=--driver-mode=", driverMode)); } if (cpplint && *cpplint) { run_iwyu += " --cpplint="; diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 437548a..ff79a17 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -286,6 +286,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile, std::string lang = this->TargetLinkLanguage(config); vars.Language = config.c_str(); + vars.AIXExports = "$AIX_EXPORTS"; if (this->TargetLinkLanguage(config) == "Swift") { vars.SwiftLibraryName = "$SWIFT_LIBRARY_NAME"; @@ -550,16 +551,23 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd( linkCmds.push_back(cmakeCommand + " -E touch $TARGET_FILE"); } #endif - return linkCmds; - } + } break; case cmStateEnums::SHARED_LIBRARY: case cmStateEnums::MODULE_LIBRARY: + break; case cmStateEnums::EXECUTABLE: + if (this->TargetLinkLanguage(config) == "Swift") { + if (this->GeneratorTarget->IsExecutableWithExports()) { + const std::string flags = + this->Makefile->GetSafeDefinition("CMAKE_EXE_EXPORTS_Swift_FLAG"); + cmExpandList(flags, linkCmds); + } + } break; default: assert(false && "Unexpected target type"); } - return std::vector<std::string>(); + return linkCmds; } void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement( @@ -955,6 +963,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( vars["LINK_FLAGS"] = globalGen->EncodeLiteral(vars["LINK_FLAGS"]); vars["MANIFESTS"] = this->GetManifests(config); + vars["AIX_EXPORTS"] = this->GetAIXExports(config); vars["LINK_PATH"] = frameworkPath + linkPath; std::string lwyuFlags; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 5e8cc7d..0e74678 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -767,7 +767,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, driverMode = lang == "C" ? "gcc" : "g++"; } run_iwyu += this->GetLocalGenerator()->EscapeForShell( - cmStrCat(tidy, ";--driver-mode=", driverMode)); + cmStrCat(tidy, ";--extra-arg-before=--driver-mode=", driverMode)); } if (cpplint && *cpplint) { run_iwyu += " --cpplint="; diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 0493c0f..43e159c 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1189,8 +1189,15 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() const std::string outputFile = cmStrCat(this->Dir.Build, "/", timestampFileName); this->AutogenTarget.DepFile = cmStrCat(this->Dir.Build, "/deps"); + auto relativeBinaryDir = cmSystemTools::RelativePath( + this->LocalGen->GetBinaryDirectory(), + this->LocalGen->GetCurrentBinaryDirectory()); + if (!relativeBinaryDir.empty()) { + relativeBinaryDir = cmStrCat(relativeBinaryDir, "/"); + } this->AutogenTarget.DepFileRuleName = - cmStrCat(this->GenTarget->GetName(), "_autogen/", timestampFileName); + cmStrCat(relativeBinaryDir, this->GenTarget->GetName(), "_autogen/", + timestampFileName); commandLines.push_back(cmMakeCommandLine( { cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile })); diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx index 0a1d109..5ab1b3a 100644 --- a/Source/cmRulePlaceholderExpander.cxx +++ b/Source/cmRulePlaceholderExpander.cxx @@ -85,6 +85,11 @@ std::string cmRulePlaceholderExpander::ExpandRuleVariable( return replaceValues.ObjectsQuoted; } } + if (replaceValues.AIXExports) { + if (variable == "AIX_EXPORTS") { + return replaceValues.AIXExports; + } + } if (replaceValues.Defines && variable == "DEFINES") { return replaceValues.Defines; } diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h index 8f36196..09e8a3b 100644 --- a/Source/cmRulePlaceholderExpander.h +++ b/Source/cmRulePlaceholderExpander.h @@ -36,6 +36,7 @@ public: const char* TargetVersionMajor; const char* TargetVersionMinor; const char* Language; + const char* AIXExports; const char* Objects; const char* Target; const char* LinkLibraries; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index a0c217b..d0b6f10 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -491,6 +491,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, } if (impl->TargetType == cmStateEnums::SHARED_LIBRARY || impl->TargetType == cmStateEnums::EXECUTABLE) { + initProp("AIX_EXPORT_ALL_SYMBOLS"); initProp("WINDOWS_EXPORT_ALL_SYMBOLS"); } diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 9b45bb0..fbdf75a 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -144,6 +144,8 @@ static const char* cmDocumentationOptions[][2] = { { "--http1.0", "Submit using HTTP 1.0." }, { "--no-compress-output", "Do not compress test output when submitting." }, { "--print-labels", "Print all available test labels." }, + { "--no-tests=<[error|ignore]>", + "Regard no tests found either as 'error' or 'ignore' it." }, { nullptr, nullptr } }; diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index 21b265c..a3c9946 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 3.8) project(Assembler C) message("CTEST_FULL_OUTPUT ") set(CMAKE_VERBOSE_MAKEFILE 1) @@ -22,7 +22,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND set(SRCS main.s) add_custom_command( OUTPUT main.s - COMMAND ${CMAKE_C_COMPILER} ${C_FLAGS} -S ${CMAKE_CURRENT_SOURCE_DIR}/main.c -o main.s + COMMAND ${CMAKE_C_COMPILER} ${C_FLAGS} + "$<$<CONFIG:Debug>:${CMAKE_C_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL}>" + "$<$<NOT:$<CONFIG:Debug>>:${CMAKE_C_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL}>" + -S ${CMAKE_CURRENT_SOURCE_DIR}/main.c -o main.s + COMMAND_EXPAND_LISTS DEPENDS main.c VERBATIM ) diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-result.txt b/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-stdout.txt b/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-stdout.txt new file mode 100644 index 0000000..760ba3c --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicit-build-stdout.txt @@ -0,0 +1 @@ +ERROR: Undefined symbol: .AIXNotExported diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicit.cmake b/Tests/RunCMake/AutoExportDll/AIXExportExplicit.cmake new file mode 100644 index 0000000..d23b172 --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicit.cmake @@ -0,0 +1,7 @@ +enable_language(C) + +set(CMAKE_AIX_EXPORT_ALL_SYMBOLS OFF) +add_library(AIXExportExplicitLib SHARED AIXExportExplicitLib.c) +add_executable(AIXExportExplicitMain AIXExportExplicitMain.c) +target_link_options(AIXExportExplicitLib PRIVATE LINKER:-bE:${CMAKE_CURRENT_SOURCE_DIR}/AIXExportExplicitLib.exp) +target_link_libraries(AIXExportExplicitMain PRIVATE AIXExportExplicitLib) diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.c b/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.c new file mode 100644 index 0000000..58fd5ac --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.c @@ -0,0 +1,8 @@ +int AIXNotExported(void) +{ + return 0; +} +int AIXExportedSymbol(void) +{ + return 0; +} diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.exp b/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.exp new file mode 100644 index 0000000..9eb7bf8 --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicitLib.exp @@ -0,0 +1 @@ +AIXExportedSymbol diff --git a/Tests/RunCMake/AutoExportDll/AIXExportExplicitMain.c b/Tests/RunCMake/AutoExportDll/AIXExportExplicitMain.c new file mode 100644 index 0000000..ad9c8ec --- /dev/null +++ b/Tests/RunCMake/AutoExportDll/AIXExportExplicitMain.c @@ -0,0 +1,7 @@ +extern int AIXNotExported(void); +extern int AIXExportedSymbol(void); + +int main(void) +{ + return AIXNotExported() + AIXExportedSymbol(); +} diff --git a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake index 6c9be4b..75130f2 100644 --- a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake +++ b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake @@ -55,3 +55,14 @@ if(EXPORTS) message(SEND_ERROR "\"${EXPORTS_DEF}\" has been updated.") endif() endif() + +function(run_AIXExportExplicit) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/AIXExpotExplicit-build") + run_cmake(AIXExportExplicit) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OUTPUT_MERGE TRUE) + run_cmake_command(AIXExportExplicit-build ${CMAKE_COMMAND} --build . --config Debug) +endfunction() +if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + run_AIXExportExplicit() +endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index ad70a34..e9f8bca 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -614,7 +614,10 @@ endif() add_RunCMake_test_group(CPack "${cpack_tests}") # add a test to make sure symbols are exported from a shared library # for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used -add_RunCMake_test(AutoExportDll -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID}) +add_RunCMake_test(AutoExportDll + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} + -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID} + ) add_RunCMake_test(AndroidMK) diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index b2de596..9b9ae65 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -314,5 +314,34 @@ function(run_ShowOnly) endfunction() run_ShowOnly() +function(run_NoTests) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/NoTests) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "") + run_cmake_command(no-tests_ignore ${CMAKE_CTEST_COMMAND} --no-tests=ignore) + run_cmake_command(no-tests_error ${CMAKE_CTEST_COMMAND} --no-tests=error) + run_cmake_command(no-tests_bad ${CMAKE_CTEST_COMMAND} --no-tests=bad) + run_cmake_command(no-tests_legacy ${CMAKE_CTEST_COMMAND}) + file(WRITE "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake" " + set(CTEST_COMMAND \"${CMAKE_CTEST_COMMAND}\") + set(CTEST_SOURCE_DIRECTORY \"${RunCMake_SOURCE_DIR}\") + set(CTEST_BINARY_DIRECTORY \"${RunCMake_TEST_BINARY_DIR}\") + ctest_start(Experimental) + ctest_test() +") + run_cmake_command( + no-tests-script_ignore ${CMAKE_CTEST_COMMAND} --no-tests=ignore + -S "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake") + run_cmake_command( + no-tests-script_error ${CMAKE_CTEST_COMMAND} --no-tests=error + -S "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake") + run_cmake_command( + no-tests-script_legacy ${CMAKE_CTEST_COMMAND} + -S "${RunCMake_TEST_BINARY_DIR}/NoTestsScript.cmake") +endfunction() +run_NoTests() + # Check the configuration type variable is passed run_ctest(check-configuration-type) diff --git a/Tests/RunCMake/CTestCommandLine/no-tests-script_error-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests-script_error-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests-script_error-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestCommandLine/no-tests-script_error-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests-script_error-stderr.txt new file mode 100644 index 0000000..a7c4b11 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests-script_error-stderr.txt @@ -0,0 +1 @@ +^No tests were found!!!$ diff --git a/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-stderr.txt new file mode 100644 index 0000000..a7c4b11 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests-script_legacy-stderr.txt @@ -0,0 +1 @@ +^No tests were found!!!$ diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_bad-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_bad-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_bad-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_bad-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_bad-stderr.txt new file mode 100644 index 0000000..1703539 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_bad-stderr.txt @@ -0,0 +1 @@ +^CMake Error: '--no-tests=' given unknown value 'bad'$ diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_error-result.txt b/Tests/RunCMake/CTestCommandLine/no-tests_error-result.txt new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_error-result.txt @@ -0,0 +1 @@ +8 diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_error-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_error-stderr.txt new file mode 100644 index 0000000..eafba1c --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_error-stderr.txt @@ -0,0 +1 @@ +No tests were found!!! diff --git a/Tests/RunCMake/CTestCommandLine/no-tests_legacy-stderr.txt b/Tests/RunCMake/CTestCommandLine/no-tests_legacy-stderr.txt new file mode 100644 index 0000000..a7c4b11 --- /dev/null +++ b/Tests/RunCMake/CTestCommandLine/no-tests_legacy-stderr.txt @@ -0,0 +1 @@ +^No tests were found!!!$ diff --git a/Tests/RunCMake/NinjaMultiConfig/Common.cmake b/Tests/RunCMake/NinjaMultiConfig/Common.cmake index e13bd53..6c0d82a 100644 --- a/Tests/RunCMake/NinjaMultiConfig/Common.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/Common.cmake @@ -36,6 +36,11 @@ function(generate_output_files) if(type MATCHES "^(EXECUTABLE)$") set(exe_file " [==[$<TARGET_FILE_DIR:${tgt}>/$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>$<TARGET_FILE_SUFFIX:${tgt}>]==]") set(exe_filename " [==[$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>$<TARGET_FILE_SUFFIX:${tgt}>]==]") + + if(WIN32) + set(exe_lib_file " [==[$<TARGET_FILE_DIR:${tgt}>/$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>.lib]==]") + string(APPEND content "set(TARGET_EXE_LIB_FILE_${tgt}_$<CONFIG>${exe_lib_file})\n") + endif() else() set(exe_file) set(exe_filename) diff --git a/Tests/RunCMake/NinjaMultiConfig/CudaSimple-debug-target-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CudaSimple-debug-target-build-check.cmake index b0fca18..39db5ff 100644 --- a/Tests/RunCMake/NinjaMultiConfig/CudaSimple-debug-target-build-check.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/CudaSimple-debug-target-build-check.cmake @@ -3,6 +3,7 @@ check_files("${RunCMake_TEST_BINARY_DIR}" ${GENERATED_FILES} ${TARGET_FILE_simplecudaexe_Debug} + ${TARGET_EXE_LIB_FILE_simplecudaexe_Debug} ${TARGET_OBJECT_FILES_simplecudaexe_Debug} ${TARGET_FILE_simplecudashared_Debug} diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidCrossConfigs-result.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidCrossConfigs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidCrossConfigs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidCrossConfigs-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidCrossConfigs-stderr.txt new file mode 100644 index 0000000..6e165e8 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidCrossConfigs-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error: + CMAKE_NMC_CROSS_CONFIGS is not a subset of CMAKE_CONFIGURATION_TYPES + + +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidCrossConfigs.cmake b/Tests/RunCMake/NinjaMultiConfig/InvalidCrossConfigs.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidCrossConfigs.cmake diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultBuildFileConfig-result.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultBuildFileConfig-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultBuildFileConfig-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultBuildFileConfig-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultBuildFileConfig-stderr.txt new file mode 100644 index 0000000..114a8a3 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultBuildFileConfig-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error: + The configuration specified by CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG + \(RelWithDebInfo\) is not present in CMAKE_CONFIGURATION_TYPES + + +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultBuildFileConfig.cmake b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultBuildFileConfig.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultBuildFileConfig.cmake diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsCross-result.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsCross-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsCross-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsCross-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsCross-stderr.txt new file mode 100644 index 0000000..8d52189 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsCross-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error: + CMAKE_NMC_DEFAULT_CONFIGS is not a subset of CMAKE_NMC_CROSS_CONFIGS + + +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsCross.cmake b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsCross.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsCross.cmake diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoCross-result.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoCross-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoCross-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoCross-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoCross-stderr.txt new file mode 100644 index 0000000..f9cb56d --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoCross-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error: + CMAKE_NMC_DEFAULT_CONFIGS cannot be used without + CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG or CMAKE_NMC_CROSS_CONFIGS + + +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoCross.cmake b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoCross.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoCross.cmake diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoDefaultFile-result.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoDefaultFile-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoDefaultFile-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoDefaultFile-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoDefaultFile-stderr.txt new file mode 100644 index 0000000..f9cb56d --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoDefaultFile-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error: + CMAKE_NMC_DEFAULT_CONFIGS cannot be used without + CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG or CMAKE_NMC_CROSS_CONFIGS + + +CMake Generate step failed\. Build files cannot be regenerated correctly\.$ diff --git a/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoDefaultFile.cmake b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoDefaultFile.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/InvalidDefaultConfigsNoDefaultFile.cmake diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index b425d0b..7518395 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -76,7 +76,7 @@ endfunction() set(RunCMake_TEST_NO_CLEAN 1) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Simple-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE=RelWithDebInfo;-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON") +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=RelWithDebInfo;-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(Simple) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -108,7 +108,7 @@ run_ninja(Simple default-build-file-clean-minsizerel build.ninja clean:MinSizeRe run_ninja(Simple default-build-file-all build.ninja all) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SimpleDefaultBuildAlias-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE=Release;-DCMAKE_NINJA_MULTI_DEFAULT_BUILD_ALIAS=all;-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON") +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=Release;-DCMAKE_NMC_DEFAULT_CONFIGS=all;-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(SimpleDefaultBuildAlias) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -116,6 +116,38 @@ run_ninja(SimpleDefaultBuildAlias target build.ninja simpleexe) run_ninja(SimpleDefaultBuildAlias all build.ninja all) run_ninja(SimpleDefaultBuildAlias clean build.ninja clean) +set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SimpleDefaultBuildAliasList-build) +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=Release;-DCMAKE_NMC_DEFAULT_CONFIGS=Debug\\;Release;-DCMAKE_NMC_CROSS_CONFIGS=all") +run_cmake_configure(SimpleDefaultBuildAliasList) +unset(RunCMake_TEST_OPTIONS) +include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) +run_ninja(SimpleDefaultBuildAliasList target-configs build.ninja simpleexe) +run_ninja(SimpleDefaultBuildAliasList all-configs build.ninja all) +run_ninja(SimpleDefaultBuildAliasList all-relwithdebinfo build.ninja all:RelWithDebInfo) +run_ninja(SimpleDefaultBuildAliasList clean-configs build.ninja clean) + +unset(RunCMake_TEST_BINARY_DIR) + +set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_NMC_CROSS_CONFIGS=Debug\\;Release\\;RelWithDebInfo") +run_cmake(InvalidCrossConfigs) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=RelWithDebInfo") +run_cmake(InvalidDefaultBuildFileConfig) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=Debug\\;Release;-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=Release;-DCMAKE_NMC_DEFAULT_CONFIGS=Debug\\;Release\\;RelWithDebInfo") +run_cmake(InvalidDefaultConfigsCross) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=Debug\\;Release;-DCMAKE_NMC_DEFAULT_CONFIGS=all") +run_cmake(InvalidDefaultConfigsNoDefaultFile) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=Release;-DCMAKE_NMC_DEFAULT_CONFIGS=all") +run_cmake(InvalidDefaultConfigsNoCross) +unset(RunCMake_TEST_OPTIONS) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SimpleNoCross-build) run_cmake_configure(SimpleNoCross) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -129,7 +161,7 @@ run_ninja(SimpleNoCross all-all build-Debug.ninja all:all) run_cmake_build(SimpleNoCross all-clean Debug clean:all) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SimpleCrossConfigs-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON;-DCMAKE_NINJA_MULTI_CROSS_CONFIGS=Debug\\;Release") +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=Debug\\;Release") run_cmake_configure(SimpleCrossConfigs) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) run_ninja(SimpleCrossConfigs release-in-release-graph build-Release.ninja simpleexe) @@ -143,14 +175,14 @@ run_cmake_build(SimpleCrossConfigs all-all-in-release-graph Release all:all) run_cmake_build(SimpleCrossConfigs all-relwithdebinfo-in-release-graph Release all:RelWithDebInfo) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Framework-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON") +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(Framework) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) run_cmake_build(Framework framework Debug all) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CustomCommandGenerator-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON") +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(CustomCommandGenerator) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -167,7 +199,7 @@ run_ninja(CustomCommandGenerator release-in-debug-graph build-Debug.ninja genera run_cmake_command(CustomCommandGenerator-release-in-debug-graph-generated "${TARGET_FILE_generated_Release}") set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CustomCommandsAndTargets-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON") +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(CustomCommandsAndTargets) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -183,7 +215,7 @@ run_cmake_build(CustomCommandsAndTargets debug-targetpostbuild Debug TopTargetPo run_ninja(CustomCommandsAndTargets release-targetpostbuild build-Release.ninja SubdirTargetPostBuild) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/PostfixAndLocation-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON") +set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(PostfixAndLocation) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -198,14 +230,14 @@ run_ninja(Clean release-notall build-Release.ninja exenotall) run_cmake_build(Clean release-clean Release clean) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AdditionalCleanFiles-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON") +set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(AdditionalCleanFiles) unset(RunCMake_TEST_OPTIONS) run_cmake_build(AdditionalCleanFiles release-clean Release clean) run_ninja(AdditionalCleanFiles all-clean build-Debug.ninja clean:all) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Install-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_TEST_BINARY_DIR}/install;-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON") +set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_TEST_BINARY_DIR}/install;-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(Install) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -227,7 +259,7 @@ endif() if(CMake_TEST_Qt5) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Qt5-build) - set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON") + set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(Qt5) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-ninja-check.cmake new file mode 100644 index 0000000..8ffdd20 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-ninja-check.cmake @@ -0,0 +1,39 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${GENERATED_FILES} + + ${TARGET_FILE_simpleexe_Debug} + ${TARGET_OBJECT_FILES_simpleexe_Debug} + + ${TARGET_FILE_simpleshared_Debug} + ${TARGET_LINKER_FILE_simpleshared_Debug} + ${TARGET_OBJECT_FILES_simpleshared_Debug} + + ${TARGET_FILE_simplestatic_Debug} + ${TARGET_OBJECT_FILES_simplestatic_Debug} + + ${TARGET_OBJECT_FILES_simpleobj_Debug} + + ${TARGET_FILE_simpleexe_Release} + ${TARGET_OBJECT_FILES_simpleexe_Release} + + ${TARGET_FILE_simpleshared_Release} + ${TARGET_LINKER_FILE_simpleshared_Release} + ${TARGET_OBJECT_FILES_simpleshared_Release} + + ${TARGET_FILE_simplestatic_Release} + ${TARGET_OBJECT_FILES_simplestatic_Release} + + ${TARGET_OBJECT_FILES_simpleobj_Release} + + EXCLUDE + ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel} + ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel} + ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel} + ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel} + + ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-relwithdebinfo-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-relwithdebinfo-ninja-check.cmake new file mode 100644 index 0000000..9e5baf9 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-relwithdebinfo-ninja-check.cmake @@ -0,0 +1,46 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${GENERATED_FILES} + + ${TARGET_FILE_simpleexe_Debug} + ${TARGET_OBJECT_FILES_simpleexe_Debug} + + ${TARGET_FILE_simpleshared_Debug} + ${TARGET_LINKER_FILE_simpleshared_Debug} + ${TARGET_OBJECT_FILES_simpleshared_Debug} + + ${TARGET_FILE_simplestatic_Debug} + ${TARGET_OBJECT_FILES_simplestatic_Debug} + + ${TARGET_OBJECT_FILES_simpleobj_Debug} + + ${TARGET_FILE_simpleexe_Release} + ${TARGET_OBJECT_FILES_simpleexe_Release} + + ${TARGET_FILE_simpleshared_Release} + ${TARGET_LINKER_FILE_simpleshared_Release} + ${TARGET_OBJECT_FILES_simpleshared_Release} + + ${TARGET_FILE_simplestatic_Release} + ${TARGET_OBJECT_FILES_simplestatic_Release} + + ${TARGET_OBJECT_FILES_simpleobj_Release} + + ${TARGET_FILE_simpleexe_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo} + + ${TARGET_FILE_simpleshared_RelWithDebInfo} + ${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo} + + ${TARGET_FILE_simplestatic_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo} + + ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo} + + EXCLUDE + ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel} + ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel} + ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel} + ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-clean-configs-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-clean-configs-ninja-check.cmake new file mode 100644 index 0000000..3829d3e --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-clean-configs-ninja-check.cmake @@ -0,0 +1,32 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${GENERATED_FILES} + + ${TARGET_FILE_simpleexe_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo} + + ${TARGET_FILE_simpleshared_RelWithDebInfo} + ${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo} + + ${TARGET_FILE_simplestatic_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo} + + ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo} + + EXCLUDE + ${TARGET_OBJECT_FILES_simpleexe_Debug} + ${TARGET_OBJECT_FILES_simpleshared_Debug} + ${TARGET_OBJECT_FILES_simplestatic_Debug} + ${TARGET_OBJECT_FILES_simpleobj_Debug} + + ${TARGET_OBJECT_FILES_simpleexe_Release} + ${TARGET_OBJECT_FILES_simpleshared_Release} + ${TARGET_OBJECT_FILES_simplestatic_Release} + ${TARGET_OBJECT_FILES_simpleobj_Release} + + ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel} + ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel} + ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel} + ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-target-configs-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-target-configs-ninja-check.cmake new file mode 100644 index 0000000..b6c77ab --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-target-configs-ninja-check.cmake @@ -0,0 +1,37 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${GENERATED_FILES} + + ${TARGET_FILE_simpleexe_Debug} + ${TARGET_OBJECT_FILES_simpleexe_Debug} + + ${TARGET_FILE_simpleshared_Debug} + ${TARGET_LINKER_FILE_simpleshared_Debug} + ${TARGET_OBJECT_FILES_simpleshared_Debug} + + ${TARGET_OBJECT_FILES_simpleobj_Debug} + + ${TARGET_FILE_simpleexe_Release} + ${TARGET_OBJECT_FILES_simpleexe_Release} + + ${TARGET_FILE_simpleshared_Release} + ${TARGET_LINKER_FILE_simpleshared_Release} + ${TARGET_OBJECT_FILES_simpleshared_Release} + + ${TARGET_OBJECT_FILES_simpleobj_Release} + + EXCLUDE + ${TARGET_OBJECT_FILES_simplestatic_Debug} + + ${TARGET_OBJECT_FILES_simplestatic_Release} + + ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel} + ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel} + ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel} + ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel} + + ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo} + ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList.cmake new file mode 100644 index 0000000..2a5b708 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_SOURCE_DIR}/Simple.cmake") @@ -1234,6 +1234,29 @@ fi echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}" #----------------------------------------------------------------------------- +# Test CXX features + +cmake_cxx_features="make_unique" + +for feature in ${cmake_cxx_features}; do + eval "cmake_have_cxx_${feature}=0" + echo "Checking whether '${cmake_cxx_compiler} ${cmake_cxx_flags}' supports '${feature}'." >> cmake_bootstrap.log 2>&1 + if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags}" \ + "${cmake_source_dir}/Source/Checks/cm_cxx_${feature}.cxx" >> cmake_bootstrap.log 2>&1; then + eval "cmake_have_cxx_${feature}=1" + fi +done + +cmake_have_cxx_features="" +for feature in ${cmake_cxx_features}; do + feature_variable="cmake_have_cxx_${feature}" + eval "feature_value=\${${feature_variable}}" + if [ "${feature_value}" -eq "1" ]; then + cmake_have_cxx_features="${cmake_have_cxx_features} -DCMake_HAVE_CXX_`cmake_toupper ${feature}`=${feature_value}" + fi +done + +#----------------------------------------------------------------------------- # Test Make cmake_make_processor= @@ -1534,6 +1557,7 @@ cmake_c_flags="${cmake_c_flags} \ -I`cmake_escape \"${cmake_source_dir}/Utilities\"`" cmake_cxx_flags="${cmake_cxx_flags} \ -DCMAKE_BOOTSTRAP \ + ${cmake_have_cxx_features} \ -I`cmake_escape \"${cmake_bootstrap_dir}\"` \ -I`cmake_escape \"${cmake_source_dir}/Source\"` \ -I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \ |