diff --git a/CMakeLists.txt b/CMakeLists.txt index 913632fa3..0284f2bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -220,6 +220,20 @@ if(ENABLE_MODELICA_COMPILER) endif() if (ENABLE_MODELICA_COMPILER OR ENABLE_COMPILER) + message( + "To get the compiler working on windows, you need: clang-10 custom build with appropriate version of MSVC" + "; built with LLVM_ENABLE_PROJECTS=clang;lld LLVM_TARGETS_TO_BUILD=X86 LLVM_TOOL_LLD_BUILD=TRUE. Make sure NSIS is installed, and `make PACKAGE`." + "Note that downloading the official source package will not work, because it has symlinks. You have to clone the github repository, checkout 10.0.1, and configure " + "the llvm subdirectory. What else... oh right. You'll get a build error. Comment out line 181 in type_traits.h when you get there. It'll be fine. Trust me." + "Once the package is built, it should install fine, and be found by this script" + ) + + # we only support llvm-10 right now + find_package(LLVM 10 REQUIRED CONFIG) + # We want to nudge cmake towards clang-10, so it doesn't find the wrong libclang + # we cannot use the version number because clang's cmake files don't have versioning + find_package(Clang REQUIRED CONFIG HINTS /usr/lib/cmake/clang-10 "C:/Program Files/LLVM/lib/cmake/clang") + add_subdirectory(compiler) endif() diff --git a/compiler/CMakeLists.txt b/compiler/CMakeLists.txt index d7cae950a..47e7dd1f2 100644 --- a/compiler/CMakeLists.txt +++ b/compiler/CMakeLists.txt @@ -3,20 +3,6 @@ target_link_libraries(spawn_exe_launcher ${CMAKE_DL_LIBS}) add_library(compiler compiler.hpp compiler.cpp) -message( - "To get the compiler working on windows, you need: clang-10 custom build with appropriate version of MSVC" - "; built with LLVM_ENABLE_PROJECTS=clang;lld LLVM_TARGETS_TO_BUILD=X86 LLVM_TOOL_LLD_BUILD=TRUE. Make sure NSIS is installed, and `make PACKAGE`." - "Note that downloading the official source package will not work, because it has symlinks. You have to clone the github repository, checkout 10.0.1, and configure " - "the llvm subdirectory. What else... oh right. You'll get a build error. Comment out line 181 in type_traits.h when you get there. It'll be fine. Trust me." - "Once the package is built, it should install fine, and be found by this script" -) - -# we only support llvm-10 right now -find_package(LLVM 10 REQUIRED CONFIG) -# We want to nudge cmake towards clang-10, so it doesn't find the wrong libclang -# we cannot use the version number because clang's cmake files don't have versioning -find_package(Clang REQUIRED CONFIG HINTS /usr/lib/cmake/clang-10 "C:/Program Files/LLVM/lib/cmake/clang") - target_include_directories(compiler PRIVATE "${CMAKE_SOURCE_DIR}") target_include_directories(compiler PRIVATE "${CMAKE_BINARY_DIR}")