2018-09-24 20:35:44 +00:00
|
|
|
# Copyright (C) 2018 Google, Inc.
|
|
|
|
#
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# Redistributions in binary form must reproduce the above
|
|
|
|
# copyright notice, this list of conditions and the following
|
|
|
|
# disclaimer in the documentation and/or other materials provided
|
|
|
|
# with the distribution.
|
|
|
|
#
|
|
|
|
# Neither the name of Google Inc. nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived
|
|
|
|
# from this software without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
import("//build_overrides/glslang.gni")
|
|
|
|
|
2019-10-23 14:07:19 +00:00
|
|
|
# Both Chromium and Fuchsia use by default a set of warning errors
|
|
|
|
# that is far too strict to compile this project. These are also
|
|
|
|
# typically appended after |cflags|, overriding target-specific
|
|
|
|
# definitions. To work around this, determine which configs to
|
|
|
|
# add and remove in order to succesfully build the project.
|
|
|
|
if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
|
|
|
|
_configs_to_remove = [ "//build/config:default_warnings" ]
|
|
|
|
_configs_to_add = []
|
|
|
|
} else {
|
|
|
|
_configs_to_remove = [ "//build/config/compiler:chromium_code" ]
|
|
|
|
_configs_to_add = [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
|
|
|
|
Generate build information from CHANGES.md
This PR significantly reworks the way glslang is versioned.
Instead of committing changes to the `GLSLANG_MINOR_VERSION` define in
`glslang/Public/ShaderLang.h`, and using `make-revision` to generate
`GLSLANG_PATCH_LEVEL` in `glslang/Include/revision.h`, all version
information is now derived from the new `CHANGES.md` file.
`CHANGES.md` acts as the single source of truth for glslang version
information, along with a convenient place to put all release notes for
each notable change made.
`CHANGES.md` is parsed using the new `build_info.py` python script.
This script can read basic template files to produce new source files,
which it does to read the new `build_info.h.tmpl` to generate (at build
time) a glslang private header at
`<build-dir>/include/glslang/build_info.h`.
I've written generators for each of the CMake, Bazel, gn, and
`Android.mk` build scripts.
The new version code conforms to the Semantic Versioning 2.0 spec.
This new version is also used by the CMake rules to produce versioned
shared objects, including a major-versioned SONAME.
New APIs:
---------
* `glslang::GetVersion()` returns a `Version` struct with the version
major, minor, patch and flavor.
Breaking API changes:
---------------------
* The public defines `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL`
have been entirely removed.
* `glslang/Public/ShaderLang.h` and `glslang/Include/revision.h` have
been deleted.
* Instead, `<build-dir>/include/glslang/build_info.h` is created in
the build directory, and `<build-dir>/include` is a CMake `PUBLIC`
(dependee-inherited) include directory for the glslang targets.
* `<build-dir>/include/glslang/build_info.h` contains the following
new #defines:
`GLSLANG_VERSION_MAJOR`, `GLSLANG_VERSION_MINOR`,
`GLSLANG_VERSION_PATCH`, `GLSLANG_VERSION_FLAVOR`,
`GLSLANG_VERSION_GREATER_THAN(major, minor, patch)`,
`GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)`,
`GLSLANG_VERSION_LESS_THAN(major, minor, patch)`,
`GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)`
* The CMake install output directory contains a copy of
`build_info.h` at: `include/glslang/build_info.h`
* Python3 is now always required to build glslang (likely always
required for transitive dependency builds).
2020-06-17 10:17:19 +00:00
|
|
|
action("glslang_build_info") {
|
|
|
|
script = "build_info.py"
|
|
|
|
|
|
|
|
src_dir = "."
|
|
|
|
changes_file = "CHANGES.md"
|
|
|
|
template_file = "build_info.h.tmpl"
|
|
|
|
out_file = "${target_gen_dir}/include/glslang/build_info.h"
|
|
|
|
|
|
|
|
inputs = [
|
|
|
|
changes_file,
|
|
|
|
script,
|
|
|
|
template_file,
|
|
|
|
]
|
2020-08-26 04:54:50 +00:00
|
|
|
outputs = [ out_file ]
|
Generate build information from CHANGES.md
This PR significantly reworks the way glslang is versioned.
Instead of committing changes to the `GLSLANG_MINOR_VERSION` define in
`glslang/Public/ShaderLang.h`, and using `make-revision` to generate
`GLSLANG_PATCH_LEVEL` in `glslang/Include/revision.h`, all version
information is now derived from the new `CHANGES.md` file.
`CHANGES.md` acts as the single source of truth for glslang version
information, along with a convenient place to put all release notes for
each notable change made.
`CHANGES.md` is parsed using the new `build_info.py` python script.
This script can read basic template files to produce new source files,
which it does to read the new `build_info.h.tmpl` to generate (at build
time) a glslang private header at
`<build-dir>/include/glslang/build_info.h`.
I've written generators for each of the CMake, Bazel, gn, and
`Android.mk` build scripts.
The new version code conforms to the Semantic Versioning 2.0 spec.
This new version is also used by the CMake rules to produce versioned
shared objects, including a major-versioned SONAME.
New APIs:
---------
* `glslang::GetVersion()` returns a `Version` struct with the version
major, minor, patch and flavor.
Breaking API changes:
---------------------
* The public defines `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL`
have been entirely removed.
* `glslang/Public/ShaderLang.h` and `glslang/Include/revision.h` have
been deleted.
* Instead, `<build-dir>/include/glslang/build_info.h` is created in
the build directory, and `<build-dir>/include` is a CMake `PUBLIC`
(dependee-inherited) include directory for the glslang targets.
* `<build-dir>/include/glslang/build_info.h` contains the following
new #defines:
`GLSLANG_VERSION_MAJOR`, `GLSLANG_VERSION_MINOR`,
`GLSLANG_VERSION_PATCH`, `GLSLANG_VERSION_FLAVOR`,
`GLSLANG_VERSION_GREATER_THAN(major, minor, patch)`,
`GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)`,
`GLSLANG_VERSION_LESS_THAN(major, minor, patch)`,
`GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)`
* The CMake install output directory contains a copy of
`build_info.h` at: `include/glslang/build_info.h`
* Python3 is now always required to build glslang (likely always
required for transitive dependency builds).
2020-06-17 10:17:19 +00:00
|
|
|
args = [
|
|
|
|
rebase_path(src_dir, root_build_dir),
|
2020-08-26 04:54:50 +00:00
|
|
|
"-i",
|
|
|
|
rebase_path(template_file, root_build_dir),
|
|
|
|
"-o",
|
|
|
|
rebase_path(out_file, root_build_dir),
|
Generate build information from CHANGES.md
This PR significantly reworks the way glslang is versioned.
Instead of committing changes to the `GLSLANG_MINOR_VERSION` define in
`glslang/Public/ShaderLang.h`, and using `make-revision` to generate
`GLSLANG_PATCH_LEVEL` in `glslang/Include/revision.h`, all version
information is now derived from the new `CHANGES.md` file.
`CHANGES.md` acts as the single source of truth for glslang version
information, along with a convenient place to put all release notes for
each notable change made.
`CHANGES.md` is parsed using the new `build_info.py` python script.
This script can read basic template files to produce new source files,
which it does to read the new `build_info.h.tmpl` to generate (at build
time) a glslang private header at
`<build-dir>/include/glslang/build_info.h`.
I've written generators for each of the CMake, Bazel, gn, and
`Android.mk` build scripts.
The new version code conforms to the Semantic Versioning 2.0 spec.
This new version is also used by the CMake rules to produce versioned
shared objects, including a major-versioned SONAME.
New APIs:
---------
* `glslang::GetVersion()` returns a `Version` struct with the version
major, minor, patch and flavor.
Breaking API changes:
---------------------
* The public defines `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL`
have been entirely removed.
* `glslang/Public/ShaderLang.h` and `glslang/Include/revision.h` have
been deleted.
* Instead, `<build-dir>/include/glslang/build_info.h` is created in
the build directory, and `<build-dir>/include` is a CMake `PUBLIC`
(dependee-inherited) include directory for the glslang targets.
* `<build-dir>/include/glslang/build_info.h` contains the following
new #defines:
`GLSLANG_VERSION_MAJOR`, `GLSLANG_VERSION_MINOR`,
`GLSLANG_VERSION_PATCH`, `GLSLANG_VERSION_FLAVOR`,
`GLSLANG_VERSION_GREATER_THAN(major, minor, patch)`,
`GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)`,
`GLSLANG_VERSION_LESS_THAN(major, minor, patch)`,
`GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)`
* The CMake install output directory contains a copy of
`build_info.h` at: `include/glslang/build_info.h`
* Python3 is now always required to build glslang (likely always
required for transitive dependency builds).
2020-06-17 10:17:19 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-09-24 20:35:44 +00:00
|
|
|
spirv_tools_dir = glslang_spirv_tools_dir
|
2020-07-07 15:45:02 +00:00
|
|
|
if (!defined(glslang_angle)) {
|
|
|
|
glslang_angle = false
|
|
|
|
}
|
2018-09-24 20:35:44 +00:00
|
|
|
|
|
|
|
config("glslang_public") {
|
|
|
|
include_dirs = [ "." ]
|
2020-10-07 17:32:49 +00:00
|
|
|
if (!is_win || is_clang) {
|
|
|
|
cflags = [ "-Wno-conversion" ]
|
|
|
|
}
|
2020-07-05 20:48:34 +00:00
|
|
|
}
|
2019-08-26 12:13:54 +00:00
|
|
|
|
2020-07-05 20:48:34 +00:00
|
|
|
config("glslang_hlsl") {
|
|
|
|
defines = [ "ENABLE_HLSL=1" ]
|
2018-09-24 20:35:44 +00:00
|
|
|
}
|
|
|
|
|
2020-07-03 16:34:06 +00:00
|
|
|
template("glslang_sources_common") {
|
|
|
|
source_set(target_name) {
|
|
|
|
public_configs = [ ":glslang_public" ]
|
2018-10-03 17:15:23 +00:00
|
|
|
|
2020-07-05 20:48:34 +00:00
|
|
|
if (invoker.enable_hlsl) {
|
|
|
|
public_configs += [ ":glslang_hlsl" ]
|
|
|
|
}
|
|
|
|
|
2020-07-03 16:34:06 +00:00
|
|
|
sources = [
|
|
|
|
"OGLCompilersDLL/InitializeDll.cpp",
|
|
|
|
"OGLCompilersDLL/InitializeDll.h",
|
|
|
|
"SPIRV/GLSL.ext.AMD.h",
|
|
|
|
"SPIRV/GLSL.ext.EXT.h",
|
|
|
|
"SPIRV/GLSL.ext.KHR.h",
|
|
|
|
"SPIRV/GLSL.ext.NV.h",
|
|
|
|
"SPIRV/GLSL.std.450.h",
|
|
|
|
"SPIRV/GlslangToSpv.cpp",
|
|
|
|
"SPIRV/GlslangToSpv.h",
|
|
|
|
"SPIRV/InReadableOrder.cpp",
|
|
|
|
"SPIRV/Logger.cpp",
|
|
|
|
"SPIRV/Logger.h",
|
|
|
|
"SPIRV/NonSemanticDebugPrintf.h",
|
|
|
|
"SPIRV/SPVRemapper.cpp",
|
|
|
|
"SPIRV/SPVRemapper.h",
|
|
|
|
"SPIRV/SpvBuilder.cpp",
|
|
|
|
"SPIRV/SpvBuilder.h",
|
|
|
|
"SPIRV/SpvPostProcess.cpp",
|
|
|
|
"SPIRV/SpvTools.h",
|
|
|
|
"SPIRV/bitutils.h",
|
|
|
|
"SPIRV/disassemble.cpp",
|
|
|
|
"SPIRV/disassemble.h",
|
|
|
|
"SPIRV/doc.cpp",
|
|
|
|
"SPIRV/doc.h",
|
|
|
|
"SPIRV/hex_float.h",
|
|
|
|
"SPIRV/spirv.hpp",
|
|
|
|
"SPIRV/spvIR.h",
|
|
|
|
"glslang/GenericCodeGen/CodeGen.cpp",
|
|
|
|
"glslang/GenericCodeGen/Link.cpp",
|
|
|
|
"glslang/Include/BaseTypes.h",
|
|
|
|
"glslang/Include/Common.h",
|
|
|
|
"glslang/Include/ConstantUnion.h",
|
|
|
|
"glslang/Include/InfoSink.h",
|
|
|
|
"glslang/Include/InitializeGlobals.h",
|
|
|
|
"glslang/Include/PoolAlloc.h",
|
|
|
|
"glslang/Include/ResourceLimits.h",
|
|
|
|
"glslang/Include/ShHandle.h",
|
|
|
|
"glslang/Include/Types.h",
|
|
|
|
"glslang/Include/arrays.h",
|
|
|
|
"glslang/Include/intermediate.h",
|
|
|
|
"glslang/MachineIndependent/Constant.cpp",
|
|
|
|
"glslang/MachineIndependent/InfoSink.cpp",
|
|
|
|
"glslang/MachineIndependent/Initialize.cpp",
|
|
|
|
"glslang/MachineIndependent/Initialize.h",
|
|
|
|
"glslang/MachineIndependent/IntermTraverse.cpp",
|
|
|
|
"glslang/MachineIndependent/Intermediate.cpp",
|
|
|
|
"glslang/MachineIndependent/LiveTraverser.h",
|
|
|
|
"glslang/MachineIndependent/ParseContextBase.cpp",
|
|
|
|
"glslang/MachineIndependent/ParseHelper.cpp",
|
|
|
|
"glslang/MachineIndependent/ParseHelper.h",
|
|
|
|
"glslang/MachineIndependent/PoolAlloc.cpp",
|
|
|
|
"glslang/MachineIndependent/RemoveTree.cpp",
|
|
|
|
"glslang/MachineIndependent/RemoveTree.h",
|
|
|
|
"glslang/MachineIndependent/Scan.cpp",
|
|
|
|
"glslang/MachineIndependent/Scan.h",
|
|
|
|
"glslang/MachineIndependent/ScanContext.h",
|
|
|
|
"glslang/MachineIndependent/ShaderLang.cpp",
|
|
|
|
"glslang/MachineIndependent/SymbolTable.cpp",
|
|
|
|
"glslang/MachineIndependent/SymbolTable.h",
|
|
|
|
"glslang/MachineIndependent/Versions.cpp",
|
|
|
|
"glslang/MachineIndependent/Versions.h",
|
|
|
|
"glslang/MachineIndependent/attribute.cpp",
|
|
|
|
"glslang/MachineIndependent/attribute.h",
|
|
|
|
"glslang/MachineIndependent/gl_types.h",
|
2020-07-13 09:39:08 +00:00
|
|
|
"glslang/MachineIndependent/glslang_tab.cpp",
|
2020-07-03 16:34:06 +00:00
|
|
|
"glslang/MachineIndependent/glslang_tab.cpp.h",
|
|
|
|
"glslang/MachineIndependent/intermOut.cpp",
|
|
|
|
"glslang/MachineIndependent/iomapper.cpp",
|
|
|
|
"glslang/MachineIndependent/iomapper.h",
|
|
|
|
"glslang/MachineIndependent/limits.cpp",
|
|
|
|
"glslang/MachineIndependent/linkValidate.cpp",
|
|
|
|
"glslang/MachineIndependent/localintermediate.h",
|
|
|
|
"glslang/MachineIndependent/parseConst.cpp",
|
|
|
|
"glslang/MachineIndependent/parseVersions.h",
|
|
|
|
"glslang/MachineIndependent/preprocessor/Pp.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpAtom.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpContext.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpContext.h",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpScanner.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpTokens.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpTokens.h",
|
|
|
|
"glslang/MachineIndependent/propagateNoContraction.cpp",
|
|
|
|
"glslang/MachineIndependent/propagateNoContraction.h",
|
|
|
|
"glslang/MachineIndependent/reflection.cpp",
|
|
|
|
"glslang/MachineIndependent/reflection.h",
|
|
|
|
"glslang/OSDependent/osinclude.h",
|
|
|
|
"glslang/Public/ShaderLang.h",
|
|
|
|
]
|
2018-09-24 20:35:44 +00:00
|
|
|
|
2020-07-05 20:48:34 +00:00
|
|
|
# Workaround gn issue complaining about these not being allowed even though GLSLANG_HLSL is not
|
|
|
|
# defined.
|
|
|
|
sources += [
|
|
|
|
"glslang/HLSL/hlslParseHelper.h",
|
|
|
|
"glslang/HLSL/hlslParseables.h",
|
|
|
|
"glslang/HLSL/hlslScanContext.h",
|
|
|
|
"glslang/HLSL/hlslTokens.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (invoker.enable_hlsl) {
|
2020-07-03 16:34:06 +00:00
|
|
|
sources += [
|
|
|
|
"glslang/HLSL/hlslAttributes.cpp",
|
|
|
|
"glslang/HLSL/hlslAttributes.h",
|
|
|
|
"glslang/HLSL/hlslGrammar.cpp",
|
|
|
|
"glslang/HLSL/hlslGrammar.h",
|
|
|
|
"glslang/HLSL/hlslOpMap.cpp",
|
|
|
|
"glslang/HLSL/hlslOpMap.h",
|
|
|
|
"glslang/HLSL/hlslParseHelper.cpp",
|
2020-07-05 20:48:34 +00:00
|
|
|
"glslang/HLSL/hlslParseables.cpp",
|
2020-07-03 16:34:06 +00:00
|
|
|
"glslang/HLSL/hlslScanContext.cpp",
|
|
|
|
"glslang/HLSL/hlslTokenStream.cpp",
|
|
|
|
"glslang/HLSL/hlslTokenStream.h",
|
|
|
|
]
|
|
|
|
}
|
2019-08-23 18:34:29 +00:00
|
|
|
|
2020-07-03 16:34:06 +00:00
|
|
|
defines = []
|
|
|
|
if (invoker.enable_opt) {
|
2020-07-03 19:42:53 +00:00
|
|
|
sources += [ "SPIRV/SpvTools.cpp" ]
|
2020-07-03 16:34:06 +00:00
|
|
|
defines += [ "ENABLE_OPT=1" ]
|
|
|
|
}
|
2020-07-03 19:42:53 +00:00
|
|
|
if (invoker.is_angle) {
|
|
|
|
defines += [ "GLSLANG_ANGLE" ]
|
|
|
|
}
|
2018-09-24 22:40:38 +00:00
|
|
|
|
2020-07-03 16:34:06 +00:00
|
|
|
if (is_win) {
|
|
|
|
sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
|
|
|
|
defines += [ "GLSLANG_OSINCLUDE_WIN32" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "glslang/OSDependent/Unix/ossource.cpp" ]
|
|
|
|
defines += [ "GLSLANG_OSINCLUDE_UNIX" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_clang) {
|
|
|
|
cflags = [
|
|
|
|
"-Wno-extra-semi",
|
|
|
|
"-Wno-ignored-qualifiers",
|
|
|
|
"-Wno-implicit-fallthrough",
|
|
|
|
"-Wno-inconsistent-missing-override",
|
|
|
|
"-Wno-missing-field-initializers",
|
|
|
|
"-Wno-newline-eof",
|
2020-08-26 04:54:50 +00:00
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-Wno-suggest-destructor-override",
|
|
|
|
"-Wno-suggest-override",
|
|
|
|
"-Wno-unused-variable",
|
2020-07-03 16:34:06 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
if (is_win && !is_clang) {
|
|
|
|
cflags = [
|
|
|
|
"/wd4018", # signed/unsigned mismatch
|
|
|
|
"/wd4189", # local variable is initialized but not referenced
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-11-02 21:40:50 +00:00
|
|
|
include_dirs = [ "${target_gen_dir}/include" ]
|
|
|
|
|
Generate build information from CHANGES.md
This PR significantly reworks the way glslang is versioned.
Instead of committing changes to the `GLSLANG_MINOR_VERSION` define in
`glslang/Public/ShaderLang.h`, and using `make-revision` to generate
`GLSLANG_PATCH_LEVEL` in `glslang/Include/revision.h`, all version
information is now derived from the new `CHANGES.md` file.
`CHANGES.md` acts as the single source of truth for glslang version
information, along with a convenient place to put all release notes for
each notable change made.
`CHANGES.md` is parsed using the new `build_info.py` python script.
This script can read basic template files to produce new source files,
which it does to read the new `build_info.h.tmpl` to generate (at build
time) a glslang private header at
`<build-dir>/include/glslang/build_info.h`.
I've written generators for each of the CMake, Bazel, gn, and
`Android.mk` build scripts.
The new version code conforms to the Semantic Versioning 2.0 spec.
This new version is also used by the CMake rules to produce versioned
shared objects, including a major-versioned SONAME.
New APIs:
---------
* `glslang::GetVersion()` returns a `Version` struct with the version
major, minor, patch and flavor.
Breaking API changes:
---------------------
* The public defines `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL`
have been entirely removed.
* `glslang/Public/ShaderLang.h` and `glslang/Include/revision.h` have
been deleted.
* Instead, `<build-dir>/include/glslang/build_info.h` is created in
the build directory, and `<build-dir>/include` is a CMake `PUBLIC`
(dependee-inherited) include directory for the glslang targets.
* `<build-dir>/include/glslang/build_info.h` contains the following
new #defines:
`GLSLANG_VERSION_MAJOR`, `GLSLANG_VERSION_MINOR`,
`GLSLANG_VERSION_PATCH`, `GLSLANG_VERSION_FLAVOR`,
`GLSLANG_VERSION_GREATER_THAN(major, minor, patch)`,
`GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)`,
`GLSLANG_VERSION_LESS_THAN(major, minor, patch)`,
`GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)`
* The CMake install output directory contains a copy of
`build_info.h` at: `include/glslang/build_info.h`
* Python3 is now always required to build glslang (likely always
required for transitive dependency builds).
2020-06-17 10:17:19 +00:00
|
|
|
deps = [ ":glslang_build_info" ]
|
|
|
|
|
2020-07-03 16:34:06 +00:00
|
|
|
if (invoker.enable_opt) {
|
Generate build information from CHANGES.md
This PR significantly reworks the way glslang is versioned.
Instead of committing changes to the `GLSLANG_MINOR_VERSION` define in
`glslang/Public/ShaderLang.h`, and using `make-revision` to generate
`GLSLANG_PATCH_LEVEL` in `glslang/Include/revision.h`, all version
information is now derived from the new `CHANGES.md` file.
`CHANGES.md` acts as the single source of truth for glslang version
information, along with a convenient place to put all release notes for
each notable change made.
`CHANGES.md` is parsed using the new `build_info.py` python script.
This script can read basic template files to produce new source files,
which it does to read the new `build_info.h.tmpl` to generate (at build
time) a glslang private header at
`<build-dir>/include/glslang/build_info.h`.
I've written generators for each of the CMake, Bazel, gn, and
`Android.mk` build scripts.
The new version code conforms to the Semantic Versioning 2.0 spec.
This new version is also used by the CMake rules to produce versioned
shared objects, including a major-versioned SONAME.
New APIs:
---------
* `glslang::GetVersion()` returns a `Version` struct with the version
major, minor, patch and flavor.
Breaking API changes:
---------------------
* The public defines `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL`
have been entirely removed.
* `glslang/Public/ShaderLang.h` and `glslang/Include/revision.h` have
been deleted.
* Instead, `<build-dir>/include/glslang/build_info.h` is created in
the build directory, and `<build-dir>/include` is a CMake `PUBLIC`
(dependee-inherited) include directory for the glslang targets.
* `<build-dir>/include/glslang/build_info.h` contains the following
new #defines:
`GLSLANG_VERSION_MAJOR`, `GLSLANG_VERSION_MINOR`,
`GLSLANG_VERSION_PATCH`, `GLSLANG_VERSION_FLAVOR`,
`GLSLANG_VERSION_GREATER_THAN(major, minor, patch)`,
`GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)`,
`GLSLANG_VERSION_LESS_THAN(major, minor, patch)`,
`GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)`
* The CMake install output directory contains a copy of
`build_info.h` at: `include/glslang/build_info.h`
* Python3 is now always required to build glslang (likely always
required for transitive dependency builds).
2020-06-17 10:17:19 +00:00
|
|
|
deps += [
|
2020-07-03 16:34:06 +00:00
|
|
|
"${spirv_tools_dir}:spvtools_opt",
|
2020-07-05 20:48:34 +00:00
|
|
|
"${spirv_tools_dir}:spvtools_val",
|
2020-07-03 16:34:06 +00:00
|
|
|
]
|
2020-11-02 21:40:50 +00:00
|
|
|
include_dirs += [ "${spirv_tools_dir}/include" ]
|
2020-07-03 16:34:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
configs -= _configs_to_remove
|
|
|
|
configs += _configs_to_add
|
2019-01-24 15:55:41 +00:00
|
|
|
}
|
2020-07-03 16:34:06 +00:00
|
|
|
}
|
2018-09-24 20:35:44 +00:00
|
|
|
|
2020-07-05 20:48:34 +00:00
|
|
|
glslang_sources_common("glslang_lib_sources") {
|
2020-07-03 16:34:06 +00:00
|
|
|
enable_opt = !glslang_angle
|
2020-07-05 20:48:34 +00:00
|
|
|
enable_hlsl = !glslang_angle
|
2020-07-03 19:42:53 +00:00
|
|
|
is_angle = glslang_angle
|
2020-07-03 16:34:06 +00:00
|
|
|
}
|
2019-10-15 15:17:53 +00:00
|
|
|
|
2020-07-05 20:48:34 +00:00
|
|
|
glslang_sources_common("glslang_sources") {
|
2020-07-03 16:34:06 +00:00
|
|
|
enable_opt = true
|
2020-07-05 20:48:34 +00:00
|
|
|
enable_hlsl = true
|
2020-07-03 19:42:53 +00:00
|
|
|
is_angle = false
|
2018-09-24 22:40:38 +00:00
|
|
|
}
|
2019-01-18 19:53:31 +00:00
|
|
|
|
|
|
|
source_set("glslang_default_resource_limits_sources") {
|
|
|
|
sources = [
|
|
|
|
"StandAlone/ResourceLimits.cpp",
|
|
|
|
"StandAlone/ResourceLimits.h",
|
2020-07-05 20:48:34 +00:00
|
|
|
"glslang/Include/ResourceLimits.h",
|
2019-01-18 19:53:31 +00:00
|
|
|
]
|
|
|
|
public_configs = [ ":glslang_public" ]
|
2019-10-15 15:17:53 +00:00
|
|
|
|
2019-10-23 14:07:19 +00:00
|
|
|
configs -= _configs_to_remove
|
|
|
|
configs += _configs_to_add
|
2019-01-18 19:53:31 +00:00
|
|
|
}
|
|
|
|
|
2019-03-11 19:45:31 +00:00
|
|
|
executable("glslang_validator") {
|
2019-01-18 19:53:31 +00:00
|
|
|
sources = [
|
|
|
|
"StandAlone/DirStackFileIncluder.h",
|
|
|
|
"StandAlone/StandAlone.cpp",
|
|
|
|
]
|
|
|
|
if (!is_win) {
|
|
|
|
cflags = [ "-Woverflow" ]
|
|
|
|
}
|
2019-05-17 03:53:15 +00:00
|
|
|
defines = [ "ENABLE_OPT=1" ]
|
2019-01-18 19:53:31 +00:00
|
|
|
deps = [
|
2020-08-26 04:54:50 +00:00
|
|
|
":glslang_build_info",
|
2019-01-18 19:53:31 +00:00
|
|
|
":glslang_default_resource_limits_sources",
|
2020-07-05 20:48:34 +00:00
|
|
|
":glslang_sources",
|
2019-01-18 19:53:31 +00:00
|
|
|
]
|
2020-07-05 20:48:34 +00:00
|
|
|
public_configs = [ ":glslang_hlsl" ]
|
2019-10-15 15:17:53 +00:00
|
|
|
|
2020-11-02 21:40:50 +00:00
|
|
|
include_dirs = [
|
|
|
|
"${target_gen_dir}/include",
|
|
|
|
"${spirv_tools_dir}/include",
|
|
|
|
]
|
Generate build information from CHANGES.md
This PR significantly reworks the way glslang is versioned.
Instead of committing changes to the `GLSLANG_MINOR_VERSION` define in
`glslang/Public/ShaderLang.h`, and using `make-revision` to generate
`GLSLANG_PATCH_LEVEL` in `glslang/Include/revision.h`, all version
information is now derived from the new `CHANGES.md` file.
`CHANGES.md` acts as the single source of truth for glslang version
information, along with a convenient place to put all release notes for
each notable change made.
`CHANGES.md` is parsed using the new `build_info.py` python script.
This script can read basic template files to produce new source files,
which it does to read the new `build_info.h.tmpl` to generate (at build
time) a glslang private header at
`<build-dir>/include/glslang/build_info.h`.
I've written generators for each of the CMake, Bazel, gn, and
`Android.mk` build scripts.
The new version code conforms to the Semantic Versioning 2.0 spec.
This new version is also used by the CMake rules to produce versioned
shared objects, including a major-versioned SONAME.
New APIs:
---------
* `glslang::GetVersion()` returns a `Version` struct with the version
major, minor, patch and flavor.
Breaking API changes:
---------------------
* The public defines `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL`
have been entirely removed.
* `glslang/Public/ShaderLang.h` and `glslang/Include/revision.h` have
been deleted.
* Instead, `<build-dir>/include/glslang/build_info.h` is created in
the build directory, and `<build-dir>/include` is a CMake `PUBLIC`
(dependee-inherited) include directory for the glslang targets.
* `<build-dir>/include/glslang/build_info.h` contains the following
new #defines:
`GLSLANG_VERSION_MAJOR`, `GLSLANG_VERSION_MINOR`,
`GLSLANG_VERSION_PATCH`, `GLSLANG_VERSION_FLAVOR`,
`GLSLANG_VERSION_GREATER_THAN(major, minor, patch)`,
`GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch)`,
`GLSLANG_VERSION_LESS_THAN(major, minor, patch)`,
`GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch)`
* The CMake install output directory contains a copy of
`build_info.h` at: `include/glslang/build_info.h`
* Python3 is now always required to build glslang (likely always
required for transitive dependency builds).
2020-06-17 10:17:19 +00:00
|
|
|
|
2019-10-23 14:07:19 +00:00
|
|
|
configs -= _configs_to_remove
|
|
|
|
configs += _configs_to_add
|
2019-01-18 19:53:31 +00:00
|
|
|
}
|
2019-06-21 12:58:30 +00:00
|
|
|
|
|
|
|
executable("spirv-remap") {
|
2020-07-05 20:48:34 +00:00
|
|
|
sources = [ "StandAlone/spirv-remap.cpp" ]
|
2019-06-21 12:58:30 +00:00
|
|
|
defines = [ "ENABLE_OPT=1" ]
|
2020-07-05 20:48:34 +00:00
|
|
|
deps = [ ":glslang_sources" ]
|
2019-10-15 15:17:53 +00:00
|
|
|
|
2020-11-02 21:40:50 +00:00
|
|
|
include_dirs += [ "${spirv_tools_dir}/include" ]
|
|
|
|
|
2019-10-23 14:07:19 +00:00
|
|
|
configs -= _configs_to_remove
|
|
|
|
configs += _configs_to_add
|
2019-06-21 12:58:30 +00:00
|
|
|
}
|