Imported Upstream version 3.19.1 upstream/3.19.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:20:27 +0000 (09:20 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Fri, 8 Oct 2021 00:20:27 +0000 (09:20 +0900)
60 files changed:
Help/release/3.19.rst
Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst
Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst
Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst
Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst
Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst
Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst
Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst
Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst
Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst
Help/variable/CTEST_CUSTOM_POST_TEST.rst
Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst
Help/variable/CTEST_CUSTOM_PRE_TEST.rst
Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst
Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst
Modules/CMakeDetermineCUDACompiler.cmake
Modules/Compiler/AppleClang-C.cmake
Modules/Compiler/AppleClang-CXX.cmake
Modules/Compiler/Clang-C.cmake
Modules/Compiler/Clang-CXX.cmake
Modules/Compiler/GNU-C.cmake
Modules/Compiler/GNU-CXX.cmake
Modules/Compiler/Intel-C.cmake
Modules/Compiler/Intel-CXX.cmake
Modules/Compiler/XL-C.cmake
Modules/Compiler/XL-CXX.cmake
Modules/Compiler/XLClang-C.cmake
Modules/Compiler/XLClang-CXX.cmake
Modules/FindGTest.cmake
Source/CMakeVersion.cmake
Source/cmExtraSublimeTextGenerator.cxx
Source/cmFileTime.cxx
Source/cmFileTime.h
Source/cmGlobalGenerator.cxx
Source/cmGlobalGenerator.h
Source/cmGlobalVisualStudioGenerator.h
Source/cmGlobalXCodeGenerator.cxx
Source/cmGlobalXCodeGenerator.h
Source/cmMakefileTargetGenerator.cxx
Source/cmNinjaTargetGenerator.cxx
Source/cmTarget.cxx
Source/cmVisualStudio10TargetGenerator.cxx
Tests/RunCMake/CMP0111/CMP0111-Common.cmake
Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt
Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt
Tests/RunCMake/CMP0111/main.cpp [deleted file]
Tests/RunCMake/CMP0111/module.cpp [new file with mode: 0644]
Tests/RunCMake/ExportCompileCommands/CustomCompileRule.cmake [new file with mode: 0644]
Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake
Tests/RunCMake/add_custom_command/PrintDir.cmake [new file with mode: 0644]
Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
Tests/RunCMake/add_custom_command/WorkingDirectory-build-multi-config-stdout.txt [new file with mode: 0644]
Tests/RunCMake/add_custom_command/WorkingDirectory-build-single-config-stdout.txt [new file with mode: 0644]
Tests/RunCMake/add_custom_command/WorkingDirectory.cmake [new file with mode: 0644]
Tests/SetLang/CMakeLists.txt
Tests/SetLang/bar.c
Tests/SetLang/zoom.zzz [deleted file]

index be63e9d..a29dc07 100644 (file)
@@ -330,3 +330,21 @@ Other Changes
 * If ``CUDA`` compiler detection fails with user-specified
   :variable:`CMAKE_CUDA_ARCHITECTURES` or
   :variable:`CMAKE_CUDA_HOST_COMPILER`, an error is raised.
+
+Updates
+=======
+
+Changes made since CMake 3.19.0 include the following.
+
+3.19.1
+------
+
+* CMake 3.19.0 compiles source files with the :prop_sf:`LANGUAGE`
+  property by passing an explicit language flag such as ``-x c``.
+  This is consistent with the property's documented meaning that
+  the source file is written in the specified language.  However,
+  it can break projects that were using the property only to
+  cause the specified language's compiler to be used.  This has
+  been reverted to restore behavior from CMake 3.18 and below.
+
+* CUDA 11.1 support for Clang.
index 84ba12d..d5893c9 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_COVERAGE_EXCLUDE
 -----------------------------
 
-.. versionadded:: 3.4
-
 A list of regular expressions which will be used to exclude files by their
 path from coverage output by the :command:`ctest_coverage` command.
 
index 7191ce4..cd65ae3 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_ERROR_EXCEPTION
 ----------------------------
 
-.. versionadded:: 3.4
-
 A list of regular expressions which will be used to exclude when detecting
 error messages in build outputs by the :command:`ctest_test` command.
 
index 5d213f2..558f5e5 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_ERROR_MATCH
 ------------------------
 
-.. versionadded:: 3.4
-
 A list of regular expressions which will be used to detect error messages in
 build outputs by the :command:`ctest_test` command.
 
index 452d060..614859b 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_ERROR_POST_CONTEXT
 -------------------------------
 
-.. versionadded:: 3.4
-
 The number of lines to include as context which follow an error message by the
 :command:`ctest_test` command. The default is 10.
 
index b7717dd..74dc47a 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_ERROR_PRE_CONTEXT
 ------------------------------
 
-.. versionadded:: 3.4
-
 The number of lines to include as context which precede an error message by
 the :command:`ctest_test` command. The default is 10.
 
index 31ba099..5aeae88 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE
 --------------------------------------------
 
-.. versionadded:: 3.4
-
 When saving a failing test's output, this is the maximum size, in bytes, that
 will be collected by the :command:`ctest_test` command. Defaults to 307200
 (300 KiB).
index e5be1ad..920cb04 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS
 -------------------------------------
 
-.. versionadded:: 3.4
-
 The maximum number of errors in a single build step which will be detected.
 After this, the :command:`ctest_test` command will truncate the output.
 Defaults to 50.
index b513a5c..a1f1cc1 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS
 ---------------------------------------
 
-.. versionadded:: 3.4
-
 The maximum number of warnings in a single build step which will be detected.
 After this, the :command:`ctest_test` command will truncate the output.
 Defaults to 50.
index 08762d8..1fbb8c5 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
 --------------------------------------------
 
-.. versionadded:: 3.4
-
 When saving a passing test's output, this is the maximum size, in bytes, that
 will be collected by the :command:`ctest_test` command. Defaults to 1024
 (1 KiB).
index 405fc33..578576c 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_MEMCHECK_IGNORE
 ----------------------------
 
-.. versionadded:: 3.4
-
 A list of regular expressions to use to exclude tests during the
 :command:`ctest_memcheck` command.
 
index 5e488a7..40291fe 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_POST_MEMCHECK
 --------------------------
 
-.. versionadded:: 3.4
-
 A list of commands to run at the end of the :command:`ctest_memcheck` command.
 
 .. include:: CTEST_CUSTOM_XXX.txt
index 7ec42f7..791292c 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_POST_TEST
 ----------------------
 
-.. versionadded:: 3.4
-
 A list of commands to run at the end of the :command:`ctest_test` command.
 
 .. include:: CTEST_CUSTOM_XXX.txt
index 99e47bd..00de8aa 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_PRE_MEMCHECK
 -------------------------
 
-.. versionadded:: 3.4
-
 A list of commands to run at the start of the :command:`ctest_memcheck`
 command.
 
index 95c6314..6af7152 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_PRE_TEST
 ----------------------
 
-.. versionadded:: 3.4
-
 A list of commands to run at the start of the :command:`ctest_test` command.
 
 .. include:: CTEST_CUSTOM_XXX.txt
index 27a75d9..57222ca 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_TESTS_IGNORE
 -------------------------
 
-.. versionadded:: 3.14
-
 A list of regular expressions to use to exclude tests during the
 :command:`ctest_test` command.
 
index 539760b..a03d473 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_WARNING_EXCEPTION
 ------------------------------
 
-.. versionadded:: 3.4
-
 A list of regular expressions which will be used to exclude when detecting
 warning messages in build outputs by the :command:`ctest_build` command.
 
index 53e7707..18aa6b3 100644 (file)
@@ -1,8 +1,6 @@
 CTEST_CUSTOM_WARNING_MATCH
 --------------------------
 
-.. versionadded:: 3.4
-
 A list of regular expressions which will be used to detect warning messages in
 build outputs by the :command:`ctest_build` command.
 
index 9220551..972adef 100644 (file)
@@ -176,13 +176,15 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
     # In a non-scattered installation the following are equivalent to CMAKE_CUDA_COMPILER_TOOLKIT_ROOT.
     # We first check for a non-scattered installation to prefer it over a scattered installation.
 
-    # CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library and version file.
-    if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/version.txt")
+    # CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library.
+    if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/nvvm/libdevice")
       set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}")
-    elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/version.txt")
+    elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/nvvm/libdevice")
       set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT_LINK}/usr/lib/cuda")
-    elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/version.txt")
+    elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/nvvm/libdevice")
       set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT}/usr/lib/cuda")
+    else()
+      message(FATAL_ERROR "Couldn't find CUDA library root.")
     endif()
 
     # CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT contains the linking stubs necessary for device linking and other low-level library files.
index 26a4bbd..2794f52 100644 (file)
@@ -1,8 +1,6 @@
 include(Compiler/Clang)
 __compiler_clang(C)
 
-set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
-
 if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
   set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
   set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
index 611c674..15edc21 100644 (file)
@@ -1,8 +1,6 @@
 include(Compiler/Clang)
 __compiler_clang(CXX)
 
-set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
-
 if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
   set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
 endif()
index fb6ffa7..7c4a263 100644 (file)
@@ -8,8 +8,6 @@ endif()
 
 if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
   set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl")
-elseif("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
-  set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
 endif()
 
 if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
index 311d2b0..789e991 100644 (file)
@@ -2,9 +2,7 @@ include(Compiler/Clang)
 __compiler_clang(CXX)
 __compiler_clang_cxx_standards(CXX)
 
-
 if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
-  set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
   set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
 endif()
 
index 8105a77..ca286b3 100644 (file)
@@ -1,8 +1,6 @@
 include(Compiler/GNU)
 __compiler_gnu(C)
 
-set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
-
 if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
   set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
   set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
index 59ec056..fcaaeab 100644 (file)
@@ -1,8 +1,6 @@
 include(Compiler/GNU)
 __compiler_gnu(CXX)
 
-set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
-
 if (WIN32)
   if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
     set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport")
index 322f63d..ec3bfd8 100644 (file)
@@ -28,8 +28,6 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
 
 else()
 
-  set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
-
   if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0)
     set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
     set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
index 42adfd1..b71b946 100644 (file)
@@ -42,8 +42,6 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
 
 else()
 
-  set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
-
   if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0)
     set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20")
     set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
index 78c44d5..2077bda 100644 (file)
@@ -6,8 +6,6 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
 # -qthreaded = Ensures that all optimizations will be thread-safe
 string(APPEND CMAKE_C_FLAGS_INIT " -qthreaded")
 
-set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -qsourcetype=c)
-
 if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
   set(CMAKE_C90_STANDARD_COMPILE_OPTION "-qlanglvl=stdc89")
   set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-qlanglvl=extc89")
index 3b911f3..41e3e11 100644 (file)
@@ -6,8 +6,6 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
 # -qthreaded = Ensures that all optimizations will be thread-safe
 string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded")
 
-set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -+)
-
 if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
   if(CMAKE_SYSTEM MATCHES "Linux")
     set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
@@ -34,3 +32,6 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
 endif ()
 
 __compiler_check_default_language_standard(CXX 10.1 98)
+
+set(CMAKE_CXX_COMPILE_OBJECT
+  "<CMAKE_CXX_COMPILER> -+ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
index 1668a4d..54c18a6 100644 (file)
@@ -1,8 +1,6 @@
 include(Compiler/XLClang)
 __compiler_xlclang(C)
 
-set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
-
 if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
   set(CMAKE_C90_STANDARD_COMPILE_OPTION  "-std=c89")
   set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89")
index 02638c7..9ea3d7c 100644 (file)
@@ -1,8 +1,6 @@
 include(Compiler/XLClang)
 __compiler_xlclang(CXX)
 
-set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
-
 if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
   set(CMAKE_CXX98_STANDARD_COMPILE_OPTION  "")
   set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
index 10e31b2..53cab1a 100644 (file)
@@ -96,27 +96,6 @@ function(__gtest_find_library _name)
     mark_as_advanced(${_name})
 endfunction()
 
-function(__gtest_find_library_configuration _name _lib _cfg_suffix)
-    set(_libs ${_lib})
-    if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD")
-        # The provided /MD project files for Google Test add -md suffixes to the
-        # library names.
-        list(INSERT _libs 0 ${_lib}-md)
-    endif()
-    list(TRANSFORM _libs APPEND "${_cfg_suffix}")
-
-    __gtest_find_library(${_name} ${_libs})
-endfunction()
-
-include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
-function(__gtest_find_and_select_library_configurations _basename _lib)
-    __gtest_find_library_configuration(${_basename}_LIBRARY_RELEASE ${_lib} "")
-    __gtest_find_library_configuration(${_basename}_LIBRARY_DEBUG   ${_lib} "d")
-
-    select_library_configurations(${_basename})
-    set(${_basename}_LIBRARY ${${_basename}_LIBRARY} PARENT_SCOPE)
-endfunction()
-
 macro(__gtest_determine_windows_library_type _var)
     if(EXISTS "${${_var}}")
         file(TO_NATIVE_PATH "${${_var}}" _lib_path)
@@ -208,13 +187,18 @@ find_path(GTEST_INCLUDE_DIR gtest/gtest.h
 )
 mark_as_advanced(GTEST_INCLUDE_DIR)
 
-# Allow GTEST_LIBRARY and GTEST_MAIN_LIBRARY to be set manually, as the
-# locations of the gtest and gtest_main libraries, respectively.
-if(NOT GTEST_LIBRARY)
-    __gtest_find_and_select_library_configurations(GTEST gtest)
-endif()
-if(NOT GTEST_MAIN_LIBRARY)
-    __gtest_find_and_select_library_configurations(GTEST_MAIN gtest_main)
+if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD")
+    # The provided /MD project files for Google Test add -md suffixes to the
+    # library names.
+    __gtest_find_library(GTEST_LIBRARY            gtest-md  gtest)
+    __gtest_find_library(GTEST_LIBRARY_DEBUG      gtest-mdd gtestd)
+    __gtest_find_library(GTEST_MAIN_LIBRARY       gtest_main-md  gtest_main)
+    __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_main-mdd gtest_maind)
+else()
+    __gtest_find_library(GTEST_LIBRARY            gtest)
+    __gtest_find_library(GTEST_LIBRARY_DEBUG      gtestd)
+    __gtest_find_library(GTEST_MAIN_LIBRARY       gtest_main)
+    __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_maind)
 endif()
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
index 022b80f..676c6f1 100644 (file)
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 19)
-set(CMake_VERSION_PATCH 0)
+set(CMake_VERSION_PATCH 1)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
@@ -21,7 +21,7 @@ endif()
 
 if(NOT CMake_VERSION_NO_GIT)
   # If this source was exported by 'git archive', use its commit info.
-  set(git_info [==[222bf361e4 CMake 3.19.0]==])
+  set(git_info [==[64fb825438 CMake 3.19.1]==])
 
   # Otherwise, try to identify the current development source version.
   if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
index 1c7e4b1..7c36144 100644 (file)
@@ -349,13 +349,6 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject(
   if (language.empty()) {
     language = "C";
   }
-
-  // explicitly add the explicit language flag before any other flag
-  // this way backwards compatibility with user flags is maintained
-  if (source->GetProperty("LANGUAGE")) {
-    lg->AppendFeatureOptions(flags, language, "EXPLICIT_LANGUAGE");
-  }
-
   std::string const& config =
     lg->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
 
index 96c70fe..0606baf 100644 (file)
@@ -24,13 +24,13 @@ bool cmFileTime::Load(std::string const& fileName)
   }
 #  if CMake_STAT_HAS_ST_MTIM
   // Nanosecond resolution
-  this->NS = fst.st_mtim.tv_sec * NsPerS + fst.st_mtim.tv_nsec;
+  this->Time = fst.st_mtim.tv_sec * UtPerS + fst.st_mtim.tv_nsec;
 #  elif CMake_STAT_HAS_ST_MTIMESPEC
   // Nanosecond resolution
-  this->NS = fst.st_mtimespec.tv_sec * NsPerS + fst.st_mtimespec.tv_nsec;
+  this->Time = fst.st_mtimespec.tv_sec * UtPerS + fst.st_mtimespec.tv_nsec;
 #  else
   // Second resolution
-  this->NS = fst.st_mtime * NsPerS;
+  this->Time = fst.st_mtime * UtPerS;
 #  endif
 #else
   // Windows version.  Get the modification time from extended file attributes.
@@ -41,10 +41,11 @@ bool cmFileTime::Load(std::string const& fileName)
   }
 
   // Copy the file time to the output location.
-  this->NS = (static_cast<NSC>(fdata.ftLastWriteTime.dwHighDateTime) << 32) |
-    static_cast<NSC>(fdata.ftLastWriteTime.dwLowDateTime);
-  // The file time resolution is 100 ns.
-  this->NS *= 100;
+  using uint64 = unsigned long long;
+
+  this->Time = static_cast<TimeType>(
+    (uint64(fdata.ftLastWriteTime.dwHighDateTime) << 32) +
+    fdata.ftLastWriteTime.dwLowDateTime);
 #endif
   return true;
 }
index f496cdc..4419880 100644 (file)
 class cmFileTime
 {
 public:
-  using NSC = long long;
-  static constexpr NSC NsPerS = 1000000000;
-
+  using TimeType = long long;
+  // unit time per second
+#if !defined(_WIN32) || defined(__CYGWIN__)
+  // unit time is one nanosecond
+  static constexpr TimeType UtPerS = 1000000000;
+#else
+  // unit time is 100 nanosecond
+  static constexpr TimeType UtPerS = 10000000;
+#endif
   cmFileTime() = default;
   ~cmFileTime() = default;
 
@@ -28,22 +34,28 @@ public:
   /**
    * @brief Return true if this is older than ftm
    */
-  bool Older(cmFileTime const& ftm) const { return (this->NS - ftm.NS) < 0; }
+  bool Older(cmFileTime const& ftm) const
+  {
+    return (this->Time - ftm.Time) < 0;
+  }
 
   /**
    * @brief Return true if this is newer than ftm
    */
-  bool Newer(cmFileTime const& ftm) const { return (ftm.NS - this->NS) < 0; }
+  bool Newer(cmFileTime const& ftm) const
+  {
+    return (ftm.Time - this->Time) < 0;
+  }
 
   /**
    * @brief Return true if this is the same as ftm
    */
-  bool Equal(cmFileTime const& ftm) const { return this->NS == ftm.NS; }
+  bool Equal(cmFileTime const& ftm) const { return this->Time == ftm.Time; }
 
   /**
    * @brief Return true if this is not the same as ftm
    */
-  bool Differ(cmFileTime const& ftm) const { return this->NS != ftm.NS; }
+  bool Differ(cmFileTime const& ftm) const { return this->Time != ftm.Time; }
 
   /**
    * @brief Compare file modification times.
@@ -51,7 +63,7 @@ public:
    */
   int Compare(cmFileTime const& ftm) const
   {
-    NSC const diff = this->NS - ftm.NS;
+    TimeType const diff = this->Time - ftm.Time;
     if (diff == 0) {
       return 0;
     }
@@ -65,7 +77,7 @@ public:
    */
   bool OlderS(cmFileTime const& ftm) const
   {
-    return (ftm.NS - this->NS) >= cmFileTime::NsPerS;
+    return (ftm.Time - this->Time) >= cmFileTime::UtPerS;
   }
 
   /**
@@ -73,7 +85,7 @@ public:
    */
   bool NewerS(cmFileTime const& ftm) const
   {
-    return (this->NS - ftm.NS) >= cmFileTime::NsPerS;
+    return (this->Time - ftm.Time) >= cmFileTime::UtPerS;
   }
 
   /**
@@ -81,11 +93,11 @@ public:
    */
   bool EqualS(cmFileTime const& ftm) const
   {
-    NSC diff = this->NS - ftm.NS;
+    TimeType diff = this->Time - ftm.Time;
     if (diff < 0) {
       diff = -diff;
     }
-    return (diff < cmFileTime::NsPerS);
+    return (diff < cmFileTime::UtPerS);
   }
 
   /**
@@ -93,11 +105,11 @@ public:
    */
   bool DifferS(cmFileTime const& ftm) const
   {
-    NSC diff = this->NS - ftm.NS;
+    TimeType diff = this->Time - ftm.Time;
     if (diff < 0) {
       diff = -diff;
     }
-    return (diff >= cmFileTime::NsPerS);
+    return (diff >= cmFileTime::UtPerS);
   }
 
   /**
@@ -107,21 +119,21 @@ public:
    */
   int CompareS(cmFileTime const& ftm) const
   {
-    NSC const diff = this->NS - ftm.NS;
-    if (diff <= -cmFileTime::NsPerS) {
+    TimeType const diff = this->Time - ftm.Time;
+    if (diff <= -cmFileTime::UtPerS) {
       return -1;
     }
-    if (diff >= cmFileTime::NsPerS) {
+    if (diff >= cmFileTime::UtPerS) {
       return 1;
     }
     return 0;
   }
 
   /**
-   * @brief The file modification time in nanoseconds
+   * @brief The file modification time in unit time per second
    */
-  NSC GetNS() const { return this->NS; }
+  TimeType GetTime() const { return this->Time; }
 
 private:
-  NSC NS = 0;
+  TimeType Time = 0;
 };
index 1197db6..fc40d63 100644 (file)
@@ -584,7 +584,8 @@ void cmGlobalGenerator::EnableLanguage(
     // Find the native build tool for this generator.
     // This has to be done early so that MSBuild can be used to examine the
     // cross-compilation environment.
-    if (!this->FindMakeProgram(mf)) {
+    if (this->GetFindMakeProgramStage() == FindMakeProgramStage::Early &&
+        !this->FindMakeProgram(mf)) {
       return;
     }
   }
@@ -660,6 +661,12 @@ void cmGlobalGenerator::EnableLanguage(
       cmSystemTools::SetFatalErrorOccured();
       return;
     }
+
+    // Find the native build tool for this generator.
+    if (this->GetFindMakeProgramStage() == FindMakeProgramStage::Late &&
+        !this->FindMakeProgram(mf)) {
+      return;
+    }
   }
 
   // Check that the languages are supported by the generator and its
index b532a43..c106258 100644 (file)
@@ -597,6 +597,17 @@ protected:
 
   std::string GetPredefinedTargetsFolder();
 
+  enum class FindMakeProgramStage
+  {
+    Early,
+    Late,
+  };
+
+  virtual FindMakeProgramStage GetFindMakeProgramStage() const
+  {
+    return FindMakeProgramStage::Late;
+  }
+
 private:
   using TargetMap = std::unordered_map<std::string, cmTarget*>;
   using GeneratorTargetMap =
index 3c46408..3bfcbd0 100644 (file)
@@ -166,6 +166,11 @@ protected:
 
   void WriteSLNHeader(std::ostream& fout);
 
+  FindMakeProgramStage GetFindMakeProgramStage() const override
+  {
+    return FindMakeProgramStage::Early;
+  }
+
   bool ComputeTargetDepends() override;
   class VSDependSet : public std::set<std::string>
   {
index 766ae72..7ee94b2 100644 (file)
@@ -937,14 +937,6 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile(
     default:
       break;
   }
-
-  // explicitly add the explicit language flag before any other flag
-  // this way backwards compatibility with user flags is maintained
-  if (sf->GetProperty("LANGUAGE")) {
-    this->CurrentLocalGenerator->AppendFeatureOptions(flags, lang,
-                                                      "EXPLICIT_LANGUAGE");
-  }
-
   const std::string COMPILE_FLAGS("COMPILE_FLAGS");
   if (cmProp cflags = sf->GetProperty(COMPILE_FLAGS)) {
     lg->AppendFlags(flags, genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS));
@@ -1973,6 +1965,15 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase(
   return buildPhase;
 }
 
+namespace {
+void ReplaceScriptVars(std::string& cmd)
+{
+  cmSystemTools::ReplaceString(cmd, "$(CONFIGURATION)", "$CONFIGURATION");
+  cmSystemTools::ReplaceString(cmd, "$(EFFECTIVE_PLATFORM_NAME)",
+                               "$EFFECTIVE_PLATFORM_NAME");
+}
+}
+
 std::string cmGlobalXCodeGenerator::ConstructScript(
   cmCustomCommandGenerator const& ccg)
 {
@@ -1983,6 +1984,7 @@ std::string cmGlobalXCodeGenerator::ConstructScript(
     wd = lg->GetCurrentBinaryDirectory();
   }
   wd = lg->ConvertToOutputFormat(wd, cmOutputConverter::SHELL);
+  ReplaceScriptVars(wd);
   script = cmStrCat(script, "  cd ", wd, "\n");
   for (unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c) {
     std::string cmd = ccg.GetCommand(c);
@@ -1992,9 +1994,7 @@ std::string cmGlobalXCodeGenerator::ConstructScript(
     cmSystemTools::ReplaceString(cmd, "/./", "/");
     cmd = lg->ConvertToOutputFormat(cmd, cmOutputConverter::SHELL);
     ccg.AppendArguments(c, cmd);
-    cmSystemTools::ReplaceString(cmd, "$(CONFIGURATION)", "$CONFIGURATION");
-    cmSystemTools::ReplaceString(cmd, "$(EFFECTIVE_PLATFORM_NAME)",
-                                 "$EFFECTIVE_PLATFORM_NAME");
+    ReplaceScriptVars(cmd);
     script = cmStrCat(script, "  ", cmd, '\n');
   }
   return script;
index 5b05214..ab5eeb2 100644 (file)
@@ -124,6 +124,11 @@ protected:
   void AddExtraIDETargets() override;
   void Generate() override;
 
+  FindMakeProgramStage GetFindMakeProgramStage() const override
+  {
+    return FindMakeProgramStage::Early;
+  }
+
 private:
   bool ParseGeneratorToolset(std::string const& ts, cmMakefile* mf);
   bool ProcessGeneratorToolsetField(std::string const& key,
index 5f97d86..3776fec 100644 (file)
@@ -573,13 +573,6 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
   // Build the set of compiler flags.
   std::string flags;
 
-  // explicitly add the explicit language flag before any other flag
-  // this way backwards compatibility with user flags is maintained
-  if (source.GetProperty("LANGUAGE")) {
-    this->LocalGenerator->AppendFeatureOptions(flags, lang,
-                                               "EXPLICIT_LANGUAGE");
-  }
-
   // Add language-specific flags.
   std::string langFlags = cmStrCat("$(", lang, "_FLAGS", filterArch, ")");
   this->LocalGenerator->AppendFlags(flags, langFlags);
@@ -838,13 +831,17 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
       compileCommand.replace(compileCommand.find(langFlags), langFlags.size(),
                              this->GetFlags(lang, this->GetConfigName()));
       std::string langDefines = std::string("$(") + lang + "_DEFINES)";
-      compileCommand.replace(compileCommand.find(langDefines),
-                             langDefines.size(),
-                             this->GetDefines(lang, this->GetConfigName()));
+      std::string::size_type ldPos = compileCommand.find(langDefines);
+      if (ldPos != std::string::npos) {
+        compileCommand.replace(ldPos, langDefines.size(),
+                               this->GetDefines(lang, this->GetConfigName()));
+      }
       std::string langIncludes = std::string("$(") + lang + "_INCLUDES)";
-      compileCommand.replace(compileCommand.find(langIncludes),
-                             langIncludes.size(),
-                             this->GetIncludes(lang, this->GetConfigName()));
+      std::string::size_type liPos = compileCommand.find(langIncludes);
+      if (liPos != std::string::npos) {
+        compileCommand.replace(liPos, langIncludes.size(),
+                               this->GetIncludes(lang, this->GetConfigName()));
+      }
 
       cmProp eliminate[] = {
         this->Makefile->GetDefinition("CMAKE_START_TEMP_FILE"),
index 04d84a0..76df9f2 100644 (file)
@@ -190,16 +190,7 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject(
     }
   }
 
-  std::string flags;
-  // explicitly add the explicit language flag before any other flag
-  // this way backwards compatibility with user flags is maintained
-  if (source->GetProperty("LANGUAGE")) {
-    this->LocalGenerator->AppendFeatureOptions(flags, language,
-                                               "EXPLICIT_LANGUAGE");
-    flags += " ";
-  }
-
-  flags += this->GetFlags(language, config, filterArch);
+  std::string flags = this->GetFlags(language, config, filterArch);
 
   // Add Fortran format flags.
   if (language == "Fortran") {
index e076d1e..d26de9c 100644 (file)
@@ -2045,35 +2045,37 @@ std::string cmTarget::ImportedGetFullPath(
   }
 
   if (result.empty()) {
-    auto message = [&]() -> std::string {
-      std::string unset;
-      std::string configuration;
-
-      if (artifact == cmStateEnums::RuntimeBinaryArtifact) {
-        unset = "IMPORTED_LOCATION";
-      } else if (artifact == cmStateEnums::ImportLibraryArtifact) {
-        unset = "IMPORTED_IMPLIB";
-      }
-
-      if (!config.empty()) {
-        configuration = cmStrCat(" configuration \"", config, "\"");
-      }
+    if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
+      auto message = [&]() -> std::string {
+        std::string unset;
+        std::string configuration;
+
+        if (artifact == cmStateEnums::RuntimeBinaryArtifact) {
+          unset = "IMPORTED_LOCATION";
+        } else if (artifact == cmStateEnums::ImportLibraryArtifact) {
+          unset = "IMPORTED_IMPLIB";
+        }
 
-      return cmStrCat(unset, " not set for imported target \"",
-                      this->GetName(), "\"", configuration, ".");
-    };
+        if (!config.empty()) {
+          configuration = cmStrCat(" configuration \"", config, "\"");
+        }
 
-    switch (this->GetPolicyStatus(cmPolicies::CMP0111)) {
-      case cmPolicies::WARN:
-        impl->Makefile->IssueMessage(
-          MessageType::AUTHOR_WARNING,
-          cmPolicies::GetPolicyWarning(cmPolicies::CMP0111) + "\n" +
-            message());
-        CM_FALLTHROUGH;
-      case cmPolicies::OLD:
-        break;
-      default:
-        impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, message());
+        return cmStrCat(unset, " not set for imported target \"",
+                        this->GetName(), "\"", configuration, ".");
+      };
+
+      switch (this->GetPolicyStatus(cmPolicies::CMP0111)) {
+        case cmPolicies::WARN:
+          impl->Makefile->IssueMessage(
+            MessageType::AUTHOR_WARNING,
+            cmPolicies::GetPolicyWarning(cmPolicies::CMP0111) + "\n" +
+              message());
+          CM_FALLTHROUGH;
+        case cmPolicies::OLD:
+          break;
+        default:
+          impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, message());
+      }
     }
 
     result = cmStrCat(this->GetName(), "-NOTFOUND");
index a482ed6..4eb3b7f 100644 (file)
@@ -3944,7 +3944,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
       if (managedType != cmGeneratorTarget::ManagedType::Native &&
           this->GeneratorTarget->GetManagedType(config) !=
             cmGeneratorTarget::ManagedType::Native &&
-          l.Target->IsImported()) {
+          l.Target->IsImported() &&
+          l.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
         auto location = l.Target->GetFullPath(config);
         if (!location.empty()) {
           ConvertToWindowsSlash(location);
index 564169d..c31e4ba 100644 (file)
@@ -4,6 +4,7 @@ set(CMAKE_IMPORT_LIBRARY_SUFFIX "placeholder")
 add_library(unknown_lib UNKNOWN IMPORTED)
 add_library(static_lib STATIC IMPORTED)
 add_library(shared_lib SHARED IMPORTED)
+add_library(interface_lib INTERFACE IMPORTED)
 
-add_executable(executable main.cpp)
-target_link_libraries(executable unknown_lib static_lib shared_lib)
+add_library(module MODULE module.cpp)
+target_link_libraries(module unknown_lib static_lib shared_lib interface_lib)
index ba5d936..91a90e5 100644 (file)
@@ -1,7 +1,17 @@
+^CMake Error in CMakeLists.txt:
+  IMPORTED_LOCATION not set for imported target "unknown_lib"( configuration
+  "[^"]+")?.
++
 CMake Error in CMakeLists.txt:
   IMPORTED_LOCATION not set for imported target "static_lib"( configuration
-  ".+")?.
+  "[^"]+")?.
 +
 CMake Error in CMakeLists.txt:
   IMPORTED_IMPLIB not set for imported target "shared_lib"( configuration
-  ".+")?.
+  "[^"]+")?.(
++
+CMake Error in CMakeLists.txt:
+  IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static|shared)_lib"( configuration
+  "[^"]+")?.)*
++
+CMake Generate step failed.  Build files cannot be regenerated correctly.$
index 3abca0a..27af911 100644 (file)
@@ -1,11 +1,11 @@
-CMake Warning \(dev\) in CMakeLists.txt:
+^CMake Warning \(dev\) in CMakeLists.txt:
   Policy CMP0111 is not set: An imported target missing its location property
   fails during generation.  Run "cmake --help-policy CMP0111" for policy
   details.  Use the cmake_policy command to set the policy and suppress this
   warning.
 
   IMPORTED_LOCATION not set for imported target "unknown_lib"( configuration
-  ".+")?.
+  "[^"]+")?.
 This warning is for project developers.  Use -Wno-dev to suppress it.
 +
 CMake Warning \(dev\) in CMakeLists.txt:
@@ -15,7 +15,7 @@ CMake Warning \(dev\) in CMakeLists.txt:
   warning.
 
   IMPORTED_LOCATION not set for imported target "static_lib"( configuration
-  ".+")?.
+  "[^"]+")?.
 This warning is for project developers.  Use -Wno-dev to suppress it.
 +
 CMake Warning \(dev\) in CMakeLists.txt:
@@ -25,5 +25,15 @@ CMake Warning \(dev\) in CMakeLists.txt:
   warning.
 
   IMPORTED_IMPLIB not set for imported target "shared_lib"( configuration
-  ".+")?.
-This warning is for project developers.  Use -Wno-dev to suppress it.
+  "[^"]+")?.
+This warning is for project developers.  Use -Wno-dev to suppress it.(
++
+CMake Warning \(dev\) in CMakeLists.txt:
+  Policy CMP0111 is not set: An imported target missing its location property
+  fails during generation.  Run "cmake --help-policy CMP0111" for policy
+  details.  Use the cmake_policy command to set the policy and suppress this
+  warning.
+
+  IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static|shared)_lib"( configuration
+  "[^"]+")?.
+This warning is for project developers.  Use -Wno-dev to suppress it.)*$
diff --git a/Tests/RunCMake/CMP0111/main.cpp b/Tests/RunCMake/CMP0111/main.cpp
deleted file mode 100644 (file)
index 5047a34..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-int main()
-{
-}
diff --git a/Tests/RunCMake/CMP0111/module.cpp b/Tests/RunCMake/CMP0111/module.cpp
new file mode 100644 (file)
index 0000000..b82bb31
--- /dev/null
@@ -0,0 +1,4 @@
+int module()
+{
+  return 0;
+}
diff --git a/Tests/RunCMake/ExportCompileCommands/CustomCompileRule.cmake b/Tests/RunCMake/ExportCompileCommands/CustomCompileRule.cmake
new file mode 100644 (file)
index 0000000..12368a2
--- /dev/null
@@ -0,0 +1,5 @@
+enable_language(C)
+add_library(empty STATIC empty.c)
+string(REPLACE "<DEFINES>" "" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
+string(REPLACE "<INCLUDES>" "" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
index b540a04..9e7e732 100644 (file)
@@ -1,3 +1,4 @@
 include(RunCMake)
 
 run_cmake_with_options(BeforeProject -DCMAKE_PROJECT_INCLUDE_BEFORE=BeforeProjectBEFORE.cmake)
+run_cmake(CustomCompileRule)
diff --git a/Tests/RunCMake/add_custom_command/PrintDir.cmake b/Tests/RunCMake/add_custom_command/PrintDir.cmake
new file mode 100644 (file)
index 0000000..0a7b646
--- /dev/null
@@ -0,0 +1 @@
+message(STATUS "WorkingDir='${CMAKE_CURRENT_BINARY_DIR}'")
index 96642fa..aac085d 100644 (file)
@@ -27,3 +27,18 @@ set(RunCMake_TEST_NO_CLEAN 1)
 run_cmake_command(AssigningMultipleTargets-build ${CMAKE_COMMAND} --build .)
 unset(RunCMake_TEST_BINARY_DIR)
 unset(RunCMake_TEST_NO_CLEAN)
+
+if(NOT RunCMake_GENERATOR STREQUAL "Ninja Multi-Config")
+  run_cmake(WorkingDirectory)
+  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/WorkingDirectory-build)
+  set(RunCMake_TEST_NO_CLEAN 1)
+  if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+    set(RunCMake-stdout-file WorkingDirectory-build-multi-config-stdout.txt)
+  else()
+    set(RunCMake-stdout-file WorkingDirectory-build-single-config-stdout.txt)
+  endif()
+  run_cmake_command(WorkingDirectory-build ${CMAKE_COMMAND} --build . --config Debug)
+  unset(RunCMake-stdout-file)
+  unset(RunCMake_TEST_BINARY_DIR)
+  unset(RunCMake_TEST_NO_CLEAN)
+endif()
diff --git a/Tests/RunCMake/add_custom_command/WorkingDirectory-build-multi-config-stdout.txt b/Tests/RunCMake/add_custom_command/WorkingDirectory-build-multi-config-stdout.txt
new file mode 100644 (file)
index 0000000..95ecf42
--- /dev/null
@@ -0,0 +1 @@
+-- WorkingDir='[^']*/Tests/RunCMake/add_custom_command/WorkingDirectory-build/Debug'
diff --git a/Tests/RunCMake/add_custom_command/WorkingDirectory-build-single-config-stdout.txt b/Tests/RunCMake/add_custom_command/WorkingDirectory-build-single-config-stdout.txt
new file mode 100644 (file)
index 0000000..1db56ae
--- /dev/null
@@ -0,0 +1 @@
+-- WorkingDir='[^']*/Tests/RunCMake/add_custom_command/WorkingDirectory-build'
diff --git a/Tests/RunCMake/add_custom_command/WorkingDirectory.cmake b/Tests/RunCMake/add_custom_command/WorkingDirectory.cmake
new file mode 100644 (file)
index 0000000..65b7250
--- /dev/null
@@ -0,0 +1,9 @@
+add_custom_target(mkdir COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
+add_custom_command(
+  OUTPUT out.txt
+  COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/PrintDir.cmake
+  WORKING_DIRECTORY ${CMAKE_CFG_INTDIR}
+  )
+set_property(SOURCE out.txt PROPERTY SYMBOLIC 1)
+add_custom_target(drive ALL DEPENDS out.txt)
+add_dependencies(drive mkdir)
index 616421e..9de4fc6 100644 (file)
@@ -15,10 +15,3 @@ if(CMAKE_GENERATOR MATCHES "^Visual Studio" AND "x${CMAKE_C_COMPILER_ID}" STREQU
   add_library(stay stay_c.c stay_cxx.cxx)
   set_property(TARGET stay PROPERTY COMPILE_OPTIONS "-TP")
 endif()
-
-if((CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang|MSVC|Borland|Embarcadero|Intel|TI|XL)"))
-  add_library(zoom zoom.zzz)
-  set_source_files_properties(zoom.zzz PROPERTIES LANGUAGE CXX)
-  target_link_libraries(SetLang zoom)
-  target_compile_definitions(SetLang PRIVATE WITH_ZOOM)
-endif()
index 515e8c2..b934356 100644 (file)
@@ -1,22 +1,10 @@
 #include <stdio.h>
 
 int foo();
-
-#ifdef WITH_ZOOM
-int zoom();
-#endif
-
 class A
 {
 public:
-  A()
-  {
-    this->i = foo();
-#ifdef WITH_ZOOM
-    i += zoom();
-    i -= zoom();
-#endif
-  }
+  A() { this->i = foo(); }
   int i;
 };
 
diff --git a/Tests/SetLang/zoom.zzz b/Tests/SetLang/zoom.zzz
deleted file mode 100644 (file)
index a0c8899..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-int zoom()
-{
-  int r = 10;
-  r++;
-  int ret = r + 10;
-  return ret;
-}