File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,16 +83,23 @@ add_executable(subdoc
8383# subdoc_lib
8484subspace_default_compile_options (subdoc_lib )
8585
86- find_package (LLVM REQUIRED )
87- find_package (Clang REQUIRED )
8886llvm_config (subdoc_lib )
89- target_include_directories (subdoc_lib PUBLIC ${LLVM_INCLUDE_DIRS} )
90- target_link_directories (subdoc_lib PUBLIC ${LLVM_LIBRARY_DIRS} )
87+ include (FetchContent )
88+ FetchContent_GetProperties (llvm-project)
89+ target_include_directories (subdoc_lib PUBLIC
90+ "${llvm-project_SOURCE_DIR } /clang/include"
91+ "${llvm-project_SOURCE_DIR } /llvm/include"
92+ "${llvm-project_BINARY_DIR } /include"
93+ "${llvm-project_BINARY_DIR } /tools/clang/include"
94+ )
95+ target_link_directories (subdoc_lib PUBLIC
96+ "${llvm-project_BINARY_DIR } /clang/lib"
97+ )
9198
92- target_link_libraries ( subdoc_lib
93- subspace::lib
94- md4c
95- md4c-html
99+ set (SUBDOC_LLVM_DEPS
100+ Support
101+ )
102+ set (SUBDOC_CLANG_DEPS
96103 clangAnalysis
97104 clangAnalysisFlowSensitive
98105 clangAnalysisFlowSensitiveModels
@@ -136,6 +143,14 @@ target_link_libraries(subdoc_lib
136143 clangToolingSyntax
137144 clangTransformer
138145)
146+ llvm_map_components_to_libnames (llvm_libs "${SUBDOC_LLVM_DEPS} ;${SUBDOC_CLANG_DEPS} " )
147+
148+ target_link_libraries (subdoc_lib
149+ subspace::lib
150+ md4c
151+ md4c-html
152+ ${llvm_libs}
153+ )
139154
140155# subdoc binary
141156subspace_binary_default_compile_options (subdoc )
Original file line number Diff line number Diff line change 11include (FetchContent )
22
3+ # Thirds-party projects should be built with warnings disabled to limit noise and build breaks.
4+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } -w -Wno-error" )
5+
36# This directory handles third-party dependency package management.
47#
58# Packages that use CMake are handled using `FetchContent`. `FetchContent` is split into two
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ add_subdirectory(fmt)
33add_subdirectory (googletest )
44add_subdirectory (md4c )
55add_subdirectory (nanobench )
6+ add_subdirectory (llvm-project )
Original file line number Diff line number Diff line change @@ -13,3 +13,5 @@ if(SUBSPACE_BUILD_BENCHMARKS)
1313 FetchContent_MakeAvailable (nanobench)
1414 set_property (TARGET nanobench PROPERTY CXX_STANDARD 20)
1515endif ()
16+
17+ FetchContent_MakeAvailable (llvm-project)
Original file line number Diff line number Diff line change 1+ set (LLVM_BUILD_TOOLS No CACHE BOOL "" )
2+ set (LLVM_ENABLE_PROJECTS "llvm;clang" CACHE BOOL "" )
3+ set (LLVM_ENABLE_WARNINGS No CACHE BOOL "" )
4+ set (LLVM_INSTALL_BINUTILS_SYMLINKS No CACHE BOOL "" )
5+ set (LLVM_INSTALL_CCTOOLS_SYMLINKS No CACHE BOOL "" )
6+ set (LLVM_TARGETS_TO_BUILD "Native" CACHE BOOL "" )
7+ set (LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "" )
8+
9+ FetchContent_Declare (
10+ llvm-project
11+ GIT_REPOSITORY https://github.com/llvm/llvm-project.git
12+ GIT_TAG llvmorg-17.0.6
13+ GIT_SHALLOW Yes
14+ SOURCE_SUBDIR llvm
15+ SYSTEM
16+ OVERRIDE_FIND_PACKAGE
17+ )
You can’t perform that action at this time.
0 commit comments