-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathCMakeLists.txt
72 lines (56 loc) · 2.59 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
project(AnyDSL)
set(AnyDSL_REMOTE_URL "https://github.com/AnyDSL" CACHE STRING "url used by git to checkout AnyDSL packages")
set(AnyDSL_DEFAULT_BRANCH master CACHE STRING "the default branch of thorin, impala, etc.")
message(STATUS "AnyDSL remote url: ${AnyDSL_REMOTE_URL}")
message(STATUS "AnyDSL default branch: ${AnyDSL_DEFAULT_BRANCH}")
set(AnyDSL_PKG_Half_AUTOBUILD OFF CACHE BOOL "forces the availability of Half to build AnyDSL packages")
set(AnyDSL_PKG_LLVM_AUTOBUILD OFF CACHE BOOL "forces the availability of LLVM to build AnyDSL packages")
set(AnyDSL_PKG_RV_AUTOBUILD OFF CACHE BOOL "forces the availability of RV to build AnyDSL packages")
# Half
include(cmake/half-package.cmake)
if(Half_DIR)
message(STATUS "Half_DIR: ${Half_DIR}")
else()
message(STATUS "Half not found.")
endif()
# LLVM and clang
include(cmake/llvm-package.cmake)
include(cmake/rv-package.cmake)
find_package(LLVM QUIET)
if(LLVM_FOUND)
message(STATUS "LLVM_DIR: ${LLVM_DIR}")
message(STATUS "LLVM_VERSION: ${LLVM_VERSION}")
message(STATUS "LLVM_ENABLE_RTTI: ${LLVM_ENABLE_RTTI}")
message(STATUS "LLVM_LINK_LLVM_DYLIB: ${LLVM_LINK_LLVM_DYLIB}")
else()
message(STATUS "LLVM not found.")
endif()
include(cmake/fetch-package.cmake)
# AnyDSL_thorin
fetch_anydsl_package(AnyDSL_thorin_DIR thorin thorin ${AnyDSL_REMOTE_URL}/thorin)
message(STATUS "AnyDSL_thorin_DIR: ${AnyDSL_thorin_DIR}")
set(Thorin_DIR ${AnyDSL_thorin_DIR})
# TODO: this actually fixes missing dependency in thorin to include llvm/IR/Attributes.inc
if(TARGET intrinsics_gen)
add_dependencies(thorin intrinsics_gen)
endif()
# AnyDSL_impala
fetch_anydsl_package(AnyDSL_impala_DIR impala impala ${AnyDSL_REMOTE_URL}/impala)
message(STATUS "AnyDSL_impala_DIR: ${AnyDSL_impala_DIR}")
set(Impala_DIR ${AnyDSL_impala_DIR})
# AnyDSL_artic
fetch_anydsl_package(AnyDSL_artic_DIR artic artic ${AnyDSL_REMOTE_URL}/artic)
message(STATUS "AnyDSL_artic_DIR: ${AnyDSL_artic_DIR}")
set(Artic_DIR ${AnyDSL_artic_DIR})
# AnyDSL_runtime
fetch_anydsl_package(AnyDSL_runtime_DIR runtime AnyDSL_runtime ${AnyDSL_REMOTE_URL}/runtime)
message(STATUS "AnyDSL_runtime_DIR: ${AnyDSL_runtime_DIR}")
# this triggers the build of clang that is required for the anydsl_runtime_wrap() macro of the runtime
# TODO: actually clang shall be build for impala/artic as they require further processing of their output
if(TARGET clang)
add_dependencies(runtime clang)
endif()
add_custom_target(pull COMMENT ">>> pull all AnyDSL packages")
add_dependencies(pull pull-thorin pull-impala pull-artic pull-runtime)
add_subdirectory(applications)