Open nolange opened 1 month ago
still needs some work
Had to fix some issues, mostly on windows (needs to convert to native paths) and some quoting.
Something of note is, that CMake does locate matching tools by searching first for the version-qualified name. For example it will look for llvm-ranlib-18
then llvm-ranlib
. Means that is available, a system llvm-ranlib-18
will be used.
This is not optimal but is unlikely to cause big trouble.
Still, ideally llvm-mingw
could provide llvm-ranlib-18
, making these lookup schemes more robust.
i dropped the support of using a system clang/llvm installation. its pretty hard to get right on windows, i am not even sure if its bc if bugs or if some antivirus/company it policies intervene in my testing.
I added some more stuff in another branch, primary to add some unit tests:
https://github.com/nolange/llvm-mingw/commits/new_toolchainfile/
There is a subdirectory test/cmake/tests
building the existing tests. I am probably biased but this should be way cleaner than the Makefile and offers integration with ctest and all the benefits that come with CMake (like just opening the directory in vscode and have everything setup automatically).
And another test/cmake/template
which should serve as a basic project that works with llvm, msvc and a series of IDEs (Visual Studio).
Those toolchain files greatly simplify configuring a project to use the llvm-mingw toolchain.
The toolchain file will:
libc++
andlld
CMake has some quite complete and complex machinery to detect further tools and configuration. Whatever supported in your CMake version should "just work" (eg. C++ Modules one day).
The lookup uses the system clang toolchain as fallback, and does not require any of the wrappers / symlinks in
bin
. ie. Its possible to delete thebin
directory if a matching clang/llvm toolchain is installed.