summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Windows-Clang.cmake
Commit message (Collapse)AuthorAgeFilesLines
* PCH: Mark CMake PCH source files as -x <lang>-headerCristian Adam2020-09-041-1/+6
| | | | Fixes: #21163
* llvm-rc: Fix quoting of path to cmake in CMAKE_RC_COMPILE_OBJECTThomas Bernard2020-08-181-1/+1
| | | | | | | | When the installation path to cmake includes spaces, the `<CMAKE_COMMAND>` is required to have proper quotation of the cmake call. Fixes: #21095
* Merge topic 'llvm-rc-include-path'Brad King2020-04-071-1/+1
|\ | | | | | | | | | | | | 35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4570
| * llvm-rc: Restore include path for data after explicit preprocessingThomas Bernard2020-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge topic 'llvm_rc_pp'Brad King2020-03-301-1/+1
|\ \ | |/ | | | | | | | | | | 4bef0e6450 llvm-rc: Enable preprocessing if CMAKE_RC_COMPILER_INIT is an absolute path Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4535
| * llvm-rc: Enable preprocessing if CMAKE_RC_COMPILER_INIT is an absolute pathLucas Wang2020-03-271-1/+1
| | | | | | | | | | `CMAKE_RC_COMPILER_INIT` and `CMAKE_RC_COMPILER` can be set by user, for example `llvm-rc-10` and `D:\LLVM\bin\llvm-rc.exe`.
* | Merge topic 'llvm-rc-depfile'Brad King2020-03-271-3/+4
|\ \ | |/ | | | | | | | | | | | | 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
| * llvm-rc: Write depfile to location specified by the generatorThomas Bernard2020-03-261-1/+2
| | | | | | | | | | | | | | | | | | 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
| * llvm-rc: Select preprocessor from active languagesThomas Bernard2020-03-261-2/+2
| | | | | | | | | | | | 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.
* | Modules: Collapse consecutive whitespace in stringsDaan De Meyer2020-03-231-2/+2
|/
* llvm-rc: Forward DEFINES instead of FLAGSThomas Bernard2020-03-031-1/+1
| | | | | | | | Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) we pass the full target `<FLAGS>` to the llvm-rc resource compiler, but we should pass only `<DEFINES>`. Fixes: #20414
* PCH: Clang: Update PCH usage flags to include original headerSergey Larin2020-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | Add an additional include flag to PCH usage command line to fix programs that rely on `compile_commands.json` file. Pass it to the preprocessor directly to avoid compiler driver to change it to '-include-pch'. When preprocessor is requested to preprocess a file, it tries to get the original filename from '.pch' and uses that file for preprocessing. CMake generates a '.pch' file from the '.hxx' file by passing an empty '.cxx' source file to the compiler as a compilation unit and the header file with the '-include' flag. After that, compiler puts compilation unit filename in the '.pch' as the original filename. However, CMake build system uses empty file as the source file and passes the header file using '-include-pch' flag. As a result, Clang uses the wrong file for preprocessing and produces the corrupted preprocessed file. Fixes: #20355 Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
* Add -E cmake_llvm_rc to preprocess files for llvm-rcThomas Bernard2020-02-041-0/+17
| | | | | | | | | 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.
* ASM: Hook up Windows-specific GNU/Clang compiler information modulesMartin Storsjö2020-01-311-16/+20
| | | | | | This allows building .s/.S assembly code, and makes sure that the `-fPIC` option isn't passed to the compiler (as it errors out on Clang and causes a loud warning on GCC).
* MinGW: Update find_library to not find plain .dll filesBrad King2020-01-201-1/+1
| | | | | | | | Modern distributions of packages built with MinGW tools provide `.dll.a` import libraries. Prefer those instead of finding plain `.dll` files. This avoids accidentally finding unrelated Windows `.dll` files. Fixes: #20019
* PCH: Add support for OBJC/OBJCXX languagesCristian Adam2019-11-031-3/+0
|
* PCH: Use clang's own pch functionality instead of the GCC emulationCristian Adam2019-10-031-3/+4
| | | | Fixes: #19786
* Merge topic 'clang-ipo-support'Brad King2019-09-031-2/+9
|\ | | | | | | | | | | | | | | | | | | dca9c33abc Tests: Remove old IPO test c856d4556b bindexplib: supporting llvm bitcode formats using llvm-nm 079b8e2916 Clang: prefer lld-link over link.exe 6e3655db2c Clang: add LTO support for GNU-command line clang on windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3527
| * Clang: add LTO support for GNU-command line clang on windowsZsolt Parragi2019-08-271-2/+9
| |
* | Precompile headers: Add methods to generate PCH sourcesCristian Adam2019-08-281-0/+7
|/ | | | Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Clang: Fall back to llvm-rc when rc is unavailableGregory Mitrano2019-08-141-0/+15
| | | | | | | | | | | | | | | | This change modifies how CMAKE_RC_COMPILER is configured to improve the out-of-box experience for developers using Clang on Windows. The previous behavior was to require the user to explicitly specify the resource compiler when CMake was called. The new behavior is to automatically attempt to locate the MSVC rc binary and use that if it's found. If rc is not available, CMake will now fall back to Clang's llvm-rc binary. With this change in place, trivial C/C++ programs can be generated with Ninja and Clang on Windows without running into errors about a missing resource compiler. Fixes: #19318
* clang: setup correct configuration in gnu modeZsolt Parragi2019-05-231-5/+112
|
* Clang: Use -TP flag for C++ sources with clang-clBrad King2017-10-251-0/+1
| | | | | | We do this for `cl`, so we should do it for `clang-cl`. Fixes: #17394
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Avoid if() quoted auto-dereference when checking for "MSVC"Fraser Hutchison2014-11-191-2/+2
| | | | | When testing CMAKE_<LANG>_COMPILER_ID values against "MSVC", do not allow the definition of the "MSVC" variable to be expanded.
* Clang: Support Windows variants for GNU and MSVC (#13035, #14458)Brad King2013-10-041-0/+32
Teach the compiler identification preprocessor tests to report when Clang simulates MSVC, and what version. If not MSVC, assume GNU. Teach compiler information modules Clang-(C|CXX) to recognize when Clang simulates MSVC and skip loading the GNU information. Teach the Windows-MSVC platform information to recognize when it is loaded as the simulated compiler and use that version information instead of the real compiler's (different) version scheme. Add platform modules Windows-Clang-(C|CXX) and support module Windows-Clang to load either Windows-MSVC or Windows-GNU and wrap the corresponding information macros.