Commit Graph

51360 Commits

Author SHA1 Message Date
Anakin Skywalker cc32eeae17 Help: Clarify standard module variable naming
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2021-01-12 23:00:34 +11:00
Brad King 05f4248e3d Merge topic 'cpp-modules'
39cbbb59a5 ninja: add experimental infrastructure to generate gcc-format modmap files
791b4d26d6 ninja: add experimental infrastructure to generate modmap files with dyndep
4b23359117 ninja: Add experimental infrastructure for C++20 module dependency scanning
f814d3b3c6 cmNinjaTargetGenerator: use $OBJ_FILE for the object
b0fc2993e1 Treat the '.mpp' file extension as C++ code
988f997100 cmScanDepFormat: Fix name of our internal tool in parse errors
dacd93a2db ninja: De-duplicate version numbers required for ninja features
533386ca29 cmStandardLevelResolver: Factor out helper to capture stoi exceptions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Shannon Booth <shannon.ml.booth@gmail.com>
Merge-request: !5562
2021-01-07 08:26:28 -05:00
Brad King 520df2880b Merge topic 'fix-21620'
8cb8dd6da5 AutoMoc: Re-run after adding Q_OBJECT macro
fefba42e37 Add a failing test case for #21620
2999c40dd9 Extend QtAutogen/RerunMoc
f623664e87 Do not use try_compile in RerunMocBasic test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5642
2021-01-07 08:25:29 -05:00
Brad King abee7c60af Merge topic 'use_common_command_line_argument_parser'
8c22c1964c cmake: --install now uses cmCommandLineArgument
75ac6dfbce cmake: --build now uses cmCommandLineArgument
5ab0b54482 cmCommandLineArgument now supports OneOrMore argument type
b34db1db69 cmCommandLineArgument supports ZeroOrOne arguments
0fb78576b0 cmake: Use shared parsing code for all cmake argv parsing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5659
2021-01-07 08:23:13 -05:00
Brad King 1cbbfbc78f Merge topic 'export-compile-commands-per-target'
a742b5d137 CMAKE_EXPORT_COMPILE_COMMANDS: allow configuration per target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5651
2021-01-07 08:22:27 -05:00
Brad King 455d016863 Merge topic 'vs_shader_flags-generator-expressions'
67775aaf5b VS: Add genex support to VS_SHADER_FLAGS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5664
2021-01-07 08:21:25 -05:00
Brad King 8a705577ff Merge topic 'test-intel-ConfigSources'
0dcc03cd16 Tests: Fix ConfigSources test with Intel compiler on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5669
2021-01-07 08:20:40 -05:00
Brad King 4a2122c070 Merge topic 'cmake-gui-qt6'
2e4cbaa521 cmake-gui: Add a Qt version control variable
b3ee09290b cmake-gui: Conditionally switch between QDirModel and QFileSystemModel
020b2766f3 cmake-gui: Replace obsolete QDirModel with QFileSystemModel
684dcdbc5b cmake-gui: Prefer local variable for Qt major version
50fcc94bc5 cmake-gui: Support installation for both Qt5 and Qt6 plugins
2a2942a42e cmake-gui: Use a consistent Qt major version variable name
035078d847 cmake-gui: Remove explicit locale setup
f1de6f6682 cmake-gui: Support building against Qt6

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5621
2021-01-07 08:17:59 -05:00
Brad King 628f3a51f8 Merge topic 'export-target-name-subst'
06f921d9f6 export: Fix replacement of multiple TARGET_NAME expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5666
2021-01-07 08:17:01 -05:00
Brad King 18b1ccfa51 Merge topic 'ctest-progress-output-fixes'
39cdc8afb9 ctest: Make verbose mode override progress behavior
1bcd9b06b9 ctest: Don't treat skipped test as failed tests in progess report

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5663
2021-01-07 08:14:48 -05:00
Kitware Robot 4c4e3c81eb CMake Nightly Date Stamp 2021-01-07 00:01:13 -05:00
Joerg Bornemann 8cb8dd6da5 AutoMoc: Re-run after adding Q_OBJECT macro
Consider a Qt project with a header file that does not contain the
Q_OBJECT macro. Adding the Q_OBJECT macro is supposed to trigger a run
of moc.

When using Qt >= 5.15 and the Ninja generator, re-running AutoMoc is
controlled by the contents of a Ninja depfile.  In the situation above,
AutoMoc would not re-run, because the header/source files without
Q_OBJECT macro are not contained in the depfile.

Add the relevant source files of the project to the merged depfile to
re-run AutoMoc whenever a source file changes.

Fixes: #21620
2021-01-06 20:17:20 +01:00
Joerg Bornemann fefba42e37 Add a failing test case for #21620
Extend Qt(4|5)Autogen.RerunMocBasic to check the following situation:

Class MyObject3 is a QObject-derived class without Q_OBJECT macro.
It's declared in myobject3.h that is not included by any file that is
input of AutoMoc (this is why we had to add PlainObject).

If myobject3.h were included by main.cpp, then AutoMoc would already
track this dependency, because main.cpp has a Q_OBJECT macro.

After the initial build(s), the Q_OBJECT macro is added to myobject3.h,
and an incremental build is run. With Qt >= 5.15 and Ninja, the build
fails, because AutoMoc is not run due to the missing dependency to
myobject3.h.
2021-01-06 20:16:36 +01:00
Joerg Bornemann 2999c40dd9 Extend QtAutogen/RerunMoc
Test that removing / adding a Q_OBJECT macro doesn't break incremental
builds.

This was initially done to test the fix for #21620, but the test passes
without the fix. The reason is that test1.h is included by main.cpp, which
contains a Q_OBJECT macro, meaning that test1.h is in AutoMoc's
dependencies transitively.
2021-01-06 20:16:36 +01:00
Joerg Bornemann f623664e87 Do not use try_compile in RerunMocBasic test
In a subsequent patch we want to extend RerunMocBasic to test the
removal and addition of Q_OBJECT macros works when building
incrementally.

For that, properly generated dependencies are necessary. Currently, the
MocBasic test project is configured using try_compile, and that turns
off the generation of depfiles.

Replace the try_compile call with execute_command calls that first
configure and then build the test project.
2021-01-06 20:16:36 +01:00
Brad King 1c9b61c23e Merge branch 'release-3.19' 2021-01-06 14:08:28 -05:00
Brad King 3734a96d98 Merge topic 'FindHDF5-dbg-and-rel'
5267ba9d63 FindHDF5: Fix finding both debug and release libs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5653
2021-01-06 14:08:27 -05:00
Brad King 95e3ff2e88 Merge topic 'FindHDF5-dbg-and-rel' into release-3.19
5267ba9d63 FindHDF5: Fix finding both debug and release libs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5653
2021-01-06 14:08:27 -05:00
Brad King 94047141b0 Merge branch 'release-3.19' 2021-01-06 13:49:33 -05:00
Brad King 6fc45f0282 Merge topic 'ci-xcode-12.3' into release-3.19
7b4a50d622 gitlab-ci: update macOS jobs to use Xcode 12.3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5670
2021-01-06 13:49:32 -05:00
Brad King a24de5c59a Merge topic 'ci-xcode-12.3'
7b4a50d622 gitlab-ci: update macOS jobs to use Xcode 12.3

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5670
2021-01-06 13:49:32 -05:00
Brad King 7b4a50d622 gitlab-ci: update macOS jobs to use Xcode 12.3 2021-01-06 12:47:02 -05:00
Brad King 0dcc03cd16 Tests: Fix ConfigSources test with Intel compiler on Windows
The test regularly fails updating the `vc*.pdb` compiler-generated
PDB file.  Add the `/Z7` flag as the compiler suggests for this.
2021-01-06 11:13:03 -05:00
Brad King 91f0f4aa73 Merge topic 'explicit-this-fix'
209daa20b2 Code style: add missed explicit 'this->'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5400
2021-01-06 10:20:57 -05:00
Brad King c1a7de72e1 Merge topic 'depend_make_refine'
b696f78073 cmDepends: merge dependers of depend makefile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5631
2021-01-06 10:20:04 -05:00
Brad King 6493d37091 Merge topic 'update-kwsys'
b6ae9ddc41 Merge branch 'upstream-KWSys' into update-kwsys
3887390a37 KWSys 2021-01-05 (a72d59e1)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5665
2021-01-06 10:19:10 -05:00
Robert Maynard 8c22c1964c cmake: --install now uses cmCommandLineArgument
This makes `--install` use the same parsing rules as the rest of the
the cmake executable
2021-01-06 09:11:18 -05:00
Robert Maynard 75ac6dfbce cmake: --build now uses cmCommandLineArgument
This makes `--build` use the same parsing rules as the rest of the
the cmake executable
2021-01-06 09:11:18 -05:00
Robert Maynard 5ab0b54482 cmCommandLineArgument now supports OneOrMore argument type 2021-01-06 09:11:18 -05:00
Robert Maynard b34db1db69 cmCommandLineArgument supports ZeroOrOne arguments
This allows us to parse command line arguments such as `-j` || `-j2`
2021-01-06 09:11:18 -05:00
Robert Maynard 0fb78576b0 cmake: Use shared parsing code for all cmake argv parsing 2021-01-06 09:11:14 -05:00
Kitware Robot 3b36d12ac2 CMake Nightly Date Stamp 2021-01-06 00:01:12 -05:00
Shannon Booth a742b5d137 CMAKE_EXPORT_COMPILE_COMMANDS: allow configuration per target
The new target property `EXPORT_COMPILE_COMMANDS` associated with the
existing global variable can be used to optionally configure targets for
their compile commands to be exported.

Fixes: #19462
2021-01-06 11:51:39 +13:00
Jeremiah van Oosten 67775aaf5b VS: Add genex support to VS_SHADER_FLAGS 2021-01-05 17:07:01 +01:00
Sankhesh Jhaveri 2e4cbaa521 cmake-gui: Add a Qt version control variable 2021-01-05 11:03:31 -05:00
Sankhesh Jhaveri b3ee09290b cmake-gui: Conditionally switch between QDirModel and QFileSystemModel
Uses QT_VERSION_CHECK to determine Qt version. The code switches to
QFileSystemModel for Qt versions >= 6
2021-01-05 11:03:31 -05:00
Sankhesh Jhaveri 020b2766f3 cmake-gui: Replace obsolete QDirModel with QFileSystemModel 2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri 684dcdbc5b cmake-gui: Prefer local variable for Qt major version
QT_DEFAULT_MAJOR_VERSION was added in Qt 5.15 and CMake supports Qt versions >= 5.9
2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri 50fcc94bc5 cmake-gui: Support installation for both Qt5 and Qt6 plugins 2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri 2a2942a42e cmake-gui: Use a consistent Qt major version variable name 2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri 035078d847 cmake-gui: Remove explicit locale setup
Qt uses utf-8 encoding by default for versions >= Qt5.
2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri f1de6f6682 cmake-gui: Support building against Qt6 2021-01-05 11:03:30 -05:00
Ben Boeckel 39cbbb59a5 ninja: add experimental infrastructure to generate gcc-format modmap files 2021-01-05 09:35:10 -05:00
Ben Boeckel 791b4d26d6 ninja: add experimental infrastructure to generate modmap files with dyndep
The scan step may need to output additional information for the
compiler, not just the build tool. The modmap is assumed to be beside
the object output. Additional refactoring may open up a channel to
inform per-source paths to the dyndep rule in the future, but is not
done here.
2021-01-05 09:35:10 -05:00
Brad King 4b23359117 ninja: Add experimental infrastructure for C++20 module dependency scanning
Optionally enable this infrastructure through an undocumented
`CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP` variable.  Currently this is
experimental and intended for use by compiler writers to implement their
scanning tools.  Warn as such when the feature is activated.  Later when
compilers provide the needed scanning tools we can enable this variable
from our corresponding compiler information modules.  It is never meant
to be set by project code.

When enabled, generate a build graph similar to what we use for Fortran
module dependencies.  There are some differences needed because we can
scan dependencies without explicit preprocessing, and can directly
compile the original source afterward.

Co-Author: Ben Boeckel <ben.boeckel@kitware.com>
2021-01-05 09:34:55 -05:00
Ben Boeckel f814d3b3c6 cmNinjaTargetGenerator: use $OBJ_FILE for the object
This will not be $out in all cases in the future.
2021-01-05 09:29:18 -05:00
Ben Boeckel b0fc2993e1 Treat the '.mpp' file extension as C++ code
This is the extension required in build2 for C++ module support.
2021-01-05 09:29:18 -05:00
Brad King 988f997100 cmScanDepFormat: Fix name of our internal tool in parse errors
We parse the scan result `.ddi` files in `-E cmake_ninja_dyndep`,
not `-E cmake_ninja_depends`.
2021-01-05 09:29:18 -05:00
Brad King dacd93a2db ninja: De-duplicate version numbers required for ninja features 2021-01-05 09:29:18 -05:00
Brad King 533386ca29 cmStandardLevelResolver: Factor out helper to capture stoi exceptions 2021-01-05 09:29:18 -05:00