mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
qb: Support building with a system version of glslang.
This commit is contained in:
parent
65e071e470
commit
74a09844c2
@ -1547,8 +1547,8 @@ ifeq ($(HAVE_SHADERS_COMMON), 1)
|
|||||||
OBJ += gfx/video_shader_parse.o
|
OBJ += gfx/video_shader_parse.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_GLSLANG), 1)
|
ifeq ($(HAVE_BUILTINGLSLANG), 1)
|
||||||
DEFINES += -DHAVE_GLSLANG
|
HAVE_GLSLANG_COMMON = 1
|
||||||
|
|
||||||
ifneq ($(findstring Win32,$(OS)),)
|
ifneq ($(findstring Win32,$(OS)),)
|
||||||
GLSLANG_PLATFORM := Windows
|
GLSLANG_PLATFORM := Windows
|
||||||
@ -1562,8 +1562,7 @@ ifeq ($(HAVE_GLSLANG), 1)
|
|||||||
-I$(DEPS_DIR)/glslang/glslang \
|
-I$(DEPS_DIR)/glslang/glslang \
|
||||||
-I$(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent \
|
-I$(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent \
|
||||||
-I$(DEPS_DIR)/glslang/glslang/glslang/Public \
|
-I$(DEPS_DIR)/glslang/glslang/glslang/Public \
|
||||||
-I$(DEPS_DIR)/glslang/glslang/SPIRV \
|
-I$(DEPS_DIR)/glslang/glslang/SPIRV
|
||||||
-I$(DEPS_DIR)/glslang
|
|
||||||
|
|
||||||
GLSLANG_SOURCES := \
|
GLSLANG_SOURCES := \
|
||||||
$(wildcard $(DEPS_DIR)/glslang/*.cpp) \
|
$(wildcard $(DEPS_DIR)/glslang/*.cpp) \
|
||||||
@ -1578,7 +1577,23 @@ ifeq ($(HAVE_GLSLANG), 1)
|
|||||||
DEFINES += -DENABLE_HLSL
|
DEFINES += -DENABLE_HLSL
|
||||||
GLSLANG_SOURCES += $(wildcard $(DEPS_DIR)/glslang/glslang/hlsl/*.cpp)
|
GLSLANG_SOURCES += $(wildcard $(DEPS_DIR)/glslang/glslang/hlsl/*.cpp)
|
||||||
endif
|
endif
|
||||||
|
else ifeq ($(HAVE_GLSLANG),1)
|
||||||
|
HAVE_GLSLANG_COMMON = 1
|
||||||
|
GLSLANG_SOURCES := $(DEPS_DIR)/glslang/glslang.cpp
|
||||||
|
|
||||||
|
# The order of these libs are somewhat specific
|
||||||
|
LIBS += $(GLSLANG_LIBS) \
|
||||||
|
$(GLSLANG_OSDEPENDENT_LIBS) \
|
||||||
|
$(GLSLANG_OGLCOMPILER_LIBS) \
|
||||||
|
$(GLSLANG_HLSL_LIBS) \
|
||||||
|
$(GLSLANG_SPIRV_LIBS) \
|
||||||
|
$(GLSLANG_SPIRV_TOOLS_OPT_LIBS) \
|
||||||
|
$(GLSLANG_SPIRV_TOOLS_LIBS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(HAVE_GLSLANG_COMMON), 1)
|
||||||
|
DEFINES += -DHAVE_GLSLANG
|
||||||
|
INCLUDE_DIRS += -I$(DEPS_DIR)/glslang
|
||||||
OBJ += $(GLSLANG_SOURCES:.cpp=.o)
|
OBJ += $(GLSLANG_SOURCES:.cpp=.o)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
5
deps/glslang/glslang.cpp
vendored
5
deps/glslang/glslang.cpp
vendored
@ -15,8 +15,13 @@
|
|||||||
|
|
||||||
#include "glslang.hpp"
|
#include "glslang.hpp"
|
||||||
|
|
||||||
|
#ifdef HAVE_BUILTINGLSLANG
|
||||||
#include "glslang/glslang/Public/ShaderLang.h"
|
#include "glslang/glslang/Public/ShaderLang.h"
|
||||||
#include "glslang/SPIRV/GlslangToSpv.h"
|
#include "glslang/SPIRV/GlslangToSpv.h"
|
||||||
|
#elif HAVE_GLSLANG
|
||||||
|
#include <glslang/Public/ShaderLang.h>
|
||||||
|
#include <glslang/SPIRV/GlslangToSpv.h>
|
||||||
|
#endif
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@ -564,6 +564,39 @@ check_enabled CXX SLANG slang 'The C++ compiler is' false
|
|||||||
check_enabled CXX GLSLANG glslang 'The C++ compiler is' false
|
check_enabled CXX GLSLANG glslang 'The C++ compiler is' false
|
||||||
check_enabled CXX SPIRV_CROSS SPIRV-Cross 'The C++ compiler is' false
|
check_enabled CXX SPIRV_CROSS SPIRV-Cross 'The C++ compiler is' false
|
||||||
|
|
||||||
|
check_enabled GLSLANG BUILTINGLSLANG 'builtin glslang' 'glslang is' true
|
||||||
|
|
||||||
|
if [ "$HAVE_GLSLANG" != no ]; then
|
||||||
|
check_header cxx GLSLANG \
|
||||||
|
glslang/Public/ShaderLang.h \
|
||||||
|
glslang/SPIRV/GlslangToSpv.h
|
||||||
|
|
||||||
|
check_lib cxx GLSLANG -lglslang
|
||||||
|
check_lib cxx GLSLANG_OSDEPENDENT -lOSDependent
|
||||||
|
check_lib cxx GLSLANG_OGLCOMPILER -lOGLCompiler
|
||||||
|
check_lib cxx GLSLANG_HLSL -lHLSL
|
||||||
|
check_lib cxx GLSLANG_SPIRV -lSPIRV
|
||||||
|
check_lib cxx GLSLANG_SPIRV_TOOLS_OPT -lSPIRV-Tools-opt
|
||||||
|
check_lib cxx GLSLANG_SPIRV_TOOLS -lSPIRV-Tools
|
||||||
|
|
||||||
|
if [ "$HAVE_GLSLANG" = no ] ||
|
||||||
|
[ "$HAVE_GLSLANG_OSDEPENDENT" = no ] ||
|
||||||
|
[ "$HAVE_GLSLANG_OGLCOMPILER" = no ] ||
|
||||||
|
[ "$HAVE_GLSLANG_HLSL" = no ] ||
|
||||||
|
[ "$HAVE_GLSLANG_SPIRV" = no ] ||
|
||||||
|
[ "$HAVE_GLSLANG_SPIRV_TOOLS_OPT" = no ] ||
|
||||||
|
[ "$HAVE_GLSLANG_SPIRV_TOOLS" = no ]; then
|
||||||
|
if [ "$HAVE_BUILTINGLSLANG" != yes ]; then
|
||||||
|
die : 'Notice: System glslang libraries not found, disabling glslang support.'
|
||||||
|
HAVE_GLSLANG=no
|
||||||
|
else
|
||||||
|
HAVE_GLSLANG=yes
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
HAVE_GLSLANG=yes
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
check_enabled SLANG GLSLANG glslang 'slang is' false
|
check_enabled SLANG GLSLANG glslang 'slang is' false
|
||||||
check_enabled SLANG SPIRV_CROSS SPIRV-Cross 'slang is' false
|
check_enabled SLANG SPIRV_CROSS SPIRV-Cross 'slang is' false
|
||||||
check_enabled SLANG OPENGL_CORE 'OpenGL core' 'slang is' false
|
check_enabled SLANG OPENGL_CORE 'OpenGL core' 'slang is' false
|
||||||
|
@ -161,6 +161,8 @@ HAVE_SLANG=auto # slang support
|
|||||||
C89_SLANG=no
|
C89_SLANG=no
|
||||||
HAVE_GLSLANG=auto # glslang support (requires C++11)
|
HAVE_GLSLANG=auto # glslang support (requires C++11)
|
||||||
C89_GLSLANG=no
|
C89_GLSLANG=no
|
||||||
|
HAVE_BUILTINGLSLANG=auto # Bake in glslang support
|
||||||
|
C89_BUILTINGLSLANG=no
|
||||||
HAVE_SPIRV_CROSS=auto # SPIRV-Cross support (requires C++11)
|
HAVE_SPIRV_CROSS=auto # SPIRV-Cross support (requires C++11)
|
||||||
C89_SPIRV_CROSS=no
|
C89_SPIRV_CROSS=no
|
||||||
HAVE_METAL=no # Metal support (macOS-only)
|
HAVE_METAL=no # Metal support (macOS-only)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user