Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glslang version 13.0.0 #19277

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions recipes/glslang/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ sources:
"1.3.204.0":
url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/sdk-1.3.204.0.tar.gz"
sha256: "c6bec993194377944fb8d6d585a90e1288994660782d709e30fa1d91810d6820"
"13.0.0":
url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/13.0.0.tar.gz"
sha256: "bcda732434f829aa74414ea0e06d329ec8ac28637c38a0de45e17c8fd25a4715"
"11.7.0":
url: "https://github.com/KhronosGroup/glslang/archive/refs/tags/11.7.0.tar.gz"
sha256: "b6c83864c3606678d11675114fa5f358c519fe1dad9a781802bcc87fb8fa32d5"
Expand All @@ -35,21 +38,45 @@ sources:
patches:
"1.3.239.0":
- patch_file: "patches/1.3.236.0-0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"1.3.236.0":
- patch_file: "patches/1.3.236.0-0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"1.3.231.1":
- patch_file: "patches/0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"1.3.224.0":
- patch_file: "patches/0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"1.3.216.0":
- patch_file: "patches/0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"1.3.211.0":
- patch_file: "patches/0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"1.3.204.0":
- patch_file: "patches/0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"13.0.0":
- patch_file: "patches/0002-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"11.7.0":
- patch_file: "patches/0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"11.6.0":
- patch_file: "patches/0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
"11.5.0":
- patch_file: "patches/0001-no-force-glslang-pic.patch"
patch_type: "conan"
patch_description: "adapt PIC settings"
31 changes: 23 additions & 8 deletions recipes/glslang/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class GlslangConan(ConanFile):
}

short_paths = True
def build_requirements(self):
self.tool_requires("cmake/[>=3.18]")


def export_sources(self):
copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder)
Expand All @@ -58,6 +61,7 @@ def layout(self):
@property
def _get_compatible_spirv_tools_version(self):
return {
"13.0.0": "1.3.243.0",
"11.7.0": "2021.4",
"11.6.0": "2021.3",
"11.5.0": "2021.2",
Expand All @@ -69,8 +73,14 @@ def requirements(self):
self.requires(f"spirv-tools/{self._get_compatible_spirv_tools_version}")

def validate(self):
glslang_version = Version(self.version)

if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)
glslang_version = Version(self.version)
if glslang_version >= "13.0.0":
check_min_cppstd(self, 17)
else:
check_min_cppstd(self, 11)

# see https://github.com/KhronosGroup/glslang/issues/2283
glslang_version = Version(self.version)
Expand Down Expand Up @@ -128,22 +138,24 @@ def generate(self):

def _patch_sources(self):
apply_conandata_patches(self)
glslang_version = Version(self.version)
# Do not force PIC if static (but keep it if shared, because OGLCompiler, OSDependent,
# GenericCodeGen and MachineIndependent are still static and linked to glslang shared)
if not self.options.shared:
if not self.options.shared and glslang_version < "13.0.0":
cmake_files_to_fix = [
{"target": "OGLCompiler", "relpath": os.path.join("OGLCompilersDLL", "CMakeLists.txt")},
{"target": "SPIRV" , "relpath": os.path.join("SPIRV", "CMakeLists.txt")},
{"target": "SPVRemapper", "relpath": os.path.join("SPIRV", "CMakeLists.txt")},
{"target": "OSDependent", "relpath": os.path.join("glslang", "OSDependent", "Unix","CMakeLists.txt")},
{"target": "OSDependent", "relpath": os.path.join("glslang", "OSDependent", "Windows","CMakeLists.txt")},
{"target": "HLSL" , "relpath": os.path.join("hlsl", "CMakeLists.txt")},
]
glslang_version = Version(self.version)
if glslang_version < "12.3.1":
cmake_files_to_fix.append({"target": "SPIRV" , "relpath": os.path.join("SPIRV", "CMakeLists.txt")})
cmake_files_to_fix.append({"target": "SPVRemapper", "relpath": os.path.join("SPIRV", "CMakeLists.txt")})
cmake_files_to_fix.append({"target": "HLSL" , "relpath": os.path.join("hlsl", "CMakeLists.txt")})
if glslang_version >= "7.0.0" and glslang_version < "11.0.0":
cmake_files_to_fix.append({"target": "glslang", "relpath": os.path.join("glslang", "CMakeLists.txt")})
else:
cmake_files_to_fix.append({"target": "glslang-default-resource-limits", "relpath": os.path.join("StandAlone" , "CMakeLists.txt")})
if glslang_version < "12.3.1":
cmake_files_to_fix.append({"target": "glslang-default-resource-limits", "relpath": os.path.join("StandAlone" , "CMakeLists.txt")})
cmake_files_to_fix.append({"target": "MachineIndependent", "relpath": os.path.join("glslang", "CMakeLists.txt")})
cmake_files_to_fix.append({"target": "GenericCodeGen", "relpath": os.path.join("glslang", "CMakeLists.txt")})
for cmake_file in cmake_files_to_fix:
Expand Down Expand Up @@ -175,7 +187,10 @@ def package_info(self):
has_genericcodegen = (glslang_version < "7.0.0" or glslang_version >= "11.0.0") and not self.options.shared
has_osdependent = glslang_version < "1.3.231" or glslang_version >= "7.0.0" or not self.options.shared
has_oglcompiler = glslang_version < "1.3.231" or glslang_version >= "7.0.0" or not self.options.shared

# no longer available for version 13.0.0
if glslang_version >= "13.0.0" and self.options.shared == True:
has_osdependent = False
has_oglcompiler = False
# glslang
self.cpp_info.components["glslang-core"].set_property("cmake_target_name", "glslang::glslang")
self.cpp_info.components["glslang-core"].names["cmake_find_package"] = "glslang"
Expand Down
90 changes: 90 additions & 0 deletions recipes/glslang/all/patches/0002-no-force-glslang-pic.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt
index 71a5675d..1fc3649f 100644
--- a/OGLCompilersDLL/CMakeLists.txt
+++ b/OGLCompilersDLL/CMakeLists.txt
@@ -35,7 +35,6 @@ set(SOURCES InitializeDll.cpp InitializeDll.h)

add_library(OGLCompiler STATIC ${SOURCES})
set_property(TARGET OGLCompiler PROPERTY FOLDER glslang)
-set_property(TARGET OGLCompiler PROPERTY POSITION_INDEPENDENT_CODE ON)

if(WIN32)
source_group("Source" FILES ${SOURCES})
diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt
index a80e74ed..78db5f73 100644
--- a/SPIRV/CMakeLists.txt
+++ b/SPIRV/CMakeLists.txt
@@ -73,7 +73,6 @@ set(SPVREMAP_HEADERS
add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
set_target_properties(SPIRV PROPERTIES
FOLDER glslang
- POSITION_INDEPENDENT_CODE ON
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}")
target_include_directories(SPIRV PUBLIC
@@ -86,7 +85,6 @@ if (ENABLE_SPVREMAPPER)
add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
set_target_properties(SPVRemapper PROPERTIES
FOLDER glslang
- POSITION_INDEPENDENT_CODE ON
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}")
endif()
diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt
index d4df9396..7541b09f 100644
--- a/glslang/CMakeLists.txt
+++ b/glslang/CMakeLists.txt
@@ -166,7 +166,6 @@ set(GLSLANG_HEADERS
add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${GLSLANG_SOURCES} ${GLSLANG_HEADERS})
set_target_properties(glslang PROPERTIES
FOLDER glslang
- POSITION_INDEPENDENT_CODE ON
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}")
target_link_libraries(glslang PRIVATE OGLCompiler OSDependent MachineIndependent)
@@ -199,8 +198,7 @@ add_library(glslang-default-resource-limits STATIC ${RESOURCELIMITS_SOURCES} ${R
set_target_properties(glslang-default-resource-limits PROPERTIES
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}"
- FOLDER glslang
- POSITION_INDEPENDENT_CODE ON)
+ FOLDER glslang)

target_include_directories(glslang-default-resource-limits PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt
index f6b1c6af..185e40e5 100644
--- a/glslang/OSDependent/Unix/CMakeLists.txt
+++ b/glslang/OSDependent/Unix/CMakeLists.txt
@@ -33,7 +33,6 @@

add_library(OSDependent STATIC ossource.cpp ../osinclude.h)
set_property(TARGET OSDependent PROPERTY FOLDER glslang)
-set_property(TARGET OSDependent PROPERTY POSITION_INDEPENDENT_CODE ON)

# Link pthread
set(THREADS_PREFER_PTHREAD_FLAG ON)
diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt
index 882133ab..5302bb93 100644
--- a/glslang/OSDependent/Windows/CMakeLists.txt
+++ b/glslang/OSDependent/Windows/CMakeLists.txt
@@ -35,7 +35,6 @@ set(SOURCES ossource.cpp ../osinclude.h)

add_library(OSDependent STATIC ${SOURCES})
set_property(TARGET OSDependent PROPERTY FOLDER glslang)
-set_property(TARGET OSDependent PROPERTY POSITION_INDEPENDENT_CODE ON)

# MinGW GCC complains about function pointer casts to void*.
# Turn that off with -fpermissive.
diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt
index 058a67b0..89687025 100644
--- a/hlsl/CMakeLists.txt
+++ b/hlsl/CMakeLists.txt
@@ -40,7 +40,6 @@
add_library(HLSL ${LIB_TYPE} "stub.cpp")
set_target_properties(HLSL PROPERTIES
FOLDER hlsl
- POSITION_INDEPENDENT_CODE ON
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}")

2 changes: 2 additions & 0 deletions recipes/glslang/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ versions:
folder: all
"1.3.204.0":
folder: all
"13.0.0":
folder: all
"11.7.0":
folder: all
"11.6.0":
Expand Down