Index: clang/tools/CMakeLists.txt =================================================================== --- clang/tools/CMakeLists.txt +++ clang/tools/CMakeLists.txt @@ -15,7 +15,9 @@ add_clang_subdirectory(clang-rename) add_clang_subdirectory(clang-refactor) -if(UNIX OR MINGW) +# For MinGW we only enable shared library if LLVM_LINK_LLVM_DYLIB=ON. +# Without that option resulting library is too close to 2^16 DLL exports limit. +if(UNIX OR (MINGW AND LLVM_LINK_LLVM_DYLIB)) add_clang_subdirectory(clang-shlib) endif()