diff --git a/Android.mk b/Android.mk index 0cad257cb..e1ad18a6d 100644 --- a/Android.mk +++ b/Android.mk @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + ROOT_SHADERC_PATH := $(call my-dir) include $(ROOT_SHADERC_PATH)/third_party/Android.mk diff --git a/CMakeLists.txt b/CMakeLists.txt index ebaf65542..6392d2bd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + cmake_minimum_required(VERSION 2.8.12) project(shaderc) enable_testing() diff --git a/android_test/Android.mk b/android_test/Android.mk index 4959331bc..31ad38195 100644 --- a/android_test/Android.mk +++ b/android_test/Android.mk @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) diff --git a/android_test/jni/Android.mk b/android_test/jni/Android.mk index 8a362595e..1360751ca 100644 --- a/android_test/jni/Android.mk +++ b/android_test/jni/Android.mk @@ -1,2 +1,16 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + LOCAL_PATH := $(call my-dir) include $(LOCAL_PATH)/../Android.mk diff --git a/android_test/jni/Application.mk b/android_test/jni/Application.mk index c5d90ef57..ef5094602 100644 --- a/android_test/jni/Application.mk +++ b/android_test/jni/Application.mk @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + APP_ABI := all APP_BUILD_SCRIPT := Android.mk APP_STL := c++_static diff --git a/cmake/linux-mingw-toolchain.cmake b/cmake/linux-mingw-toolchain.cmake index 400b9a0b2..1be4907c5 100644 --- a/cmake/linux-mingw-toolchain.cmake +++ b/cmake/linux-mingw-toolchain.cmake @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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(CMAKE_SYSTEM_NAME Windows) set(MINGW_COMPILER_PREFIX "i686-w64-mingw32" CACHE STRING diff --git a/cmake/setup_build.cmake b/cmake/setup_build.cmake index 4dc49c7ac..5dab38416 100644 --- a/cmake/setup_build.cmake +++ b/cmake/setup_build.cmake @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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(NOT COMMAND find_host_package) macro(find_host_package) find_package(${ARGN}) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index e3b3a7795..ffa933674 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + # utility functions function (shaderc_use_gmock TARGET) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 176c40b4c..ce1f4c021 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1 +1,15 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + add_subdirectory(online-compile) diff --git a/examples/online-compile/CMakeLists.txt b/examples/online-compile/CMakeLists.txt index feab8f20d..6cceb6be1 100644 --- a/examples/online-compile/CMakeLists.txt +++ b/examples/online-compile/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + add_executable(shaderc-online-compile main.cc) shaderc_default_compile_options(shaderc-online-compile) target_include_directories(shaderc-online-compile PUBLIC ${shaderc_SOURCE_DIR}/libshaderc_util/include) diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt index acf6fb0b2..51ad03094 100644 --- a/glslc/CMakeLists.txt +++ b/glslc/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + find_package(Threads) add_library(glslc STATIC diff --git a/glslc/test/CMakeLists.txt b/glslc/test/CMakeLists.txt index 691619206..ac001bd33 100644 --- a/glslc/test/CMakeLists.txt +++ b/glslc/test/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + add_test(NAME shaderc_expect_unittests COMMAND ${PYTHON_EXECUTABLE} -m unittest expect_unittest.py WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/kokoro/linux/continuous_license_check.cfg b/kokoro/linux/continuous_license_check.cfg new file mode 100644 index 000000000..066a4d3b9 --- /dev/null +++ b/kokoro/linux/continuous_license_check.cfg @@ -0,0 +1,16 @@ +# Copyright (C) 2020 Google Inc. +# +# 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. + +# Continuous build configuration. +build_file: "shaderc/kokoro/linux/license_check.sh" diff --git a/kokoro/linux/license_check.sh b/kokoro/linux/license_check.sh new file mode 100755 index 000000000..a36e4ff6a --- /dev/null +++ b/kokoro/linux/license_check.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Copyright (C) 2020 Google Inc. +# +# 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 -e # Fail on any error. + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )" +ROOT_DIR="$( cd "${SCRIPT_DIR}/../.." >/dev/null 2>&1 && pwd )" + +docker run --rm -i \ + --volume "${ROOT_DIR}:${ROOT_DIR}:ro" \ + --workdir "${ROOT_DIR}" \ + --env ROOT_DIR="${ROOT_DIR}" \ + --env SCRIPT_DIR="${SCRIPT_DIR}" \ + --entrypoint "${SCRIPT_DIR}/license_check_docker.sh" \ + "gcr.io/shaderc-build/radial-build:latest" diff --git a/kokoro/linux/license_check_docker.sh b/kokoro/linux/license_check_docker.sh new file mode 100755 index 000000000..f88077e87 --- /dev/null +++ b/kokoro/linux/license_check_docker.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Copyright (C) 2020 Google Inc. +# +# 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 -e # Fail on any error. +set -x # Display commands being run. + +license-checker --dir="$ROOT_DIR" \ No newline at end of file diff --git a/kokoro/linux/presubmit_license_check.cfg b/kokoro/linux/presubmit_license_check.cfg new file mode 100644 index 000000000..38db8f54e --- /dev/null +++ b/kokoro/linux/presubmit_license_check.cfg @@ -0,0 +1,16 @@ +# Copyright (C) 2020 Google Inc. +# +# 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. + +# Presubmit build configuration. +build_file: "shaderc/kokoro/linux/license_check.sh" diff --git a/libshaderc/Android.mk b/libshaderc/Android.mk index 64618afc6..294af69f8 100644 --- a/libshaderc/Android.mk +++ b/libshaderc/Android.mk @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) diff --git a/libshaderc/CMakeLists.txt b/libshaderc/CMakeLists.txt index f4a80d863..3ada4198b 100644 --- a/libshaderc/CMakeLists.txt +++ b/libshaderc/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + project(libshaderc) # Even though shaderc.hpp is a headers-only library, adding diff --git a/libshaderc_spvc/Android.mk b/libshaderc_spvc/Android.mk index f0579a859..a13e05baa 100644 --- a/libshaderc_spvc/Android.mk +++ b/libshaderc_spvc/Android.mk @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) diff --git a/libshaderc_spvc/CMakeLists.txt b/libshaderc_spvc/CMakeLists.txt index b22f9ebfb..927375cf5 100644 --- a/libshaderc_spvc/CMakeLists.txt +++ b/libshaderc_spvc/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + project(libshaderc) find_package(Threads) diff --git a/libshaderc_util/Android.mk b/libshaderc_util/Android.mk index 81b4c76ca..a694787db 100644 --- a/libshaderc_util/Android.mk +++ b/libshaderc_util/Android.mk @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt index f8ae95d0c..48f99912f 100644 --- a/libshaderc_util/CMakeLists.txt +++ b/libshaderc_util/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + project(libshaderc_util) add_library(shaderc_util STATIC diff --git a/libshaderc_util/testdata/copy-to-build.cmake b/libshaderc_util/testdata/copy-to-build.cmake index bf50a72fc..7b41b61e7 100644 --- a/libshaderc_util/testdata/copy-to-build.cmake +++ b/libshaderc_util/testdata/copy-to-build.cmake @@ -1,2 +1,16 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + file(GLOB all_files ${CMAKE_CURRENT_LIST_DIR}/*) file(COPY ${all_files} DESTINATION .) \ No newline at end of file diff --git a/license-checker.cfg b/license-checker.cfg new file mode 100644 index 000000000..828667ff9 --- /dev/null +++ b/license-checker.cfg @@ -0,0 +1,39 @@ +{ + "paths": [ + { + "exclude": [ + ".clang-format", + ".gitignore", + "*.md", + "AUTHORS", + "CHANGES", + "CONTRIBUTORS", + "DEPS", + "cmake/*.pc.in", + "glslc/README.asciidoc", + "kokoro/img/*.png", + "libshaderc_spvc/README.md", + "libshaderc_util/testdata/dir/subdir/include_file.2", + "libshaderc_util/testdata/include_file.1", + "libshaderc/README.md", + "LICENSE", + "spvc/README.asciidoc", + "spvc/test/known_failures", + "spvc/test/known_invalids", + "spvc/test/known_spvc_failures", + "spvc/test/unconfirmed_invalids", + + "spvc/test/reference/shaders-hlsl-no-opt/asm/vert/*.asm.vert", + "spvc/test/shaders-hlsl-no-opt/asm/*", + "third_party", + + "spvc/test/shaders-hlsl-no-opt/asm/**.vert", + "third_party/**" + ] + } + ], + "licenses": [ + "Apache-2.0-Header", + "BSD-3-Clause" + ] +} \ No newline at end of file diff --git a/spvc/CMakeLists.txt b/spvc/CMakeLists.txt index f46597256..399b04ed7 100644 --- a/spvc/CMakeLists.txt +++ b/spvc/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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. + add_executable(spvc_exe src/main.cc) shaderc_default_compile_options(spvc_exe) target_include_directories(spvc_exe PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include ${spirv-tools_SOURCE_DIR}/include) diff --git a/spvc/test/CMakeLists.txt b/spvc/test/CMakeLists.txt index 01168974a..0bb039cbc 100644 --- a/spvc/test/CMakeLists.txt +++ b/spvc/test/CMakeLists.txt @@ -1,3 +1,17 @@ +# Copyright 2020 The Shaderc Authors. All rights reserved. +# +# 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(${SHADERC_ENABLE_TESTS}) add_test(NAME spvc_spirv_cross_tests COMMAND ${PYTHON_EXECUTABLE}