Skip to content

Commit 6f0fe62

Browse files
committed
Add missing build-time dependency in FrontendTool CMake
FrontendTool cpp files use headers from lib/Frontend that themselves uses MLIR headers containing tablegen generated content. In parallel builds, if FrontendTool is built before the headers required by Frontend, the build may fail with message like: ``` Building CXX object tools/flang/lib/FrontendTool/CMakeFiles/obj.flangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o In file included from mlir/include/mlir/IR/BuiltinTypes.h:13, from mlir/include/mlir/IR/FunctionSupport.h:17, from mlir/include/mlir/IR/BuiltinOps.h:16, from flang/include/flang/Frontend/CompilerInstance.h:11, from flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:14: mlir/include/mlir/IR/SubElementInterfaces.h:21:10: fatal error: mlir/IR/SubElementAttrInterfaces.h.inc: No such file or directory 21 | #include "mlir/IR/SubElementAttrInterfaces.h.inc" | ``` Make Frontend a dependency of FrontendTool so that all the headers from Frontend are ready to be used when building FrontendTool.
1 parent 0ffaec8 commit 6f0fe62

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

flang/lib/FrontendTool/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ add_flang_library(flangFrontendTool
22
ExecuteCompilerInvocation.cpp
33

44
DEPENDS
5+
# This makes sure that the MLIR dependencies of flangFrontend (which are
6+
# transitively required here) are generated before this target is build.
7+
flangFrontend
58
clangBasic
69

710
LINK_LIBS

0 commit comments

Comments
 (0)