scripts: Move spirv_tools_commit_id.h to gen dir
Remove spirv_tools_commit_id.h from CMake and add to generated dir.
Change-Id: I7a3cf97a8a973661e1a713a5c22938ec13bfbe95
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index 742a973..5541816 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -44,18 +44,6 @@
message(FATAL_ERROR "Unsupported Platform!")
endif()
-# Custom targets for generated validation layer helper file dependencies
-add_custom_target(spirv_tools_revision_file DEPENDS spirv_tools_commit_id.h)
-set_target_properties(spirv_tools_revision_file PROPERTIES FOLDER ${LAYERS_HELPER_FOLDER})
-
-if(BUILD_LAYERS)
- # generate header file containing commit IDs of external dependencies
- add_custom_command(OUTPUT spirv_tools_commit_id.h
- COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/external_revision_generator.py
- --from_uuid -s SPIRV_TOOLS_COMMIT_ID -o spirv_tools_commit_id.h
- DEPENDS ${SCRIPTS_DIR}/external_revision_generator.py)
-endif()
-
# Configure installation of source files that are dependencies of other repos.
if(BUILD_LAYER_SUPPORT_FILES)
set(LAYER_UTIL_FILES
@@ -223,11 +211,9 @@
target_include_directories(VkLayer_core_validation PRIVATE ${GLSLANG_SPIRV_INCLUDE_DIR})
target_include_directories(VkLayer_core_validation PRIVATE ${SPIRV_TOOLS_INCLUDE_DIR})
target_link_libraries(VkLayer_core_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES})
- add_dependencies(VkLayer_core_validation spirv_tools_revision_file)
target_include_directories(VkLayer_khronos_validation PRIVATE ${GLSLANG_SPIRV_INCLUDE_DIR})
target_include_directories(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_INCLUDE_DIR})
target_link_libraries(VkLayer_khronos_validation PRIVATE ${SPIRV_TOOLS_LIBRARIES})
- add_dependencies(VkLayer_khronos_validation spirv_tools_revision_file)
# The output file needs Unix "/" separators or Windows "\" separators On top of that, Windows separators actually need to be doubled
# because the json format uses backslash escapes
diff --git a/layers/generated/spirv_tools_commit_id.h b/layers/generated/spirv_tools_commit_id.h
new file mode 100644
index 0000000..df06f48
--- /dev/null
+++ b/layers/generated/spirv_tools_commit_id.h
@@ -0,0 +1,29 @@
+// *** THIS FILE IS GENERATED - DO NOT EDIT ***
+// See external_revision_generator.py for modifications
+
+/***************************************************************************
+ *
+ * Copyright (c) 2015-2017 The Khronos Group Inc.
+ * Copyright (c) 2015-2017 Valve Corporation
+ * Copyright (c) 2015-2017 LunarG, Inc.
+ * Copyright (c) 2015-2017 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.
+ *
+ * Author: Chris Forbes <chrisforbes@google.com>
+ * Author: Cort Stratton <cort@google.com>
+ *
+ ****************************************************************************/
+#pragma once
+
+#define SPIRV_TOOLS_COMMIT_ID "372c0d7efc8ef3ad11fabdb808aa6f1da274fe97"
diff --git a/layers/shader_validation.h b/layers/shader_validation.h
index 6c399a4..8bf1b44 100644
--- a/layers/shader_validation.h
+++ b/layers/shader_validation.h
@@ -23,7 +23,7 @@
#include <unordered_map>
#include <SPIRV/spirv.hpp>
-#include <spirv_tools_commit_id.h>
+#include <generated/spirv_tools_commit_id.h>
#include "spirv-tools/optimizer.hpp"
// A forward iterator over spirv instructions. Provides easy access to len, opcode, and content words