diff options
author | dan sinclair <dj2@everburning.com> | 2018-09-28 16:12:38 -0400 |
---|---|---|
committer | David Neto <dneto@google.com> | 2018-11-09 13:47:51 -0500 |
commit | 70d430c0fb3dd7832265815cde48866fada1eb3b (patch) | |
tree | 3e85912ed7eb1b30edb183c8d91b413fb421cf2a /third_party | |
download | amber-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 'third_party')
-rw-r--r-- | third_party/CMakeLists.txt | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt new file mode 100644 index 0000000..2e24bca --- /dev/null +++ b/third_party/CMakeLists.txt @@ -0,0 +1,182 @@ +# 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. + +if(WIN32) + option(g`_force_shared_crt + "Use shared (DLL) run-time lib even when Google Test is built as static lib." + ON) +endif() + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # Turn off warnings to make gtest happy + set(GTEST_BUILD_FIXES + -Wno-covered-switch-default + -Wno-deprecated + -Wno-disabled-macro-expansion + -Wno-exit-time-constructors + -Wno-exit-time-destructors + -Wno-global-constructors + -Wno-missing-field-initializers + -Wno-format-nonliteral + -Wno-missing-noreturn + -Wno-missing-prototypes + -Wno-missing-variable-declarations + -Wno-shift-sign-overflow + -Wno-sign-conversion + -Wno-undef + -Wno-unused-member-function + -Wno-used-but-marked-unused + -Wno-weak-vtables + -Wno-zero-as-null-pointer-constant) + + set(GLSLANG_BUILD_FIXES + -Wno-conversion + -Wno-covered-switch-default + -Wno-date-time + -Wno-deprecated + -Wno-disabled-macro-expansion + -Wno-double-promotion + -Wno-error + -Wno-exit-time-destructors + -Wno-extra-semi + -Wno-float-equal + -Wno-format-nonliteral + -Wno-format-pedantic + -Wno-global-constructors + -Wno-gnu-redeclared-enum + -Wno-implicit-fallthrough + -Wno-inconsistent-missing-destructor-override + -Wno-missing-field-initializers + -Wno-missing-noreturn + -Wno-missing-prototypes + -Wno-missing-variable-declarations + -Wno-newline-eof + -Wno-old-style-cast + -Wno-reserved-id-macro + -Wno-shadow + -Wno-shadow-field + -Wno-shadow-field-in-constructor + -Wno-shift-sign-overflow + -Wno-sign-conversion + -Wno-signed-enum-bitfield + -Wno-undef + -Wno-undefined-func-template + -Wno-undefined-reinterpret-cast + -Wno-unreachable-code + -Wno-unreachable-code-break + -Wno-unreachable-code-return + -Wno-unused-macros + -Wno-unused-parameter + -Wno-unused-variable + -Wno-used-but-marked-unused + -Wno-weak-vtables + -Wno-zero-as-null-pointer-constant) + + set(SPIRV_TOOLS_BUILD_FIXES + -Wno-conditional-uninitialized + -Wno-covered-switch-default + -Wno-deprecated + -Wno-documentation + -Wno-documentation-pedantic + -Wno-double-promotion + -Wno-extra-semi + -Wno-float-equal + -Wno-format-nonliteral + -Wno-implicit-fallthrough + -Wno-missing-prototypes + -Wno-old-style-cast + -Wno-range-loop-analysis + -Wno-shift-sign-overflow + -Wno-unreachable-code-break + -Wno-unreachable-code-return + -Wno-unused-member-function + -Wno-weak-vtables + -Wno-zero-as-null-pointer-constant) + + set(SHADERC_BUILD_FIXES + -Wno-comma + -Wno-conversion + -Wno-covered-switch + -Wno-covered-switch-default + -Wno-deprecated + -Wno-double-promotion + -Wno-extra-semi + -Wno-float-equal + -Wno-inconsistent-missing-destructor-override + -Wno-missing-field-initializers + -Wno-missing-prototypes + -Wno-newline-eof + -Wno-old-style-cast + -Wno-reserved-id-macro + -Wno-shadow-uncaptured-local + -Wno-shadow-field-in-constructor + -Wno-sign-conversion + -Wno-signed-enum-bitfield + -Wno-undef + -Wno-unreachable-code-return + -Wno-weak-vtables + -Wno-zero-as-null-pointer-constant + ) +endif() + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(GTEST_BUILD_FIXES "") + + set(GLSLANG_BUILD_FIXES + -Wno-error + -Wno-overflow + -Wno-missing-field-initializers + -Wno-pedantic + -Wno-unused-parameter + -Wno-unused-variable) + + set(SPIRV_TOOLS_BUILD_FIXES "") + + set(SHADERC_BUILD_FIXES + -Wno-missing-field-initializers + -Wno-pedantic) +endif() + +set(CXX_BACK ${CMAKE_CXX_FLAGS}) +SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "${GTEST_BUILD_FIXES}") +STRING(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest EXCLUDE_FROM_ALL) +set(CMAKE_CXX_FLAGS ${CXX_BACK}) + +set(CXX_BACK ${CMAKE_CXX_FLAGS}) +SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "${SPIRV_TOOLS_BUILD_FIXES}") +STRING(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +set(SPIRV-Headers_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers) +set(SPIRV_SKIP_TESTS ON) +set(SPIRV_SKIP_EXECUTABLES ON) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools) +set(CMAKE_CXX_FLAGS ${CXX_BACK}) + +set(CXX_BACK ${CMAKE_CXX_FLAGS}) +SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "${GLSLANG_BUILD_FIXES}") +STRING(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +set(ENABLE_HLSL ON) +set(BUILD_TESTING OFF) +set(ENABLE_GLSLANG_BINARIES OFF) +set(ENABLE_SPVREMAPPER OFF) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/glslang) +set(CMAKE_CXX_FLAGS ${CXX_BACK}) + +set(CXX_BACK ${CMAKE_CXX_FLAGS}) +SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "${SHADERC_BUILD_FIXES}") +STRING(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +set(SHADERC_THIRD_PARTY_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "") +set(SHADERC_SKIP_TESTS ON) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/shaderc) +set(CMAKE_CXX_FLAGS ${CXX_BACK}) |