Improve ResourceLimits interface to be more forward compatible
[platform/upstream/glslang.git] / BUILD.bazel
index 7e5bf83..45efbd3 100644 (file)
@@ -43,6 +43,34 @@ licenses(["notice"])
 
 exports_files(["LICENSE"])
 
+# Build information generation script
+py_binary(
+    name = "build_info",
+    srcs = ["build_info.py"],
+)
+
+py_binary(
+    name = "gen_extension_headers",
+    srcs = ["gen_extension_headers.py"],
+)
+
+genrule(
+    name = "gen_build_info_h",
+    srcs = ["CHANGES.md", "build_info.h.tmpl"],
+    outs = ["glslang/build_info.h"],
+    cmd_bash = "$(location build_info) $$(dirname $(location CHANGES.md)) -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)",
+    cmd_bat = "for %F in ($(location CHANGES.md)) do $(location build_info) %~dpF -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)",
+    tools = [":build_info"],
+)
+
+genrule(
+    name = "gen_extension_headers_h",
+    srcs = ["glslang/ExtensionHeaders", "gen_extension_headers.py"],
+    outs = ["glslang/glsl_intrinsic_header.h"],
+    cmd_bash = "$(location gen_extension_headers) -i  $(location glslang/ExtensionHeaders) -o $(location glslang/glsl_intrinsic_header.h)",
+    tools = [":gen_extension_headers"],
+)
+
 COMMON_COPTS = select({
     "@bazel_tools//src/conditions:windows": [""],
     "//conditions:default": [
@@ -93,6 +121,7 @@ cc_library(
         "StandAlone/DirStackFileIncluder.h",
         "glslang/OSDependent/osinclude.h",
         "glslang/Public/ShaderLang.h",
+        ":gen_build_info_h",
     ],
     copts = COMMON_COPTS,
     defines = [
@@ -117,6 +146,7 @@ genrule(
         "SPIRV/GLSL.ext.NV.h",
         "SPIRV/GLSL.std.450.h",
         "SPIRV/NonSemanticDebugPrintf.h",
+        "SPIRV/NonSemanticShaderDebugInfo100.h",
         "SPIRV/spirv.hpp",
     ],
     outs = [
@@ -126,9 +156,11 @@ genrule(
         "include/SPIRV/GLSL.ext.NV.h",
         "include/SPIRV/GLSL.std.450.h",
         "include/SPIRV/NonSemanticDebugPrintf.h",
+        "include/SPIRV/NonSemanticShaderDebugInfo100.h",
         "include/SPIRV/spirv.hpp",
     ],
-    cmd = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/",
+    cmd_bash = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/",
+    cmd_bat = "(if not exist $(@D)\\include\\SPIRV mkdir $(@D)\\include\\SPIRV) && (for %S in ($(SRCS)) do @xcopy /q %S $(@D)\\include\\SPIRV\\ >NUL)",
 )
 
 cc_library(
@@ -178,7 +210,7 @@ cc_library(
 cc_library(
     name = "glslang-default-resource-limits",
     srcs = ["StandAlone/ResourceLimits.cpp"],
-    hdrs = ["StandAlone/ResourceLimits.h"],
+    hdrs = ["glslang/Public/ResourceLimits.h"],
     copts = COMMON_COPTS,
     linkstatic = 1,
     deps = [":glslang"],
@@ -189,6 +221,7 @@ cc_binary(
     srcs = [
         "StandAlone/StandAlone.cpp",
         "StandAlone/Worklist.h",
+        ":glslang/glsl_intrinsic_header.h"
     ],
     copts = COMMON_COPTS,
     deps = [