Skip to content

Commit

Permalink
Move llvm finders back up one level
Browse files Browse the repository at this point in the history
  • Loading branch information
lefticus committed Feb 25, 2022
1 parent 62e2f36 commit edf6463
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
14 changes: 0 additions & 14 deletions compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit edf6463

Please sign in to comment.