Skip to content

Commit

Permalink
Use ClangSetup
Browse files Browse the repository at this point in the history
  • Loading branch information
Time0o committed Dec 27, 2021
1 parent 169c52f commit e6bcc0c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "fire-hpp"]
path = fire-hpp
url = https://github.com/kongaskristjan/fire-hpp
[submodule "ClangSetup"]
path = ClangSetup
url = https://github.com/Time0o/ClangSetup
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ include(CTest)

option(FIRE_LLVM_ENABLE_TESTING "Enable tests" ON)

find_package(LLVM REQUIRED CONFIG)
# Clang
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/ClangSetup)

include(ClangSetup)

# fire-hpp
set(FIRE_EXAMPLES OFF CACHE BOOL "Compile fire-hpp examples")
set(FIRE_UNIT_TESTS OFF CACHE BOOL "Enable fire-hpp unit tests")
add_subdirectory(fire-hpp EXCLUDE_FROM_ALL)

# fire-llvm
add_subdirectory(fire-llvm)

function(fire_llvm_config TARGET)
Expand Down
1 change: 1 addition & 0 deletions ClangSetup
Submodule ClangSetup added at dc1cda
8 changes: 3 additions & 5 deletions fire-llvm/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.9)

add_library(fire-llvm-plugin MODULE fire.cpp)
target_compile_features(fire-llvm-plugin PRIVATE cxx_std_17)

separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})

add_definitions(${LLVM_DEFINITIONS_LIST})
include_directories(${LLVM_INCLUDE_DIRS})
target_link_libraries(fire-llvm-plugin PRIVATE clang-cpp)
llvm_config(fire-llvm-plugin USE_SHARED option)
target_include_directories(fire-llvm-plugin PRIVATE ${LLVM_INCLUDE_DIRS})

0 comments on commit e6bcc0c

Please sign in to comment.