Skip to content

Commit

Permalink
Moved iree-check-module-main.cc to iree/tools (iree-org#4312)
Browse files Browse the repository at this point in the history
This keeps all tools in the same place so that it's easy to find/switch between them.

Fixes iree-org#1986
  • Loading branch information
inho9606 authored Jan 5, 2021
1 parent 56e40ac commit 995d0b7
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 53 deletions.
2 changes: 1 addition & 1 deletion build_tools/bazel/iree_check_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def iree_check_test(
"$(location :%s)" % bytecode_module_name,
] + runner_args,
data = [":%s" % bytecode_module_name],
test_binary = "//iree/modules/check:iree-check-module",
test_binary = "//iree/tools:iree-check-module",
tags = tags + ["driver=%s" % driver],
**kwargs
)
Expand Down
8 changes: 4 additions & 4 deletions build_tools/cmake/iree_check_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function(iree_check_test)
add_dependencies(
"${_NAME}"
"${_MODULE_TARGET_NAME}"
iree_modules_check_iree-check-module
iree_tools_iree-check-module
)

iree_package_ns(_PACKAGE_NS)
Expand All @@ -125,7 +125,7 @@ function(iree_check_test)
${_TEST_NAME}
COMMAND
"${CMAKE_SOURCE_DIR}/build_tools/cmake/run_android_test.${IREE_HOST_SCRIPT_EXT}"
"${_ANDROID_REL_DIR}/$<TARGET_FILE_NAME:iree_modules_check_iree-check-module>"
"${_ANDROID_REL_DIR}/$<TARGET_FILE_NAME:iree_tools_iree-check-module>"
"--driver=${_RULE_DRIVER}"
"${_ANDROID_REL_DIR}/${_MODULE_FILE_NAME}"
${_RULE_RUNNER_ARGS}
Expand All @@ -137,7 +137,7 @@ function(iree_check_test)
_ENVIRONMENT_VARS
TEST_ANDROID_ABS_DIR=${_ANDROID_ABS_DIR}
TEST_DATA=${CMAKE_CURRENT_BINARY_DIR}/${_MODULE_FILE_NAME}
TEST_EXECUTABLE=$<TARGET_FILE:iree_modules_check_iree-check-module>
TEST_EXECUTABLE=$<TARGET_FILE:iree_tools_iree-check-module>
)
set_property(TEST ${_TEST_NAME} PROPERTY ENVIRONMENT ${_ENVIRONMENT_VARS})
iree_add_test_environment_properties(${_TEST_NAME})
Expand All @@ -147,7 +147,7 @@ function(iree_check_test)
"${_TEST_NAME}"
COMMAND
"${CMAKE_SOURCE_DIR}/build_tools/cmake/run_test.${IREE_HOST_SCRIPT_EXT}"
"$<TARGET_FILE:iree_modules_check_iree-check-module>"
"$<TARGET_FILE:iree_tools_iree-check-module>"
"--driver=${_RULE_DRIVER}"
"${CMAKE_CURRENT_BINARY_DIR}/${_MODULE_FILE_NAME}"
${_RULE_RUNNER_ARGS}
Expand Down
22 changes: 0 additions & 22 deletions iree/modules/check/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,6 @@ cc_test(
],
)

cc_binary(
name = "iree-check-module",
testonly = True,
srcs = ["iree-check-module-main.cc"],
deps = [
":native_module",
"//iree/base:api",
"//iree/base:core_headers",
"//iree/base:file_io",
"//iree/base:flags",
"//iree/base:status",
"//iree/base:tracing",
"//iree/hal/drivers",
"//iree/modules/hal",
"//iree/testing:gtest",
"//iree/tools/utils:vm_util",
"//iree/vm:bytecode_module",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/strings",
],
)

cc_library(
name = "native_module",
testonly = True,
Expand Down
24 changes: 0 additions & 24 deletions iree/modules/check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,6 @@ if(${IREE_HAL_DRIVER_VMLA})
)
endif()

iree_cc_binary(
NAME
iree-check-module
OUT
iree-check-module
SRCS
"iree-check-module-main.cc"
DEPS
::native_module
absl::flags
absl::strings
iree::base::api
iree::base::core_headers
iree::base::file_io
iree::base::flags
iree::base::status
iree::base::tracing
iree::hal::drivers
iree::modules::hal
iree::testing::gtest
iree::tools::utils::vm_util
iree::vm::bytecode_module
TESTONLY
)

iree_cc_library(
NAME
Expand Down
2 changes: 1 addition & 1 deletion iree/modules/check/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ iree_lit_test_suite(
name = "lit",
srcs = glob(["*.mlir"]),
data = [
"//iree/modules/check:iree-check-module",
"//iree/tools:IreeFileCheck",
"//iree/tools:iree-check-module",
"//iree/tools:iree-translate",
],
tags = ["hostonly"],
Expand Down
2 changes: 1 addition & 1 deletion iree/modules/check/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ iree_lit_test_suite(
SRCS
"${_GLOB_X_MLIR}"
DATA
iree::modules::check::iree-check-module
iree::tools::IreeFileCheck
iree::tools::iree-check-module
iree::tools::iree-translate
LABELS
"hostonly"
Expand Down
22 changes: 22 additions & 0 deletions iree/tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ cc_binary(
],
)

cc_binary(
name = "iree-check-module",
testonly = True,
srcs = ["iree-check-module-main.cc"],
deps = [
"//iree/base:api",
"//iree/base:core_headers",
"//iree/base:file_io",
"//iree/base:flags",
"//iree/base:status",
"//iree/base:tracing",
"//iree/hal/drivers",
"//iree/modules/check:native_module",
"//iree/modules/hal",
"//iree/testing:gtest",
"//iree/tools/utils:vm_util",
"//iree/vm:bytecode_module",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/strings",
],
)

cc_binary(
name = "iree-dump-module",
srcs = ["iree-dump-module-main.cc"],
Expand Down
25 changes: 25 additions & 0 deletions iree/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,31 @@ iree_cc_binary(
TESTONLY
)

iree_cc_binary(
NAME
iree-check-module
OUT
iree-check-module
SRCS
"iree-check-module-main.cc"
DEPS
iree::modules::check::native_module
absl::flags
absl::strings
iree::base::api
iree::base::core_headers
iree::base::file_io
iree::base::flags
iree::base::status
iree::base::tracing
iree::hal::drivers
iree::modules::hal
iree::testing::gtest
iree::tools::utils::vm_util
iree::vm::bytecode_module
TESTONLY
)

iree_cc_binary(
NAME
iree-dump-module
Expand Down
File renamed without changes.

0 comments on commit 995d0b7

Please sign in to comment.