aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2018-09-28 16:12:38 -0400
committerDavid Neto <dneto@google.com>2018-11-09 13:47:51 -0500
commit70d430c0fb3dd7832265815cde48866fada1eb3b (patch)
tree3e85912ed7eb1b30edb183c8d91b413fb421cf2a /src/CMakeLists.txt
downloadamber-70d430c0fb3dd7832265815cde48866fada1eb3b.tar.gz
Initial commit of Amber for open source
Amber is a multi-API shader test framework. Amber lets you capture and communicate shader bugs with the fluidity and ease of a scripting flow: * No graphics API programming is required. * WIP: Supports Vulkan and [Dawn][Dawn] graphics APIs. * A single text string (or file) maps to a single graphics API pipeline test case. The text includes: * Input data, including buffers and images. * Shaders. * Expectations for the result of running the pipeline. * Shaders can be expressed in binary form (as hex), in SPIR-V assembly, or in a higher level shader language. * After executing the pipeline, result buffers and images can be saved to output files. This is not an officially supported Google product.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..50531e8
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,84 @@
+# Copyright 2018 The Amber Authors.
+#
+# 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
+#
+# http://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.
+
+set(AMBER_SOURCES
+ amber.cc
+ amber_impl.cc
+ amberscript/executor.cc
+ amberscript/parser.cc
+ amberscript/pipeline.cc
+ amberscript/script.cc
+ amberscript/shader.cc
+ command.cc
+ command_data.cc
+ datum_type.cc
+ engine.cc
+ executor.cc
+ format.cc
+ parser.cc
+ pipeline_data.cc
+ result.cc
+ script.cc
+ shader_compiler.cc
+ tokenizer.cc
+ value.cc
+ vkscript/command_parser.cc
+ vkscript/datum_type_parser.cc
+ vkscript/executor.cc
+ vkscript/format_parser.cc
+ vkscript/nodes.cc
+ vkscript/parser.cc
+ vkscript/script.cc
+ vkscript/section_parser.cc
+)
+
+add_library(libamber ${AMBER_SOURCES})
+amber_default_compile_options(libamber)
+set_target_properties(libamber PROPERTIES OUTPUT_NAME "amber")
+# TODO(dsinclair): Remove pthread when building on windows.
+target_link_libraries(libamber SPIRV-Tools shaderc SPIRV pthread)
+
+if (${Vulkan_FOUND})
+ target_link_libraries(libamber libamberenginevulkan)
+ add_subdirectory(vulkan)
+endif()
+
+set(TEST_SRCS
+ amberscript/parser_test.cc
+ amberscript/pipeline_test.cc
+ command_data_test.cc
+ result_test.cc
+ shader_compiler_test.cc
+ tokenizer_test.cc
+ vkscript/command_parser_test.cc
+ vkscript/datum_type_parser_test.cc
+ vkscript/executor_test.cc
+ vkscript/format_parser_test.cc
+ vkscript/parser_test.cc
+ vkscript/section_parser_test.cc
+)
+
+if (${Vulkan_FOUND})
+ list(APPEND TEST_SRCS vulkan/bit_copy_test.cc)
+endif()
+
+add_executable(amber_unittests ${TEST_SRCS})
+target_compile_options(amber_unittests PRIVATE
+ -Wno-global-constructors)
+
+target_include_directories(amber_unittests PRIVATE
+ ${gtest_SOURCE_DIR}/include)
+target_link_libraries(amber_unittests libamber gtest_main)
+amber_default_compile_options(amber_unittests)
+add_test(NAME amber_unittests COMMAND amber_unittests)