File tree 12 files changed +23
-24
lines changed
12 files changed +23
-24
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 -I ${CLANG_SOURCE_DIR} / include )
20
+ set ( CLANG_TABLEGEN_ARGUMENTS "" )
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
-
9
5
function (tablegen project ofn)
10
6
# Validate calling context.
11
7
if (NOT ${project} _TABLEGEN_EXE)
@@ -75,6 +71,8 @@ function(tablegen project ofn)
75
71
set (tblgen_change_flag "--write-if-changed" )
76
72
endif ()
77
73
74
+ get_directory_property (includes "INCLUDE_DIRECTORIES" )
75
+ list (TRANSFORM includes PREPEND -I)
78
76
# We need both _TABLEGEN_TARGET and _TABLEGEN_EXE in the DEPENDS list
79
77
# (both the target and the file) to have .inc files rebuilt on
80
78
# a tablegen change, as cmake does not propagate file-level dependencies
@@ -86,6 +84,7 @@ function(tablegen project ofn)
86
84
# but lets us having smaller and cleaner code here.
87
85
add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /${ofn}
88
86
COMMAND ${${project} _TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
87
+ ${includes}
89
88
${LLVM_TABLEGEN_FLAGS}
90
89
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
91
90
${tblgen_change_flag}
Original file line number Diff line number Diff line change 1
1
function (mlir_tablegen ofn)
2
- tablegen(MLIR ${ARGV} "-I ${MLIR_MAIN_SRC_DIR} " "-I ${MLIR_INCLUDE_DIR} " )
2
+ tablegen(MLIR ${ARGV} )
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 )
1
2
add_subdirectory (include )
2
3
3
4
set (LLVM_LINK_COMPONENTS
4
5
Support
5
6
)
6
7
7
8
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
8
- mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
9
+ mlir_tablegen(ToyCombine.inc -gen-rewriters)
9
10
add_public_tablegen_target(ToyCh3CombineIncGen)
10
11
11
12
add_toy_chapter(toyc-ch3
@@ -20,7 +21,6 @@ add_toy_chapter(toyc-ch3
20
21
ToyCh3CombineIncGen
21
22
)
22
23
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 )
1
2
add_subdirectory (include )
2
3
3
4
set (LLVM_LINK_COMPONENTS
4
5
Support
5
6
)
6
7
7
8
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
8
- mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
9
+ mlir_tablegen(ToyCombine.inc -gen-rewriters)
9
10
add_public_tablegen_target(ToyCh4CombineIncGen)
10
11
11
12
add_toy_chapter(toyc-ch4
@@ -22,7 +23,6 @@ add_toy_chapter(toyc-ch4
22
23
ToyCh4CombineIncGen
23
24
)
24
25
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 "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
3
- mlir_tablegen(Ops.cpp.inc -gen-op-defs "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
2
+ mlir_tablegen(Ops.h.inc -gen-op-decls)
3
+ mlir_tablegen(Ops.cpp.inc -gen-op-defs)
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 )
1
2
add_subdirectory (include )
2
3
3
4
set (LLVM_LINK_COMPONENTS
4
5
Support
5
6
)
6
7
7
8
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
8
- mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
9
+ mlir_tablegen(ToyCombine.inc -gen-rewriters)
9
10
add_public_tablegen_target(ToyCh5CombineIncGen)
10
11
11
12
add_toy_chapter(toyc-ch5
@@ -23,7 +24,6 @@ add_toy_chapter(toyc-ch5
23
24
ToyCh5CombineIncGen
24
25
)
25
26
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 "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
3
- mlir_tablegen(Ops.cpp.inc -gen-op-defs "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
2
+ mlir_tablegen(Ops.h.inc -gen-op-decls)
3
+ mlir_tablegen(Ops.cpp.inc -gen-op-defs)
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 )
1
2
add_subdirectory (include )
2
3
3
4
set (LLVM_LINK_COMPONENTS
@@ -6,7 +7,7 @@ set(LLVM_LINK_COMPONENTS
6
7
)
7
8
8
9
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
9
- mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
10
+ mlir_tablegen(ToyCombine.inc -gen-rewriters)
10
11
add_public_tablegen_target(ToyCh6CombineIncGen)
11
12
12
13
add_toy_chapter(toyc-ch6
@@ -25,7 +26,6 @@ add_toy_chapter(toyc-ch6
25
26
ToyCh6CombineIncGen
26
27
)
27
28
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 "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
3
- mlir_tablegen(Ops.cpp.inc -gen-op-defs "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
2
+ mlir_tablegen(Ops.h.inc -gen-op-decls)
3
+ mlir_tablegen(Ops.cpp.inc -gen-op-defs)
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 )
1
2
add_subdirectory (include )
2
3
3
4
set (LLVM_LINK_COMPONENTS
@@ -6,7 +7,7 @@ set(LLVM_LINK_COMPONENTS
6
7
)
7
8
8
9
set (LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
9
- mlir_tablegen(ToyCombine.inc -gen-rewriters "-I ${CMAKE_CURRENT_SOURCE_DIR} /include" )
10
+ mlir_tablegen(ToyCombine.inc -gen-rewriters)
10
11
add_public_tablegen_target(ToyCh7CombineIncGen)
11
12
12
13
add_toy_chapter(toyc-ch7
@@ -25,7 +26,6 @@ add_toy_chapter(toyc-ch7
25
26
ToyCh7CombineIncGen
26
27
)
27
28
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 "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
3
- mlir_tablegen(Ops.cpp.inc -gen-op-defs "-I ${CMAKE_CURRENT_SOURCE_DIR} /.." )
2
+ mlir_tablegen(Ops.h.inc -gen-op-decls)
3
+ mlir_tablegen(Ops.cpp.inc -gen-op-defs)
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