Build simple_embedding test via CMake
Closes https://github.com/google/iree/pull/407
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/407 from marbre:cmake-samples 95657c63dbf26afe5f3cdb4e532c9d9d53dbc336
PiperOrigin-RevId: 288726476
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a203999..bd22e94 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,6 +115,7 @@
add_subdirectory(iree/base)
add_subdirectory(iree/hal)
+add_subdirectory(iree/modules)
add_subdirectory(iree/schemas)
add_subdirectory(iree/testing)
diff --git a/iree/modules/CMakeLists.txt b/iree/modules/CMakeLists.txt
new file mode 100644
index 0000000..3b87429
--- /dev/null
+++ b/iree/modules/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+add_subdirectory(hal)
diff --git a/iree/samples/CMakeLists.txt b/iree/samples/CMakeLists.txt
index a47f210..9419e5e 100644
--- a/iree/samples/CMakeLists.txt
+++ b/iree/samples/CMakeLists.txt
@@ -11,3 +11,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+
+add_subdirectory(simple_embedding)
diff --git a/iree/samples/simple_embedding/CMakeLists.txt b/iree/samples/simple_embedding/CMakeLists.txt
new file mode 100644
index 0000000..e9e54d0
--- /dev/null
+++ b/iree/samples/simple_embedding/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+iree_bytecode_module(
+ NAME
+ simple_embedding_test_bytecode_module
+ SRC
+ "simple_embedding_test.mlir"
+ CC_NAMESPACE
+ "iree::samples"
+ TRANSLATION
+ "-iree-mlir-to-vm-bytecode-module"
+ PUBLIC
+)
+
+iree_cc_test(
+ NAME
+ simple_embedding_test
+ SRCS
+ "simple_embedding_test.cc"
+ DEPS
+ iree::samples::simple_embedding::simple_embedding_test_bytecode_module_cc
+ absl::core_headers
+ absl::strings
+ iree::base::api
+ iree::base::api_util
+ iree::base::logging
+ iree::hal::api
+ iree::modules::hal
+ iree::vm::bytecode_module
+ iree::vm
+ # These are the drivers we support running with and can produce
+ # executables for from the source MLIR.
+ iree::hal::interpreter::interpreter_driver_module
+ iree::hal::vulkan::vulkan_driver_module
+ # TODO(marbre): Set PLATFORM_VULKAN_TEST_DEPS somewhere instead of adding dependencies directly
+ iree::testing::gtest_main
+)