diff --git a/.github/workflows/continuous_deployment.yml b/.github/workflows/continuous_deployment.yml index f7fd9ce41..65548309b 100644 --- a/.github/workflows/continuous_deployment.yml +++ b/.github/workflows/continuous_deployment.yml @@ -84,9 +84,7 @@ jobs: lib/libGenericCodeGen.a \ lib/libglslang.a \ lib/libglslang-default-resource-limits.a \ - lib/libHLSL.a \ lib/libMachineIndependent.a \ - lib/libOGLCompiler.a \ lib/libOSDependent.a \ lib/libSPIRV.a \ lib/libSPVRemapper.a \ @@ -145,9 +143,7 @@ jobs: lib/libGenericCodeGen.a \ lib/libglslang.a \ lib/libglslang-default-resource-limits.a \ - lib/libHLSL.a \ lib/libMachineIndependent.a \ - lib/libOGLCompiler.a \ lib/libOSDependent.a \ lib/libSPIRV.a \ lib/libSPVRemapper.a \ @@ -201,9 +197,7 @@ jobs: lib/GenericCodeGend.lib ` lib/glslangd.lib ` lib/glslang-default-resource-limitsd.lib ` - lib/HLSLd.lib ` lib/MachineIndependentd.lib ` - lib/OGLCompilerd.lib ` lib/OSDependentd.lib ` lib/SPIRVd.lib ` lib/SPVRemapperd.lib ` @@ -223,9 +217,7 @@ jobs: lib/GenericCodeGen.lib ` lib/glslang.lib ` lib/glslang-default-resource-limits.lib ` - lib/HLSL.lib ` lib/MachineIndependent.lib ` - lib/OGLCompiler.lib ` lib/OSDependent.lib ` lib/SPIRV.lib ` lib/SPVRemapper.lib ` diff --git a/Android.mk b/Android.mk index 6787a972a..dcb995844 100644 --- a/Android.mk +++ b/Android.mk @@ -64,27 +64,6 @@ LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/OSDependent/Unix/ LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)/glslang/OSDependent/Unix/ include $(BUILD_STATIC_LIBRARY) -include $(CLEAR_VARS) -LOCAL_MODULE:=OGLCompiler -LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES) -LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH) -LOCAL_SRC_FILES:=OGLCompilersDLL/InitializeDll.cpp -LOCAL_C_INCLUDES:=$(LOCAL_PATH)/OGLCompiler -LOCAL_STATIC_LIBRARIES:=OSDependent -include $(BUILD_STATIC_LIBRARY) - -# Build the stubbed HLSL library. -# The HLSL source is now directly referenced by the glslang static library -# instead. -include $(CLEAR_VARS) -LOCAL_MODULE:=HLSL -LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES) -LOCAL_SRC_FILES:= \ - hlsl/stub.cpp -LOCAL_C_INCLUDES:=$(LOCAL_PATH) \ - $(LOCAL_PATH)/glslang/HLSL -include $(BUILD_STATIC_LIBRARY) - include $(CLEAR_VARS) GLSLANG_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT))) @@ -138,7 +117,7 @@ LOCAL_C_INCLUDES:=$(LOCAL_PATH) \ $(LOCAL_PATH)/glslang/MachineIndependent \ $(GLSLANG_GENERATED_INCLUDEDIR) \ $(GLSLANG_OUT_PATH) -LOCAL_STATIC_LIBRARIES:=OSDependent OGLCompiler HLSL +LOCAL_STATIC_LIBRARIES:=OSDependent include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) diff --git a/BUILD.gn b/BUILD.gn index 0bb0d42ec..6384de04d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -117,8 +117,6 @@ template("glslang_sources_common") { } sources = [ - "OGLCompilersDLL/InitializeDll.cpp", - "OGLCompilersDLL/InitializeDll.h", "SPIRV/GLSL.ext.AMD.h", "SPIRV/GLSL.ext.EXT.h", "SPIRV/GLSL.ext.KHR.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d71b64fc..5bde68a6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,7 +113,7 @@ if(ENABLE_CTEST) endif() if(ENABLE_HLSL) - add_definitions(-DENABLE_HLSL) + add_compile_definitions(ENABLE_HLSL) endif() if(WIN32) @@ -292,14 +292,10 @@ else() endif() add_subdirectory(glslang) -add_subdirectory(OGLCompilersDLL) if(ENABLE_GLSLANG_BINARIES) add_subdirectory(StandAlone) endif() add_subdirectory(SPIRV) -if(ENABLE_HLSL) - add_subdirectory(hlsl) -endif() if(ENABLE_CTEST) add_subdirectory(gtests) endif() diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt deleted file mode 100644 index 71a5675d1..000000000 --- a/OGLCompilersDLL/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2020 The Khronos Group 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 The Khronos Group 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. - -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}) -endif(WIN32) - -if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS) - install(TARGETS OGLCompiler EXPORT glslang-targets) - - # Backward compatibility - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OGLCompilerTargets.cmake" " - message(WARNING \"Using `OGLCompilerTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\") - - if (NOT TARGET glslang::OGLCompiler) - include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\") - endif() - - add_library(OGLCompiler ALIAS glslang::OGLCompiler) - ") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/OGLCompilerTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) - -endif() diff --git a/OGLCompilersDLL/InitializeDll.cpp b/OGLCompilersDLL/InitializeDll.cpp deleted file mode 100644 index ab3762e01..000000000 --- a/OGLCompilersDLL/InitializeDll.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// -// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -// 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 3Dlabs Inc. Ltd. 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. -// - -namespace glslang { - -} // end namespace glslang diff --git a/OGLCompilersDLL/InitializeDll.h b/OGLCompilersDLL/InitializeDll.h deleted file mode 100644 index b18e2ab3c..000000000 --- a/OGLCompilersDLL/InitializeDll.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -// 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 3Dlabs Inc. Ltd. 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. -// -#ifndef __INITIALIZEDLL_H -#define __INITIALIZEDLL_H - -#include "../glslang/OSDependent/osinclude.h" - -namespace glslang { - -inline bool InitProcess() { return true; } // DEPRECATED -inline bool InitThread() { return true; } // DEPRECATED -inline bool DetachThread() { return true; } // DEPRECATED -inline bool DetachProcess() { return true; } // DEPRECATED - -} // end namespace glslang - -#endif // __INITIALIZEDLL_H - diff --git a/README.md b/README.md index 88b07b589..2ea6c1b72 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# News - -1. C++17 (all platforms) and Visual Studio 2019 (Windows) are now required. This change was driven by the external dependency on SPIRV-Tools. - ![Continuous Integration](https://github.com/KhronosGroup/glslang/actions/workflows/continuous_integration.yml/badge.svg) ![Continuous Deployment](https://github.com/KhronosGroup/glslang/actions/workflows/continuous_deployment.yml/badge.svg) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/KhronosGroup/glslang/badge)](https://securityscorecards.dev/viewer/?uri=github.com/KhronosGroup/glslang) +# News + +1. `OGLCompiler` and `HLSL` stub libraries have been fully removed from the build. + 2. `OVERRIDE_MSVCCRT` has been removed in favor of `CMAKE_MSVC_RUNTIME_LIBRARY` Users are encouraged to utilize the standard approach via [CMAKE_MSVC_RUNTIME_LIBRARY](https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html). diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt index 6a44f3aec..6552290bf 100644 --- a/glslang/CMakeLists.txt +++ b/glslang/CMakeLists.txt @@ -143,7 +143,7 @@ glslang_add_build_info_dependency(MachineIndependent) glslang_pch(MachineIndependent MachineIndependent/pch.h) -target_link_libraries(MachineIndependent PRIVATE OGLCompiler OSDependent GenericCodeGen) +target_link_libraries(MachineIndependent PRIVATE OSDependent GenericCodeGen) ################################################################################ # glslang @@ -174,7 +174,7 @@ set_target_properties(glslang PROPERTIES POSITION_INDEPENDENT_CODE ON VERSION "${GLSLANG_VERSION}" SOVERSION "${GLSLANG_VERSION_MAJOR}") -target_link_libraries(glslang PRIVATE OGLCompiler OSDependent MachineIndependent) +target_link_libraries(glslang PRIVATE OSDependent MachineIndependent) target_include_directories(glslang PUBLIC $ $) diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index b4dfacfa3..6e50a9d45 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -58,7 +58,6 @@ #endif #include "../Include/ShHandle.h" -#include "../../OGLCompilersDLL/InitializeDll.h" #include "preprocessor/PpContext.h" @@ -1311,9 +1310,6 @@ bool CompileDeferred( // int ShInitialize() { - if (! InitProcess()) - return 0; - const std::lock_guard lock(init_lock); ++NumberOfClients; @@ -1335,9 +1331,6 @@ int ShInitialize() ShHandle ShConstructCompiler(const EShLanguage language, int /*debugOptions unused*/) { - if (!InitThread()) - return nullptr; - TShHandleBase* base = static_cast(ConstructCompiler(language, 0)); return reinterpret_cast(base); @@ -1345,9 +1338,6 @@ ShHandle ShConstructCompiler(const EShLanguage language, int /*debugOptions unus ShHandle ShConstructLinker(const EShExecutable executable, int /*debugOptions unused*/) { - if (!InitThread()) - return nullptr; - TShHandleBase* base = static_cast(ConstructLinker(executable, 0)); return reinterpret_cast(base); @@ -1355,9 +1345,6 @@ ShHandle ShConstructLinker(const EShExecutable executable, int /*debugOptions un ShHandle ShConstructUniformMap() { - if (!InitThread()) - return nullptr; - TShHandleBase* base = static_cast(ConstructUniformMap()); return reinterpret_cast(base); @@ -1871,8 +1858,6 @@ void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlatt bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, bool forwardCompatible, EShMessages messages, Includer& includer) { - if (! InitThread()) - return false; SetThreadPoolAllocator(pool); if (! preamble) @@ -1897,8 +1882,6 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources, std::string* output_string, Includer& includer) { - if (! InitThread()) - return false; SetThreadPoolAllocator(pool); if (! preamble) diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt index 882133ab3..c9d404a49 100644 --- a/glslang/OSDependent/Windows/CMakeLists.txt +++ b/glslang/OSDependent/Windows/CMakeLists.txt @@ -31,15 +31,19 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -set(SOURCES ossource.cpp ../osinclude.h) +add_library(OSDependent STATIC) + +target_sources(OSDependent PRIVATE + ../osinclude.h + ossource.cpp +) -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. -if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") +if(MINGW AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") target_compile_options(OSDependent PRIVATE -fpermissive) endif() diff --git a/glslang/OSDependent/Windows/main.cpp b/glslang/OSDependent/Windows/main.cpp deleted file mode 100644 index 0bcde7b66..000000000 --- a/glslang/OSDependent/Windows/main.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -// 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 3Dlabs Inc. Ltd. 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. -// - -#include "InitializeDll.h" - -#define STRICT -#define VC_EXTRALEAN 1 -#include -#include - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - switch (fdwReason) - { - case DLL_PROCESS_ATTACH: - - if (! glslang::InitProcess()) - return FALSE; - break; - case DLL_THREAD_ATTACH: - - if (! glslang::InitThread()) - return FALSE; - break; - - case DLL_THREAD_DETACH: - - if (! glslang::DetachThread()) - return FALSE; - break; - - case DLL_PROCESS_DETACH: - - glslang::DetachProcess(); - break; - - default: - assert(0 && "DllMain(): Reason for calling DLL Main is unknown"); - return FALSE; - } - - return TRUE; -} diff --git a/gtests/CMakeLists.txt b/gtests/CMakeLists.txt index b73e7f159..37d2dbb15 100644 --- a/gtests/CMakeLists.txt +++ b/gtests/CMakeLists.txt @@ -103,16 +103,13 @@ if(BUILD_TESTING) endif() set(LIBRARIES - glslang OSDependent OGLCompiler glslang + glslang OSDependent glslang SPIRV glslang-default-resource-limits) if(ENABLE_SPVREMAPPER) set(LIBRARIES ${LIBRARIES} SPVRemapper) endif() - if(ENABLE_HLSL) - set(LIBRARIES ${LIBRARIES} HLSL) - endif() target_link_libraries(glslangtests PRIVATE ${LIBRARIES} gmock) add_test(NAME glslang-gtests diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt deleted file mode 100644 index 058a67b08..000000000 --- a/hlsl/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (C) 2020 The Khronos Group 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 The Khronos Group 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. - -# The HLSL source is directly embedded into the glslang target when ENABLE_HLSL -# is set. -# This source now lives at: glslang/HLSL/ -# The HLSL target is now just a stub that exists for backwards compatibility for -# projects that referenced this target. - -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}") - -if(WIN32 AND BUILD_SHARED_LIBS) - set_target_properties(HLSL PROPERTIES PREFIX "") -endif() - -if(ENABLE_GLSLANG_INSTALL) - install(TARGETS HLSL EXPORT glslang-targets) - - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/HLSLTargets.cmake" " - message(WARNING \"Using `HLSLTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\") - - if (NOT TARGET glslang::HLSL) - include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\") - endif() - - add_library(HLSL ALIAS glslang::HLSL) - ") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/HLSLTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) -endif() diff --git a/hlsl/stub.cpp b/hlsl/stub.cpp deleted file mode 100644 index f1d39c151..000000000 --- a/hlsl/stub.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// -// Copyright (C) 2020 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. -// - -// The HLSL source is directly embedded into the glslang target when ENABLE_HLSL -// is set. -// This source now lives at: glslang/HLSL/ -// The HLSL target is now just a stub that exists for backwards compatibility -// for projects that referenced this target. As a target requires at least one -// source file to build, this file acts as that stub. diff --git a/ndk_test/Android.mk b/ndk_test/Android.mk index d2e93da52..112700c90 100644 --- a/ndk_test/Android.mk +++ b/ndk_test/Android.mk @@ -39,7 +39,7 @@ LOCAL_SRC_FILES:=test.cpp LOCAL_MODULE:=glslang_ndk_test LOCAL_LDLIBS:=-landroid LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti -Werror -LOCAL_STATIC_LIBRARIES:=glslang SPIRV HLSL +LOCAL_STATIC_LIBRARIES:=glslang SPIRV include $(BUILD_SHARED_LIBRARY) include $(LOCAL_PATH)/../Android.mk