Commit Graph

157 Commits

Author SHA1 Message Date
Sam Freed
69a5cf23a2 Tests: Update RunCMake/CommandLine BuildDir 2021-02-04 11:39:55 -05:00
Brad King
cc47f4ebf9 Merge topic 'fileapi-toolchains'
6418dabb87 Tests: Add test for toolchains-v1 File API object
1c5bd1bed5 Tests: Add toolchains kind to capabilities test
f72bb2ee0d Help: Add documentation for "toolchains" object kind
bb069c0857 cmFileAPI: Add "toolchains" object kind.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5678
2021-01-14 13:02:54 -05:00
Ben McMorran
1c5bd1bed5 Tests: Add toolchains kind to capabilities test 2021-01-12 14:25:39 -08:00
Brad King
b7485c98a0 Merge topic 'trace_expand_bracket'
e6e7f2cab9 cmMakefile: Don't expand bracket arguments in --trace-expand

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5687
2021-01-12 10:20:26 -05:00
Raul Tambre
e6e7f2cab9 cmMakefile: Don't expand bracket arguments in --trace-expand
Bracket arguments are literal and shouldn't be expanded.

Fixes #21671.
2021-01-11 19:54:18 +02:00
Kai Wang
b696f78073 cmDepends: merge dependers of depend makefile
Since one depender has multiple dependees, depend makefile generated
same depender line by line, to reduce file size and refine make file
parse speed, merge same dependers to one. And add a testcase for
large depend.make which generated source file includes 20000 header
files and run build and incremental build

Signed-off-by: Wangkai <wangkai86@huawei.com>
Signed-off-by: Zhaoyingdong <zhaoyingdong@huawei.com>
2021-01-05 07:48:27 -05:00
Robert Maynard
1b6c5333a0 cmake: Error out on unknown arguments starting with -.
Fixes: #21521
2020-12-01 09:04:08 -05:00
Robert Maynard
98290782b6 cmake: redesign command-line argument parsing
Make handling more consistent:

   "-S" -> invalid
   "-S/path/to/source" -> valid
   "-S /path/to/source" -> valid
   "-S=/path/to/source" -> now valid

   "-D" -> invalid
   "-DStr" -> valid
   "-D Str" -> valid
   "-D=Str" -> now valid

   "--log-level=" -> invalid
   "--log-level" -> invalid
   "--log-level=2" -> valid
   "--log-level 2" -> now valid
2020-11-19 08:53:58 -05:00
Brad King
d800c26ce9 cmake: Fix processing of -Wno-error= flags
Fix two bugs that happened to cancel each other out for cases covered
by our test suite.  Add a test case that distinguishes them.
2020-11-17 13:22:52 -05:00
Brad King
32d369aa70 Merge topic 'llvm-rc-CMAKE_RC_FLAGS'
ea03f50842 llvm_rc: add llvm_rc option filter to correctly pick up all options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5412
2020-10-29 10:14:20 -04:00
Brad King
9b4016a61a Merge topic 'xcode_build_jobs'
e794509faa XCode: Use -j build option when job capacity is specified by user

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5429
2020-10-28 07:38:07 -04:00
Thomas Bernard
ea03f50842 llvm_rc: add llvm_rc option filter to correctly pick up all options
Fixes: #21315
2020-10-28 07:19:31 -04:00
Craig Scott
105ef112c9 Merge topic 'cmake-presets-path-arg'
b7d7eca66d CMakePresets.json: Rework how --preset argument is handled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5416
2020-10-27 07:33:46 -04:00
Fred Baksik
e794509faa XCode: Use -j build option when job capacity is specified by user
Fixes: #18304
2020-10-26 13:28:54 -04:00
Kyle Edwards
b7d7eca66d CMakePresets.json: Rework how --preset argument is handled
If a path argument with no -S or -B leads to a cache directory,
use that directory as the binary directory. Otherwise, use the
binary directory from the preset.

Fixes: #21311
2020-10-26 22:32:45 +11:00
Brad King
4f6fccd861 Merge topic 'remove-server-mode'
9952ee063a server: remove deprecated 'cmake -E server' mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !5370
2020-10-15 08:31:47 -04:00
Brad King
9493532f80 Merge topic 'cmake-E-cat-binary'
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
2020-10-15 08:10:51 -04:00
Brad King
b1d9a25f35 Merge topic 'cmake-E-cat-binary' into release-3.19
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
2020-10-15 08:10:50 -04:00
Brad King
9952ee063a server: remove deprecated 'cmake -E server' mode
The server mode has been deprecated since commit 996e1885c4 (server:
deprecate in favor of the file-api, 2019-04-19, v3.15.0-rc1~198^2).
Clients should now be using the file-api.  Remove the server mode.
2020-10-14 16:41:50 -04:00
Johnny Jazeix
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
Reset `std::cout` to write in binary mode with no encoding conversions.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21295
2020-10-14 12:08:07 -04:00
Kyle Edwards
8617479061 CMake: Add presets functionality 2020-10-05 09:49:59 -04:00
Brad King
e8b0359a43 cmake_language: Add signature to DEFER calls to later times
Fixes: #19575
2020-09-29 17:12:33 -04:00
Brad King
266f97315b Tests: Update RunCMake.CommandLine to avoid duplicate custom commands
This test does not need to have the same custom command output generated
by multiple independent targets.  Revise the test to avoid that.
2020-09-01 10:32:45 -04:00
Thomas Bernard
a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict 2020-08-07 11:47:15 -04:00
Sibi Siddharthan
2fad00940d cmake: Add -E create_hardlink
Fixes: #20950
Signed-off-by: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
2020-07-15 20:22:04 +05:30
Brad King
41ede81341 Merge topic 'profiling-case-insensitive-command-names'
7cf2f7d2af cmake: Store lowercase command names in profiling output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5007
2020-07-14 07:14:08 -04:00
Craig Scott
7cf2f7d2af cmake: Store lowercase command names in profiling output
This ensures commands can be properly aggregated by tools
processing the profiling output.

Fixes: #20946
2020-07-13 11:03:05 +10:00
Brad King
f2b84d24cf Merge topic 'fileApiAddLanguageStandardBacktrace'
7d6861f367 fileapi: Extend codemodel targets with language standard
ba835874a4 Add backtrace support for language standard
e43486a639 cmGeneratorTarget: Clarify name of language property lookup helper

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4798
2020-06-29 08:25:42 -04:00
Justin Goshi
7d6861f367 fileapi: Extend codemodel targets with language standard 2020-06-26 08:52:29 -04:00
Asit Dhal
d4812a955b cmake-install: implement default directory permissions
provide an argument for default directory permissions in cmake --install

Fixes: #20700
2020-06-25 14:43:30 -04:00
Asit Dhal
b5b6075522 cmake: add dedicated error for -E compare_files invalid arguments
Return 2 when user provides invalid arguments

Fixes: #20815
2020-06-15 12:39:37 -04:00
Brad King
b9dd072e05 Tests: Add case for cmake --build with a failing target 2020-06-12 14:31:16 -04:00
Asit Dhal
a7d44d55ae cmake: remove -E compare_files error message if files differ
It is not an error for the files to be different.

Fixes: #20803
2020-06-10 07:23:10 -04:00
Brad King
15b9b41d72 Merge topic 'fileApiAddPrecompileHeadersBacktrace'
9f6d40ee23 fileapi: Extend codemodel targets with PRECOMPILE_HEADERS
b698764a31 Tests: Add a PCH example to RunCMake.FileAPI codemodel-v2
b3812c0e54 Tests: Fix indentation in RunCMake.FileAPI cxx_exe.json
9c48804b69 PCH: Fix source group of per-architecture PCH headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4684
2020-05-25 10:40:56 -04:00
Justin Goshi
9f6d40ee23 fileapi: Extend codemodel targets with PRECOMPILE_HEADERS 2020-05-22 11:26:55 -04:00
Brad King
171bf5fa92 Merge topic 'third-parties-layout'
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
75e87e3db4 bootstrap: update list of problematic files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4705
2020-05-08 08:18:17 -04:00
Marc Chevrier
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
Fixes: #20666
2020-05-07 12:06:08 +02:00
Alex Turbov
e4f1b301fe cmake: Allow arbitrary args passed to CMake script 2020-05-06 21:40:36 +10:00
Johnny Jazeix
a625f30785 cmake -E: add cat command.
Concatenate files and print on the standard output.

FIXES: #20557
2020-04-15 20:56:56 +02:00
Brad King
c0438d272d Merge topic 'llvm-rc-include-path'
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4570
2020-04-07 08:00:45 -04:00
Thomas Bernard
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing
Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for
llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) with llvm-rc we explicitly
preprocess RC source files and then compile separately without -I flags.
This broke cases where the RC source references data files adjacent to
itself or in the include path.

This change adds the expansion of the include paths when calling the
llvm-rc in order for the resource files to be picked up correctly by
llvm-rc.  Since the RC compiled file is first preprocessed, the file
being compiled by llvm-rc resides in the build directory. In order for
llvm-rc to find the resource data specified relative to the .rc file
being compiled, the source file path is preppended in the include list
so that the original source path takes priority over all the other
includes paths specified.

A space was added in the CMAKE_INCLUDE_FLAG_RC to make the include
directive work properly for llvm-rc. Checks on the rc.exe showed that
the syntax change doesn't affect it's proper operation.

Fixes: #20529
2020-04-06 21:19:12 +02:00
Brad King
a88b27bfc7 Merge topic 'llvm-rc-stderr'
dc93cbb0d8 llvm-rc: Print stderr output when calling tools through cmake_llvm_rc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4525
2020-03-27 07:39:30 -04:00
Thomas Bernard
dc93cbb0d8 llvm-rc: Print stderr output when calling tools through cmake_llvm_rc
The stored error pipe is output if the program fails.

Fixes: #20494
2020-03-26 07:59:55 -04:00
Wouter Klouwen
9aa4640792 cmake: add command line options to output script profiling data
For users of CMake who want to optimize their scripts if they take a
while to run, this commit adds the ability to output profiling data.

To enable this output, it adds the two command line parameters
to select the output path and format.

This commit adds the first profiling format of type ``google-trace``,
which is the output is a JSON file containing Duration events as per the
Google Trace Format specification:

https://docs.google.com/document/d/1CvAClvFfyA5R-
PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#
2020-03-07 13:36:27 +00:00
Thomas Bernard
1c2d031cbd Add -E cmake_llvm_rc to preprocess files for llvm-rc
llvm-rc requires preprocessed rc files. The CMake command line tool
cmake_llvm_rc enables channing the preprocessor call and the resource
compiler and make this appear as single compilation step.

When llvm-rc is detected as resource compiler, the RC compilation step
is set to use this command.
2020-02-04 08:19:12 -05:00
Frank Winklmeier
c829f0cfca trace: Add time and stack level to JSON output format
Add the timestamp and stack depth of the function call to the JSON trace
output format. This information can be useful for cmake profiling and
call stack inspection (see e.g. https://github.com/volo-zyko/cmake-profile-stats).

Improve unit test to allow for varying set of keys to check in trace lines.
2020-01-22 09:58:52 -05:00
Kyle Edwards
3c548cfaf6 Merge topic 'trace-test-support-python26-and-older'
00f25dacc0 trace: Directly parse commandline arguments without argparse

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4169
2020-01-03 11:28:29 -05:00
Daniel Mensinger
00f25dacc0 trace: Directly parse commandline arguments without argparse 2020-01-01 11:18:26 +01:00
Rolf Eike Beer
397d162b9a Tests: do not use the same variable name in nested loops
Spotted by LGTM.com.
2019-12-31 13:30:18 +01:00
Daniel Mensinger
e113ab1168 trace: Add test for the JSON-v1 trace 2019-12-23 14:05:42 +01:00