forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Bazel build configuration for EmitC (iree-org#8287)
Part of iree-org#7345
- Loading branch information
Showing
7 changed files
with
233 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2022 The IREE Authors | ||
# | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content") | ||
|
||
package( | ||
default_visibility = ["//visibility:public"], | ||
features = ["layering_check"], | ||
licenses = ["notice"], # Apache 2.0 | ||
) | ||
|
||
iree_cmake_extra_content( | ||
content = """ | ||
if(NOT "${IREE_ENABLE_EMITC}") | ||
return() | ||
endif() | ||
""", | ||
) | ||
|
||
cc_library( | ||
name = "VMToEmitC", | ||
srcs = [ | ||
"ConvertVMToEmitC.cpp", | ||
"DropExcludedExports.cpp", | ||
"EmitCTypeConverter.cpp", | ||
], | ||
hdrs = [ | ||
"ConvertVMToEmitC.h", | ||
"DropExcludedExports.h", | ||
"EmitCTypeConverter.h", | ||
"VMAnalysis.h", | ||
], | ||
deps = [ | ||
"//iree/compiler/Dialect/Util/Conversion", | ||
"//iree/compiler/Dialect/Util/IR", | ||
"//iree/compiler/Dialect/VM/Analysis", | ||
"//iree/compiler/Dialect/VM/IR", | ||
"//iree/compiler/Dialect/VM/Utils:CallingConvention", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:ControlFlowOps", | ||
"@llvm-project//mlir:EmitC", | ||
"@llvm-project//mlir:IR", | ||
"@llvm-project//mlir:MathDialect", | ||
"@llvm-project//mlir:Pass", | ||
"@llvm-project//mlir:StandardOps", | ||
"@llvm-project//mlir:Transforms", | ||
], | ||
) |
78 changes: 44 additions & 34 deletions
78
iree/compiler/Dialect/VM/Conversion/VMToEmitC/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,46 @@ | ||
# Copyright 2020 The IREE Authors | ||
# | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
################################################################################ | ||
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from # | ||
# iree/compiler/Dialect/VM/Conversion/VMToEmitC/BUILD # | ||
# # | ||
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary # | ||
# CMake-only content. # | ||
# # | ||
# To disable autogeneration for this file entirely, delete this header. # | ||
################################################################################ | ||
|
||
if(${IREE_ENABLE_EMITC}) | ||
iree_add_all_subdirs() | ||
|
||
iree_cc_library( | ||
NAME | ||
VMToEmitC | ||
HDRS | ||
"ConvertVMToEmitC.h" | ||
"DropExcludedExports.h" | ||
"EmitCTypeConverter.h" | ||
"VMAnalysis.h" | ||
SRCS | ||
"ConvertVMToEmitC.cpp" | ||
"DropExcludedExports.cpp" | ||
"EmitCTypeConverter.cpp" | ||
DEPS | ||
MLIRControlFlow | ||
MLIREmitC | ||
MLIRIR | ||
MLIRPass | ||
MLIRStandard | ||
MLIRTransforms | ||
iree::compiler::Dialect::Util::Conversion | ||
iree::compiler::Dialect::Util::IR | ||
iree::compiler::Dialect::VM::Analysis | ||
iree::compiler::Dialect::VM::IR | ||
iree::compiler::Dialect::VM::Utils::CallingConvention | ||
PUBLIC | ||
) | ||
if(NOT "${IREE_ENABLE_EMITC}") | ||
return() | ||
endif() | ||
|
||
iree_add_all_subdirs() | ||
|
||
iree_cc_library( | ||
NAME | ||
VMToEmitC | ||
HDRS | ||
"ConvertVMToEmitC.h" | ||
"DropExcludedExports.h" | ||
"EmitCTypeConverter.h" | ||
"VMAnalysis.h" | ||
SRCS | ||
"ConvertVMToEmitC.cpp" | ||
"DropExcludedExports.cpp" | ||
"EmitCTypeConverter.cpp" | ||
DEPS | ||
LLVMSupport | ||
MLIRControlFlow | ||
MLIREmitC | ||
MLIRIR | ||
MLIRMath | ||
MLIRPass | ||
MLIRStandard | ||
MLIRTransforms | ||
iree::compiler::Dialect::Util::Conversion | ||
iree::compiler::Dialect::Util::IR | ||
iree::compiler::Dialect::VM::Analysis | ||
iree::compiler::Dialect::VM::IR | ||
iree::compiler::Dialect::VM::Utils::CallingConvention | ||
PUBLIC | ||
) | ||
|
||
### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Copyright 2022 The IREE Authors | ||
# | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content") | ||
|
||
package( | ||
default_visibility = ["//visibility:public"], | ||
features = ["layering_check"], | ||
licenses = ["notice"], # Apache 2.0 | ||
) | ||
|
||
iree_cmake_extra_content( | ||
content = """ | ||
if(NOT "${IREE_ENABLE_EMITC}") | ||
return() | ||
endif() | ||
""", | ||
) | ||
|
||
cc_library( | ||
name = "TranslateToCpp", | ||
srcs = [ | ||
"TranslateToCpp.cpp", | ||
], | ||
hdrs = [ | ||
"CppEmitter.h", | ||
], | ||
deps = [ | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:ControlFlowOps", | ||
"@llvm-project//mlir:EmitC", | ||
"@llvm-project//mlir:IR", | ||
"@llvm-project//mlir:SCFDialect", | ||
"@llvm-project//mlir:StandardOps", | ||
"@llvm-project//mlir:Support", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "C", | ||
srcs = [ | ||
"CModuleTarget.cpp", | ||
"TranslationFlags.cpp", | ||
"TranslationRegistration.cpp", | ||
], | ||
hdrs = [ | ||
"CModuleTarget.h", | ||
"TranslationFlags.h", | ||
], | ||
deps = [ | ||
":TranslateToCpp", | ||
"//iree/compiler/Dialect/Util/IR", | ||
"//iree/compiler/Dialect/Util/Transforms", | ||
"//iree/compiler/Dialect/VM/Analysis", | ||
"//iree/compiler/Dialect/VM/Conversion/VMToEmitC", | ||
"//iree/compiler/Dialect/VM/IR", | ||
"//iree/compiler/Dialect/VM/Transforms", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:IR", | ||
"@llvm-project//mlir:Pass", | ||
"@llvm-project//mlir:Support", | ||
"@llvm-project//mlir:Transforms", | ||
"@llvm-project//mlir:Translation", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,62 @@ | ||
# Copyright 2019 The IREE Authors | ||
# | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
################################################################################ | ||
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from # | ||
# iree/compiler/Dialect/VM/Target/C/BUILD # | ||
# # | ||
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary # | ||
# CMake-only content. # | ||
# # | ||
# To disable autogeneration for this file entirely, delete this header. # | ||
################################################################################ | ||
|
||
if(NOT "${IREE_ENABLE_EMITC}") | ||
return() | ||
endif() | ||
|
||
if(${IREE_ENABLE_EMITC}) | ||
iree_add_all_subdirs() | ||
iree_add_all_subdirs() | ||
|
||
iree_cc_library( | ||
NAME | ||
TranslateToCpp | ||
HDRS | ||
CppEmitter.h | ||
SRCS | ||
TranslateToCpp.cpp | ||
DEPS | ||
MLIREmitC | ||
MLIRIR | ||
MLIRControlFlow | ||
MLIRSCF | ||
MLIRStandard | ||
) | ||
iree_cc_library( | ||
NAME | ||
TranslateToCpp | ||
HDRS | ||
"CppEmitter.h" | ||
SRCS | ||
"TranslateToCpp.cpp" | ||
DEPS | ||
LLVMSupport | ||
MLIRControlFlow | ||
MLIREmitC | ||
MLIRIR | ||
MLIRSCF | ||
MLIRStandard | ||
MLIRSupport | ||
PUBLIC | ||
) | ||
|
||
iree_cc_library( | ||
NAME | ||
C | ||
HDRS | ||
"CModuleTarget.h" | ||
"TranslationFlags.h" | ||
SRCS | ||
"CModuleTarget.cpp" | ||
"TranslationFlags.cpp" | ||
"TranslationRegistration.cpp" | ||
DEPS | ||
::TranslateToCpp | ||
LLVMSupport | ||
MLIRIR | ||
MLIRPass | ||
MLIRSupport | ||
iree::compiler::Dialect::VM::Analysis | ||
iree::compiler::Dialect::VM::IR | ||
iree::compiler::Dialect::VM::Conversion::VMToEmitC | ||
PUBLIC | ||
) | ||
endif() | ||
iree_cc_library( | ||
NAME | ||
C | ||
HDRS | ||
"CModuleTarget.h" | ||
"TranslationFlags.h" | ||
SRCS | ||
"CModuleTarget.cpp" | ||
"TranslationFlags.cpp" | ||
"TranslationRegistration.cpp" | ||
DEPS | ||
::TranslateToCpp | ||
LLVMSupport | ||
MLIRIR | ||
MLIRPass | ||
MLIRSupport | ||
MLIRTransforms | ||
MLIRTranslation | ||
iree::compiler::Dialect::Util::IR | ||
iree::compiler::Dialect::Util::Transforms | ||
iree::compiler::Dialect::VM::Analysis | ||
iree::compiler::Dialect::VM::Conversion::VMToEmitC | ||
iree::compiler::Dialect::VM::IR | ||
iree::compiler::Dialect::VM::Transforms | ||
PUBLIC | ||
) | ||
|
||
### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters