Skip to content

Commit a175c1d

Browse files
committed
[mlir][python] Support CLANG_CL
1 parent b94ee42 commit a175c1d

File tree

3 files changed

+524
-0
lines changed

3 files changed

+524
-0
lines changed

.clang-tidy

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-const-correctness,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion,-misc-use-anonymous-namespace,readability-identifier-naming,-misc-include-cleaner'
2+
CheckOptions:
3+
- key: readability-identifier-naming.ClassCase
4+
value: CamelCase
5+
- key: readability-identifier-naming.EnumCase
6+
value: CamelCase
7+
- key: readability-identifier-naming.FunctionCase
8+
value: camelBack
9+
- key: readability-identifier-naming.MemberCase
10+
value: CamelCase
11+
- key: readability-identifier-naming.ParameterCase
12+
value: CamelCase
13+
- key: readability-identifier-naming.UnionCase
14+
value: CamelCase
15+
- key: readability-identifier-naming.VariableCase
16+
value: CamelCase
17+
- key: readability-identifier-naming.IgnoreMainLikeFunctions
18+
value: 1
19+
- key: readability-redundant-member-init.IgnoreBaseInCopyConstructors
20+
value: 1
21+
- key: modernize-use-default-member-init.UseAssignment
22+
value: 1
23+
# MLIR
24+
- key: readability-identifier-naming.MemberCase
25+
value: camelBack
26+
- key: readability-identifier-naming.ParameterCase
27+
value: camelBack
28+
- key: readability-identifier-naming.VariableCase
29+
value: camelBack

projects/eudsl-py/src/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,21 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
55

66
find_package(LLVM REQUIRED CONFIG)
77
find_package(MLIR REQUIRED CONFIG)
8+
find_package(Clang REQUIRED CONFIG)
89
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
910
message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")
11+
message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}")
1012
include_directories(${LLVM_INCLUDE_DIRS})
1113
include_directories(${MLIR_INCLUDE_DIRS})
14+
include_directories(${CLANG_INCLUDE_DIRS})
15+
16+
list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
17+
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
18+
list(APPEND CMAKE_MODULE_PATH "${CLANG_CMAKE_DIR}")
19+
include(TableGen)
20+
include(AddLLVM)
21+
include(AddMLIR)
22+
include(AddClang)
1223
# technically we need this but our LLVM is compiled without exception handling
1324
# and that breaks windows
1425
if(NOT WIN32)
@@ -19,6 +30,17 @@ if(NOT TARGET LLVMSupport)
1930
message(FATAL_ERROR "LLVMSupport not found")
2031
endif()
2132

33+
add_clang_executable(eudsl-generator Generator.cpp PARTIAL_SOURCES_INTENDED)
34+
target_link_libraries(eudsl-generator
35+
PRIVATE
36+
clangAST
37+
clangBasic
38+
clangFrontend
39+
clangSerialization
40+
clangTooling
41+
LLVMSupport
42+
)
43+
2244
# no clue why but with LLVM_LINK_LLVM_DYLIB even static libs depend on LLVM
2345
get_property(MLIR_ALL_LIBS GLOBAL PROPERTY MLIR_ALL_LIBS)
2446
foreach(_lib ${MLIR_ALL_LIBS})

0 commit comments

Comments
 (0)