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
2c724c3aea llvm-rc: Write depfile to location specified by the generator
4cc876540e llvm-rc: Select preprocessor from active languages
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4524
Since commit d1976cd1f2 (CTest: Fix timeout when grandchild keeps pipes
open, 2020-01-13, v3.17.0-rc1~169^2) we no longer hang, but the test
duration we report after the timeout is the amount of time the immediate
child ran before exiting. Fix the logic to instead report the actual
amount of time we spent monitoring the test before the timeout.
Fixes: #20509
Prior to commit 3c125c6de0 (VS: Support Visual Studio Clang Toolkit
identification, 2019-12-03, v3.17.0-rc1~341^2) using `-T ClangCL`
would work but `CMAKE_{C,CXX}_COMPILER` would be detected as `cl.exe`
even though `clang-cl.exe` is the actual compiler. That commit
attempted to fix the detection by using `$(ClangClExecutable)`
as we do for LLVM-distributed toolsets, but that is not actually
defined. Instead, look for `$(CLToolExe)` in the `PATH`.
Fixes: #20504
Since GNU make 4.3, `.SILENT:` no longer causes nested `$(MAKE)` calls
to get `-s` implicitly. Add the `-s` flag explicitly on such calls to
suppress messages about Entering/Leaving directories.
Fixes: #20487
Move the depfile flags to `CMAKE_DEPFILE_FLAGS_RC` so that they
are only usedwith generators that use depfiles. Also switch to
using the `<DEPFILE>` placeholder for the location of the depfile
so that it goes where the generator expects.
Fixes: #20493
The llvm-rc preprocessor is selected according to the
CMAKE_C_COMPILER_ID / CMAKE_CXX_COMPILER_ID which are only defined when
the C or CXX language is active.
1994f950ff cmake: List valid values for --trace-format on the command line
e39766d84a Help: Fix documentation of --trace-format parameter
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4500
CMake 3.16 and below allow multiple `export()` calls with the same output
file even without using `APPEND`. The implementation worked by accident
by leaking memory. Refactoring in commit 5444a8095d (cmGlobalGenerator:
modernize memrory managemenbt, 2019-12-29, v3.17.0-rc1~239^2) cleaned up
that memory leak and converted it to a use-after-free instead.
The problem is caused by using the `cmGlobalGenerator::BuildExportSets`
map to own `cmExportBuildFileGenerator` instances. It can own only
one instance per output FILE name at a time, so repeating use of the
same file now frees the old `cmExportBuildFileGenerator` instance
and leaves the pointer in the `cmMakefile::ExportBuildFileGenerators`
vector dangling. Move ownership of the instances into `cmMakefile`'s
vector since its entries are not replaced on a repeat output FILE.
In future work we should introduce a policy to error out on this case.
For now simply fix the use-after-free to restore CMake <= 3.16 behavior.
Fixes: #20469
In commit 3dab4682f6 (FindPython: reduces consumption of resources,
2020-02-10, v3.17.0-rc1~11^2) we accidentally broke the python
executable version validation when the "LOCATION" strategy is used
with the plain `FindPython` module. Fix the logic and add test
cases covering those combinations.
Fixes: #20465
- Mention the Makefile Generators' `make clean` removal in the
BYPRODUCTS section of add_custom_command and add_custom_target
- Expand the GENERATED property docs' description of which files will
be marked with the property, and of what it implies (including
`make clean` removal)
The library search paths added by commit 2746c61e6d (Swift: Add library
search paths for dependencies, 2019-06-09, v3.16.0-rc1~561^2) need to be
quoted properly on command lines to handle spaces and such. This was
already done by `cmLinkLineComputer::ComputeLinkPath` for
non-Swift-specific link directories.