Skip to content
Snippets Groups Projects
  1. Aug 27, 2020
    • Sumit Bhardwaj's avatar
      Implement cm::static_reference_cast by declval · d2f89128
      Sumit Bhardwaj authored and Brad King's avatar Brad King committed
      Previously, cm::static_reference_cast used invoke_result_t and took the
      address of O::get. This is not in complete conformance with standard.
      
      This MR changes the implementation to use std::declval<O>.get() which is
      always well-defined.
      d2f89128
  2. Aug 10, 2020
    • Brad King's avatar
      Merge branch 'backport-3.17-automoc-path-prefix-off' into release-3.17 · 09507da0
      Brad King authored
      Merge-request: !5105
      09507da0
    • Brad King's avatar
      e503fbe3
    • Jörg Bornemann's avatar
      Autogen: Turn off moc path prefix generation by default · 4c33b305
      Jörg Bornemann authored and Brad King's avatar Brad King committed
      Change the default value of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF` to
      restore compatibility with behavior of CMake 3.15 and below.
      
      C++ source files that are generated by Qt's meta object compiler (moc)
      include the header file that was passed as input argument to moc. This
      is usually a path relative to the source directory, for example
      
          #include "../../source/dir/myobject.h"
      
      That is problematic for reproducible builds as described in #18815.
      To cope with that, the target property AUTOMOC_PATH_PREFIX was
      introduced in CMake 3.16 by commit d018d27c (Autogen: Add moc path
      prefix generation (AUTOMOC_PATH_PREFIX), 2019-09-13, v3.16.0-rc1~94^2~4).
      The property is default-initialized from the variable
      `CMAKE_AUTOMOC_PATH_PREFIX`, which defaults to `ON`.
      
      If this property is ON, and myobject.h is located in an include
      directory of the target, moc-generated C++ files include the file
      without the "path prefix":
      
          #include "myobject.h"
      
      This behavior, however, can break projects that have equally named
      header files in different include directories.  As "not breaking
      existing projects" trumps "have reproducible builds by default" we
      change the default of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF`.
      
      Also, it is now possible to pass `-DCMAKE_AUTOMOC_PATH_PREFIX=ON` on the
      CMake command line.  Before, it was overridden in `CMakeGenericSystem`.
      
      Fixes: #20598
      Issue: #18815
      4c33b305
  3. Aug 07, 2020
  4. Aug 05, 2020
  5. Aug 03, 2020
    • alcroito's avatar
      AutoGen: Add test to check for correct AutoMoc dependencies · 7445c9a5
      alcroito authored
      When using Qt 5.15.0 or above together with Ninja, check that touching
      a source file of a dependency does not needlessly re-run AUTOMOC for
      the dependee target.
      7445c9a5
    • alcroito's avatar
      AutoGen: Fix over-specified direct dependencies of custom command · a79056bb
      alcroito authored
      The AutoMoc timestamp creating custom command explicitly depended
      on all dependencies of the origin target (associated to the AutoGen
      target).
      
      When an origin target depended on a shared library 'libfoo.so',
      if it was re-linked, the AutoMoc custom command would touch its
      output timestamp file, and thus cause needless rebuilding of sources,
      despite the shared library not having any influence on the AutoMoc
      generated files.
      
      Introduce a new '<target>_autogen_timestamp_deps' utility target,
      which will serve as an 'order-only' dependency for the custom command.
      
      This will prevent needless rebuilding, because touching 'libfoo.so'
      will not cause the custom command to be re-executed.
      
      The new AutoMoc dependency tree looks like:
          '_autogen_timestamp_deps (serves as order-only dep)'
       <- '<target_autogen>/timestamp' file ( + moc deps file)
       <- '<target>_autogen' target.
      
      Fixes: #21020
      a79056bb
    • Brad King's avatar
      Merge branch 'ninja-multi-rsp-remove-path' into release-3.17 · 507fecd7
      Brad King authored
      Merge-request: !5094
      507fecd7
    • Kyle Edwards's avatar
      Ninja: Restore shorter path to response files · cdb50af2
      Kyle Edwards authored and Brad King's avatar Brad King committed
      In commit 99ed39b0 (Ninja Multi-Config: Make link response files
      per-config, 2020-07-15, v3.17.4~3^2), we added the target directory to
      the response file under the mistaken assumption that two different
      targets with the same name could be in different directories. However,
      this causes the path to the response file to be too long to fit on a
      command line.  Take the path back out, while leaving in the per-config
      split.
      
      Fixes: #21050
      cdb50af2
  6. Jul 30, 2020
  7. Jul 24, 2020
    • Brad King's avatar
      Merge branch 'bootstrap-intel' into release-3.17 · e82bc594
      Brad King authored
      Merge-request: !5057
      e82bc594
    • Brad King's avatar
      bootstrap: Fix support for Intel compiler with modern GNU system compiler · 79646628
      Brad King authored
      On systems with older GNU system compilers, the Intel C++ compiler does
      not define `__cplusplus` to any version newer than C++11.  This
      prevented `bootstrap` from detecting that a given C++ standard flag has
      enabled C++17 mode in the compiler.  In commit 033a4b12 (bootstrap:
      Extend C++17 check for our cast functions, 2019-12-14,
      v3.17.0-rc1~291^2) we added a preprocessor condition to attempt to
      detect C++17 mode in the Intel compiler on such systems by looking
      for `__cpp_if_constexpr`.  However, on systems with a modern GNU
      system compiler, that definition is available even in C++11 mode.
      
      Switch to using `__cpp_deduction_guides` to detect C++17 mode for the
      Intel C++ compiler.  That seems to be defined exclusively in C++17 mode
      regardless of the version of the system compiler.
      
      Fixes: #21013
      79646628
  8. Jul 21, 2020
  9. Jul 16, 2020
  10. Jun 08, 2020
  11. Jun 03, 2020
  12. Jun 02, 2020
  13. Jun 01, 2020
  14. May 29, 2020
    • Kyle Edwards's avatar
    • Brad King's avatar
      Merge topic 'FindSubversion-xcode-removed' into release-3.17 · 1e4aaa31
      Brad King authored and Kitware Robot's avatar Kitware Robot committed
      
      2c0db404 FindSubversion: Do not accept macOS stub without Xcode implementation
      
      Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
      Merge-request: !4813
      1e4aaa31
    • Brad King's avatar
      Merge branch 'backport-3.16-pch-fix-bad-ClearSourcesCache' into release-3.16 · 5ff1a252
      Brad King authored
      Merge-request: !4815
      5ff1a252
    • Brad King's avatar
    • Brad King's avatar
      PCH: Fix logic error that incorrectly clears sources during VS generation · fa7b041e
      Brad King authored
      Since commit 729d997f (Precompile Headers: Add REUSE_FROM signature,
      2019-08-30, v3.16.0-rc1~101^2), `GetPchFileObject` handles the case that
      it is called first for another target's `REUSE_FROM` by calling
      `AddSource` to make sure `GetObjectName` can produce the correct object
      name.  However, `AddSource` causes `ClearSourcesCache` to be called,
      which since commit a9f4f58f (cmGeneratorTarget: Clear AllConfigSources
      in ClearSourcesCache, 2020-05-15, v3.16.7~2^2) now correctly erases the
      `AllConfigSources` structure.  This is okay during `AddPchDependencies`,
      but there is another code path in which it is problematic.
      
      When the Visual Studio generator's `WriteAllSources` method is looping
      over the sources, the `cmake_pch.cxx` source is encountered first.  This
      causes `OutputSourceSpecificFlags` to call `GetPchCreateCompileOptions`,
      which calls `GetPchFile`, which under MSVC with `CMAKE_LINK_PCH` calls
      `GetPchFileObject`.  That leads to `ClearSourcesCache` erasing the
      structure over which `WriteAllSources` is iterating!
      
      This bug is caught by our `RunCMake.PrecompileHeaders` test when run
      with the VS generator as of the commit that exposed it by fixing
      `ClearSourcesCache`.  However, that change was backported to the CMake
      3.16 series after testing only with later versions versions that contain
      commit a55df204 (Multi-Ninja: Add precompile headers support,
      2020-01-10, v3.17.0-rc1~136^2).  By adding proper multi-config support
      for PCH, that commit taught `cmLocalGenerator::AddPchDependencies` to
      call `GetPchFile` with the real set of configurations instead of just
      the empty string.  This allows the `GetPchFile` cache of PCH sources to
      be populated up front so that the later calls to it in the
      `WriteAllSources` loop as described above do not actually call
      `GetPchFileObject` or `ClearSourcesCache`.  That hid the problem.
      
      Fix this by re-ordering calls to `AddPchDependencies` to handle
      `REUSE_FROM` targets only after the targets whose PCH they re-use.
      Remove the now-unnecessary call to `AddSource` from `GetPchFileObject`
      so that `ClearSourcesCache` is never called during `WriteAllSources`.
      Update the PchReuseFrom test case to cover an ordering of targets that
      causes generators to encounter a `REUSE_FROM` target before the target
      whose PCH it re-uses.
      
      Fixes: #20770
      fa7b041e
  15. May 28, 2020
  16. May 27, 2020
Loading