1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

CMake: Enable support for clang with gnu-like cmdline on Windows

This commit is contained in:
reuk 2021-06-02 15:35:15 +01:00
parent 17d967551c
commit db2a809832
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
3 changed files with 20 additions and 4 deletions

View file

@ -137,6 +137,22 @@ Note that the static library produced by `juce_add_binary_data` automatically se
Building universal binaries that will run on both arm64 and x86_64 can be achieved by
configuring the CMake project with `"-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64"`.
### Building with Clang on Windows
Clang-cl (Clang with MSVC-like command-line) should work by default. If you are generating a Visual
Studio project, and have installed the LLVM package which is distributed with Visual Studio, then
you can configure a Clang-cl build by passing "-T ClangCL" on your configuration commandline.
If you wish to use Clang with GNU-like command-line instead, you can pass
`-DCMAKE_CXX_COMPILER=clang++` and `-DCMAKE_C_COMPILER=clang` on your configuration commandline.
clang++ and clang must be on your `PATH` for this to work. Only more recent versions of CMake
support Clang's GNU-like command-line on Windows. CMake 3.12 is not supported, CMake 3.15 has
support, CMake 3.20 or higher is recommended. Note that CMake doesn't seem to automatically link a
runtime library when building in this configuration, but this can be remedied by setting the
`MSVC_RUNTIME_LIBRARY` property. See the [official
documentation](https://cmake.org/cmake/help/v3.15/prop_tgt/MSVC_RUNTIME_LIBRARY.html) of this
property for usage recommendations.
### A note about compile definitions
Module options and plugin options that would previously have been set in the Projucer can be set on