Quick change to review
Just to be clear this causes a bunch of problems for my use case
Run Build Command:"/usr/local/bin/ninja" "cmTC_a0bd6" [1/2] Building CXX object CMakeFiles/cmTC_a0bd6.dir/CMakeCXXCompilerABI.cpp.obj [2/2] Linking CXX executable cmTC_a0bd6.exe FAILED: cmTC_a0bd6.exe : && /Users/martell/llvm/usr/bin/x86_64-w64-mingw32-clang++ -v CMakeFiles/cmTC_a0bd6.dir/CMakeCXXCompilerABI.cpp.obj -o cmTC_a0bd6.exe -Wl,--out-implib,libcmTC_a0bd6.dll.a -Wl,--major-image-version,0,--minor-image-version,0 && : clang version 5.0.0 (trunk 304663) (llvm/trunk 304665) Target: x86_64--windows-gnu Thread model: posix InstalledDir: /Users/martell/llvm/usr/bin "/Users/martell/llvm/usr/bin/lld" -flavor gnu -m i386pep -Bdynamic -o cmTC_a0bd6.exe /Users/martell/llvm/usr/x86_64-w64-mingw32/lib/crt2.o /Users/martell/llvm/usr/x86_64-w64-mingw32/lib/crtbegin.o -L/Users/martell/llvm/usr/x86_64-w64-mingw32/lib -L/Users/martell/llvm/usr/lib -L/Users/martell/llvm/usr/x86_64-w64-mingw32/sys-root/mingw/lib CMakeFiles/cmTC_a0bd6.dir/CMakeCXXCompilerABI.cpp.obj --out-implib libcmTC_a0bd6.dll.a --major-image-version 0 --minor-image-version 0 -lc++ -lmingw32 /Users/martell/llvm/usr/lib/clang/5.0.0/lib/windows/libclang_rt.builtins-x86_64.a -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 /Users/martell/llvm/usr/x86_64-w64-mingw32/lib/crtend.o error: Unable to find library -lc++
I need to specifically define to even get this far.
Not something I think I should have to do to bootstrap a cross compiler.
Can you tell me everything you specifically need from HandleLLVMOptions so I can extract that into libcxxabi's cmake modules in a followup commit.
Your use case isn't the only use case that exists, far from it.
I don't want to be duplicating LLVM modules we should just be using directly
I think bootstrapping a cross compiler by cross building libc++abi and libc++ is a pretty generic use case.
Pulling in all of LLVM's cmake modules depends on top of libc++abi hinders cmake detection when cross building libc++abi standalone.
You said before that we needed this for the sanitizer.
Do you know why libc++ doesn't need to import this?
Sorry to revive a very old issue, but this change also breaks my WebAssembly build. libcxx doesn't include this and therefor works fine, its only libcxxabi that breaks.. and if I remove this line it works.
What options does this file add? And does libcxxabi really need them? If so, presumbly we should add this line in libcxx too?
My problem is that HandleLLVMOptions seems to add a lot of compiler and system check.... seemingly more than are required to build libcxxabi. It seems like by including this line we are maybe needlessly restricting the set of compilers/environments on which it can be built.
Hey Sam, this was my issue also, In rL304374 I did a refactor on the cmake usage in libcxxabi.
I removed include(HandleLLVMOptions OPTIONAL) which made the change a FC rather then a NFC so I re added this line.
Eric said that this is still needed for out of tree builds, beyond that I don't know any more details as I have never used llvm in this way.