aboutsummaryrefslogtreecommitdiff
path: root/cmake/Findclang.cmake
AgeCommit message (Collapse)Author
2025-08-30build: update to LLVM 21Alex Rønne Petersen
Closes #20966.
2025-04-04build: Update to LLVM/Clang 20.Alex Rønne Petersen
2024-09-19add missing clang and llvm library listingsAndrew Kelley
2024-09-19cmake: Update to LLVM 19.Alex Rønne Petersen
Co-authored-by: David Rubin <daviru007@icloud.com>
2024-08-17cmake: CLANG_LIBRARIES: find libclang-cpp.so.18.1Forest
This fixes the failure to find CLANG_LIBRARIES on debian, which packages the relevant .so file at these paths: libclang-cpp18: /usr/lib/llvm-18/lib/libclang-cpp.so.18.1 libclang-cpp18: /usr/lib/x86_64-linux-gnu/libclang-cpp.so.18.1 libclang-cpp18: /usr/lib/x86_64-linux-gnu/libclang-cpp.so.18 (The latter two paths are symlinks to the first.)
2024-05-08add missing clang static library to the buildAndrew Kelley
2024-05-08update CMake files to LLVM 18Andrew Kelley
2023-09-19update cmake files to LLVM 17Andrew Kelley
2023-01-25update cmake files to LLVM 16Andrew Kelley
2023-01-04build: simplify llvm-config provided system library parsingkcbanner
- Revert the addition of CLANG_SYSTEM_LIBARIES and LLVM_SYSTEM_LIBRARIES - Change addCMakeLibraryList to parse non-absolute path .lib dependencies as system libraries
2023-01-04build: first pass on geting stage3 building under x64_64-windows-msvckcbanner
2022-08-02build: add new clang libraries for LLVM 15 upgradeAndrew Kelley
2022-07-28update to LLVM 15Andrew Kelley
release/15.x 37007475ca1b345b4c5d340e228bcd7a62732d81
2022-07-25CMake: Search for Clang in CMAKE_LIBRARY_PATH, CMAKE_PREFIX_PATH, and ↵Cody Tapscott
CMAKE_FRAMEWORK_PATH On some systems (esp. systems that use unique hashed file-paths for library-versions like Nix), we can't expect LLVM and Clang to share lib/bin directories. The best we can do is find the matching clang libraries in the CMAKE_LIBRARY_PATH provided by the environment
2022-07-23CMake: Search more permissively for LLDCody Tapscott
This change relaxes the restriction added in the prior commit that LLD should be alongside LLVM. This also leaves unresolved the issue of making sure the link mode (static or shared) of LLD matches that of LLVM/Clang. That would be an unfortunate restriction, since LLD seems to be provided only as a static lib on some distros.
2022-07-23CMake: Improve usage of `llvm-config`, esp. for consistent linkingCody Tapscott
This commit reworks the LLVM/Clang/LLD discovery process for CMake. The biggest changes are that: 1. We search for LLVM from most preferred directory to least, skipping any `llvm-config` that is the wrong version, or that doesn't support the requested link mode ("static" or "shared"). 2. `ZIG_PREFER_CLANG_CPP_DYLIB` has been renamed to `ZIG_SHARED_LLVM`, to better align with `ZIG_STATIC_LLVM`. 3. We only search for LLVM in the same directory alongside LLVM. 4. LLVM's link mode is forwarded to Clang, so that we can look for the appropriate shared/static libraries. 5. We use `--link-static` when querying `--system-libs` from llvm-config, so that this will include libz and other dependencies for statically linking LLD
2022-07-14CMake: Use NAMES_PER_DIR in all lookupsCody Tapscott
CMake has a surprising default behavior where looking up a library by multiple names gives the name order higher priority than the directory search order. For example, if your system provides "llvm-config-14" and CMAKE_PREFIX_PATH includes "llvm-config", CMake will always end up choosing the system-provided llvm-config-14. This change add NAMES_PER_DIR to request the more sensible behavior: directory search order has higher priority than name order, so CMAKE_PREFIX_PATH always wins over system-provided tools/libraries.
2022-02-03update cmake files to LLVM 14Andrew Kelley
2021-09-15Merge remote-tracking branch 'origin/master' into llvm13Andrew Kelley
Conflicts: * cmake/Findclang.cmake * cmake/Findlld.cmake * cmake/Findllvm.cmake In master branch, more search paths were added to these files with "12" in the path. In this commit I updated them to "13". * src/stage1/codegen.cpp * src/zig_llvm.cpp * src/zig_llvm.h In master branch, ZigLLVMBuildCmpXchg is improved to add `is_single_threaded`. However, the LLVM 13 C API has this already, and in the llvm13 branch, ZigLLVMBuildCmpXchg is deleted in favor of the C API. In this commit I updated stage2 to use the LLVM 13 C API rather than depending on an improved ZigLLVMBuildCmpXchg. Additionally, src/target.zig largestAtomicBits needed to be updated to include the new m68k ISA.
2021-09-08cmake: also check Homebrew install paths when looking for LLVMFnControlOption
- On Intel Macs, the path is /usr/local/opt/llvm@12 - On Silicon Macs, the path is /opt/homebrew/opt/llvm@12 This makes specifying CMAKE_PREFIX_PATH optional for Homebrew LLVM.
2021-08-15cmake: update to LLVM 13 rc1Andrew Kelley
More precisely, aac4fe380d16a957627af2d6e5110ee35ad7e7e7 which is the current tip of release/13.x. Immediately following commits are tracking the same LLVM version.
2020-12-16Update LLVM version numbers in CMakeJakub Konka
2020-09-03Merge remote-tracking branch 'origin/master' into llvm11Andrew Kelley
2020-09-01Fixing dylib search pathpwzk
2020-07-24llvm11: link against libClangToolingCoreAndrew Kelley
This is needed to successfully link against llvm, clang, and lld 11.
2020-07-24update LLVM 10 version numbers to 11Andrew Kelley
2020-04-17update cmake, update readme, in response to the dynamic linking fiascoAndrew Kelley
2020-04-11cmake: allow not finding some clang libsAndrew Kelley
partial revert of aaf99371b22e816a4162391d799b9d22bba21120 because it broke the build for some people
2020-04-10put the previous commit behind cmake option ZIG_PREFER_CLANG_CPP_DYLIBAndrew Kelley
Without this, building from source caused: CommandLine Error: Option 'mc-relax-all' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options This is due to LLVM static libs compiled in multiple times. But without the LLVM static libs on the linker line, it caused undefined symbol linker errors. So our hands are tied. Homebrew users will have to specify `-DZIG_PREFER_CLANG_CPP_DYLIB`.
2020-04-10look for clang-cpp shared lib when it existsAndrew Kelley
See #4799
2020-04-07Fix paths to find llvm/clang on DragonFlyMichael Neumann
2020-03-25cmake: address new warnings from cmake-3.17Michael Dusan
Match package-name case from CMakeLists.txt . New warning sample: The package name passed to `find_package_handle_standard_args` (LLVM) does not match the name of the calling package (llvm). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern.
2020-03-22simplify cmake logic for finding clangAndrew Kelley
which fixes the build on windows
2019-10-02llvm 9.0.0 => llvm 10.0.0Andrew Kelley
2019-07-16update to llvm9 trunkAndrew Kelley
2019-04-24Fix alignment of macro FIND_AND_ADD_CLANG_LIBWink Saville
2019-02-28Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2019-02-24add `zig cc` command to act like a C compilerAndrew Kelley
closes #490
2018-12-23Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2018-10-20Fix CMake finding LLVM/clang/lld on FreeBSDGreg V
2018-09-19update to llvm 8Andrew Kelley
2018-09-19build: fix finding llvm and clang 7Andrew Kelley
2018-03-22update to llvm 7.0.0Andrew Kelley
2018-03-17add CLANG_LIBDIRS cmake build variableBen Noordhuis
Mirrors LLVM_LIBDIRS, tells cmake where to look for libclang libraries.
2017-11-02update to llvm masterAndrew Kelley
2017-09-13fix up msvc stuff to make it work on linux and macos tooAndrew Kelley
2017-09-11Modified cmake to use LLVM imported packages.Jonathan Marler
2017-09-11Add support for MSVCJonathan Marler
2017-09-09build: add more search paths for libclangAndrew Kelley
thanks @smaeul
2017-08-26update build to look for llvm 5.0Andrew Kelley