File tree 12 files changed +24
-23
lines changed 12 files changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function(clang_tablegen)
17
17
message (FATAL_ERROR "SOURCE source-file required by clang_tablegen" )
18
18
endif ()
19
19
20
- set ( CLANG_TABLEGEN_ARGUMENTS "" )
20
+ set ( CLANG_TABLEGEN_ARGUMENTS -I ${CLANG_SOURCE_DIR} / include )
21
21
set ( LLVM_TARGET_DEFINITIONS ${CTG_SOURCE} )
22
22
tablegen(CLANG ${CTG_UNPARSED_ARGUMENTS} ${CLANG_TABLEGEN_ARGUMENTS} )
23
23
Original file line number Diff line number Diff line change 2
2
# Extra parameters for `tblgen' may come after `ofn' parameter.
3
3
# Adds the name of the generated file to TABLEGEN_OUTPUT.
4
4
5
+ if (LLVM_MAIN_INCLUDE_DIR)
6
+ set (LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_INCLUDE_DIR} )
7
+ endif ()
8
+
5
9
function (tablegen project ofn)
6
10
# Validate calling context.
7
11
if (NOT ${project} _TABLEGEN_EXE)
@@ -71,8 +75,6 @@ function(tablegen project ofn)
71
75
set (tblgen_change_flag "--write-if-changed" )
72
76
endif ()
73
77
74
- get_directory_property (includes "INCLUDE_DIRECTORIES" )
75
- list (TRANSFORM includes PREPEND -I)
76
78
# We need both _TABLEGEN_TARGET and _TABLEGEN_EXE in the DEPENDS list
77
79
# (both the target and the file) to have .inc files rebuilt on
78
80
# a tablegen change, as cmake does not propagate file-level dependencies
@@ -84,7 +86,6 @@ function(tablegen project ofn)
84
86
# but lets us having smaller and cleaner code here.
85
87
add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /${ofn}
86
88
COMMAND ${${project} _TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
87
- ${includes}
88
89
${LLVM_TABLEGEN_FLAGS}
89
90
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
90
91
${tblgen_change_flag}
Original file line number Diff line number Diff line change 1
1
function (mlir_tablegen ofn)
2
- tablegen(MLIR ${ARGV} )
2
+ tablegen(MLIR ${ARGV} "-I ${MLIR_MAIN_SRC_DIR} " "-I ${MLIR_INCLUDE_DIR} " )
3
3
set (TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR} /${ofn}
4
4
PARENT_SCOPE)
5
5
endfunction ()
Original file line number Diff line number Diff line change 1
- include_directories (include )
2
1
add_subdirectory (include )
3
2
4
3
set (LLVM_LINK_COMPONENTS
5
4
Support
6
5
)
7
6
8
7
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
9
- mlir_tablegen(ToyCombine.inc -gen-rewriters)
8
+ mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
10
9
add_public_tablegen_target(ToyCh3CombineIncGen)
11
10
12
11
add_toy_chapter(toyc-ch3
@@ -21,6 +20,7 @@ add_toy_chapter(toyc-ch3
21
20
ToyCh3CombineIncGen
22
21
)
23
22
23
+ include_directories (include /)
24
24
include_directories (${CMAKE_CURRENT_BINARY_DIR} )
25
25
include_directories (${CMAKE_CURRENT_BINARY_DIR} /include /)
26
26
target_link_libraries (toyc-ch3
Original file line number Diff line number Diff line change 1
- include_directories (include )
2
1
add_subdirectory (include )
3
2
4
3
set (LLVM_LINK_COMPONENTS
5
4
Support
6
5
)
7
6
8
7
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
9
- mlir_tablegen(ToyCombine.inc -gen-rewriters)
8
+ mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
10
9
add_public_tablegen_target(ToyCh4CombineIncGen)
11
10
12
11
add_toy_chapter(toyc-ch4
@@ -23,6 +22,7 @@ add_toy_chapter(toyc-ch4
23
22
ToyCh4CombineIncGen
24
23
)
25
24
25
+ include_directories (include /)
26
26
include_directories (${CMAKE_CURRENT_BINARY_DIR} )
27
27
include_directories (${CMAKE_CURRENT_BINARY_DIR} /include /)
28
28
target_link_libraries (toyc-ch4
Original file line number Diff line number Diff line change 1
1
set (LLVM_TARGET_DEFINITIONS Ops.td)
2
- mlir_tablegen(Ops.h.inc -gen-op-decls)
3
- mlir_tablegen(Ops.cpp.inc -gen-op-defs)
2
+ mlir_tablegen(Ops.h.inc -gen-op-decls "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
3
+ mlir_tablegen(Ops.cpp.inc -gen-op-defs "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
4
4
add_public_tablegen_target(ToyCh4OpsIncGen)
5
5
6
6
set (LLVM_TARGET_DEFINITIONS ShapeInferenceInterface.td)
Original file line number Diff line number Diff line change 1
- include_directories (include )
2
1
add_subdirectory (include )
3
2
4
3
set (LLVM_LINK_COMPONENTS
5
4
Support
6
5
)
7
6
8
7
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
9
- mlir_tablegen(ToyCombine.inc -gen-rewriters)
8
+ mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
10
9
add_public_tablegen_target(ToyCh5CombineIncGen)
11
10
12
11
add_toy_chapter(toyc-ch5
@@ -24,6 +23,7 @@ add_toy_chapter(toyc-ch5
24
23
ToyCh5CombineIncGen
25
24
)
26
25
26
+ include_directories (include /)
27
27
include_directories (${CMAKE_CURRENT_BINARY_DIR} )
28
28
include_directories (${CMAKE_CURRENT_BINARY_DIR} /include /)
29
29
get_property (dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
Original file line number Diff line number Diff line change 1
1
set (LLVM_TARGET_DEFINITIONS Ops.td)
2
- mlir_tablegen(Ops.h.inc -gen-op-decls)
3
- mlir_tablegen(Ops.cpp.inc -gen-op-defs)
2
+ mlir_tablegen(Ops.h.inc -gen-op-decls "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
3
+ mlir_tablegen(Ops.cpp.inc -gen-op-defs "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
4
4
add_public_tablegen_target(ToyCh5OpsIncGen)
5
5
6
6
set (LLVM_TARGET_DEFINITIONS ShapeInferenceInterface.td)
Original file line number Diff line number Diff line change 1
- include_directories (include )
2
1
add_subdirectory (include )
3
2
4
3
set (LLVM_LINK_COMPONENTS
@@ -7,7 +6,7 @@ set(LLVM_LINK_COMPONENTS
7
6
)
8
7
9
8
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
10
- mlir_tablegen(ToyCombine.inc -gen-rewriters)
9
+ mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
11
10
add_public_tablegen_target(ToyCh6CombineIncGen)
12
11
13
12
add_toy_chapter(toyc-ch6
@@ -26,6 +25,7 @@ add_toy_chapter(toyc-ch6
26
25
ToyCh6CombineIncGen
27
26
)
28
27
28
+ include_directories (include /)
29
29
include_directories (${CMAKE_CURRENT_BINARY_DIR} )
30
30
include_directories (${CMAKE_CURRENT_BINARY_DIR} /include /)
31
31
get_property (dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
Original file line number Diff line number Diff line change 1
1
set (LLVM_TARGET_DEFINITIONS Ops.td)
2
- mlir_tablegen(Ops.h.inc -gen-op-decls)
3
- mlir_tablegen(Ops.cpp.inc -gen-op-defs)
2
+ mlir_tablegen(Ops.h.inc -gen-op-decls "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
3
+ mlir_tablegen(Ops.cpp.inc -gen-op-defs "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
4
4
add_public_tablegen_target(ToyCh6OpsIncGen)
5
5
6
6
set (LLVM_TARGET_DEFINITIONS ShapeInferenceInterface.td)
Original file line number Diff line number Diff line change 1
- include_directories (include )
2
1
add_subdirectory (include )
3
2
4
3
set (LLVM_LINK_COMPONENTS
@@ -7,7 +6,7 @@ set(LLVM_LINK_COMPONENTS
7
6
)
8
7
9
8
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
10
- mlir_tablegen(ToyCombine.inc -gen-rewriters)
9
+ mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
11
10
add_public_tablegen_target(ToyCh7CombineIncGen)
12
11
13
12
add_toy_chapter(toyc-ch7
@@ -26,6 +25,7 @@ add_toy_chapter(toyc-ch7
26
25
ToyCh7CombineIncGen
27
26
)
28
27
28
+ include_directories (include /)
29
29
include_directories (${CMAKE_CURRENT_BINARY_DIR} )
30
30
include_directories (${CMAKE_CURRENT_BINARY_DIR} /include /)
31
31
get_property (dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
Original file line number Diff line number Diff line change 1
1
set (LLVM_TARGET_DEFINITIONS Ops.td)
2
- mlir_tablegen(Ops.h.inc -gen-op-decls)
3
- mlir_tablegen(Ops.cpp.inc -gen-op-defs)
2
+ mlir_tablegen(Ops.h.inc -gen-op-decls "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
3
+ mlir_tablegen(Ops.cpp.inc -gen-op-defs "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
4
4
add_public_tablegen_target(ToyCh7OpsIncGen)
5
5
6
6
set (LLVM_TARGET_DEFINITIONS ShapeInferenceInterface.td)
You can’t perform that action at this time.
0 commit comments