(msvc) fix glslang build.

glslang still can't build with griffin since the files expect to be
compiled seperately.
This commit is contained in:
aliaspider 2018-01-21 11:52:56 +01:00
parent e601190ecb
commit d0d8a98046
5 changed files with 29 additions and 35 deletions

View File

@ -7,6 +7,10 @@ ARCH = amd64
BUILD_DIR = objs/msvc
WindowsSdkDir = C:\Program Files (x86)\Windows Kits\10\$(NOTHING)
WindowsSDKVersion := 10.0.14393.0\$(NOTHING)
VCINSTALLDIR := C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\$(NOTHING)
HAVE_D3DX := 1
HAVE_D3D8 := 0
HAVE_D3D9 := 1
@ -14,6 +18,7 @@ HAVE_D3D11 := 1
HAVE_D3D12 := 1
HAVE_CG := 1
HAVE_OPENGL := 1
HAVE_VULKAN := 1
HAVE_RPNG := 1
HAVE_ZLIB := 1
@ -44,6 +49,14 @@ HAVE_LANGEXTRA := 1
HAVE_CHEEVOS := 1
HAVE_KEYMAPPER := 1
include Makefile.common
CXXFLAGS := $(filter-out -fpermissive -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -Wno-parentheses,$(CXXFLAGS))
CXXFLAGS += $(CFLAGS)
LIBS := $(filter-out -lstdc++,$(LIBS))
ifeq ($(HAVE_VULKAN),1)
DEFINES += -DHAVE_VULKAN
endif
ifeq ($(ARCH),x64)
ARCH := amd64
endif
@ -72,10 +85,6 @@ CROSS =
endif
WindowsSdkDir = C:\Program Files (x86)\Windows Kits\10\$(NOTHING)
WindowsSDKVersion := 10.0.14393.0\$(NOTHING)
VCINSTALLDIR := C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\$(NOTHING)
INCLUDE := $(VCINSTALLDIR)include;$(VCINSTALLDIR)atlmfc\include;$(WindowsSdkDir)include\$(WindowsSDKVersion)ucrt;$(WindowsSdkDir)include\$(WindowsSDKVersion)shared;$(WindowsSdkDir)include\$(WindowsSDKVersion)um;
LIB := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS);$(WindowsSdkDir)lib\$(WindowsSDKVersion)ucrt\$(TARGET_ARCH2);$(WindowsSdkDir)lib\$(WindowsSDKVersion)um\$(TARGET_ARCH2);C:\Program Files (x86)\NVIDIA Corporation\Cg\lib.$(TARGET_ARCH2);C:\Program Files (x86)\Microsoft DirectX SDK (February 2010)\Lib\$(TARGET_ARCH2);
LIBPATH := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS);
@ -97,7 +106,6 @@ export PATH := $(PATH)
#$(info PATH : $(PATH))
#$(error end)
DEFINES :=
ifeq ($(TARGET_ARCH),x64)
DEFINES += -D__x86_64__
else
@ -112,7 +120,7 @@ FLAGS += -Gm- -Zc:inline -fp:precise -Zc:forScope -GR- -Gd -Oi -volatile:iso
CFLAGS += -TC
CXXFLAGS += -TP
CXXFLAGS += -TP -EHsc
WARNINGS += -WX -W3
WARNINGS += -wd4101 -wd4996 -wd4244 -wd4267 -wd4090 -wd4305 -wd4146 -wd4334 -wd4018
@ -130,13 +138,9 @@ FLAGS += -GS -Gy -Od -RTC1 -D_SECURE_SCL=1 -Zi
FLAGS += -MDd
LDFLAGS += -DEBUG
DEFINES += -DDEBUG -D_DEBUG
#LIBS += -ld3d9 -ld3dx9d
else
FLAGS += -GS- -Gy- -O2 -Ob2 -GF -GT -Oy -Ot -D_SECURE_SCL=0
FLAGS += -MD
#LIBS += -ld3d9 -ld3dx9
endif
@ -155,21 +159,16 @@ ifneq ($(V), 1)
endif
OBJ :=
include Makefile.common
ifeq ($(GRIFFIN_BUILD), 1)
OBJ := griffin/griffin.o
DEFINES_BLACKLIST := -DHAVE_COMPRESSION
DEFINES := $(filter-out $(DEFINES_BLACKLIST),$(DEFINES))
DEFINES += -DHAVE_GRIFFIN -DUSE_MATH_DEFINES
OBJ := griffin/griffin.o griffin/griffin_cpp.o
DEFINES += -DHAVE_GRIFFIN -DUSE_MATH_DEFINES
else
DEFINES += -DJSON_STATIC
DEFINES += -DWANT_GLSLANG
BLACKLIST :=
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
endif
DEFINES += -DRARCH_INTERNAL -DHAVE_DYNAMIC
DEFINES += -DRARCH_INTERNAL -DHAVE_DYNAMIC -DJSON_STATIC
INCLUDE_DIRS += -I. -Igfx/include
#OBJ := version_git.o
@ -178,11 +177,9 @@ OBJ := $(patsubst %rarch.o,%rarch.res,$(OBJ))
OBJ := $(addprefix $(BUILD_DIR)/,$(OBJ))
OBJ := $(OBJ:.o=.obj)
#INCDIRS := -I. -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ilibretro-common/include
#CFLAGS = $(FLAGS)
#CXXFLAGS = $(FLAGS)
LDFLAGS += -WX -SUBSYSTEM:WINDOWS -ENTRY:mainCRTStartup
DEFINES := $(patsubst -f%,,$(DEFINES))
@ -233,29 +230,24 @@ MAKEDEPS = echo $@: $< \\ > $(BUILD_DIR)/$*.depend && \
#MAKEDEPS :=
$(BUILD_DIR)/%.obj: %.cpp
@$(if $(Q), echo CXX $<,)
@mkdir -p $(dir $@)
$(Q)$(CXX) -c -Fo:$@ $< $(FLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDE_DIRS) $(WARNINGS) $(DEPFLAGS)
@$(MAKEDEPS)
$(BUILD_DIR)/%.obj: %.c
@$(if $(Q), echo CC $<,)
@mkdir -p $(dir $@)
$(Q)$(CC) -c -Fo:$@ $< $(FLAGS) $(CFLAGS) $(DEFINES) $(INCLUDE_DIRS) $(WARNINGS) $(DEPFLAGS)
@$(MAKEDEPS)
$(BUILD_DIR)/%.res: %.rc
@$(if $(Q), echo RC $<,)
@mkdir -p $(dir $@)
$(Q)$(RC) $<
$(Q)mv $*.res $@
$(BUILD_DIR)/$(TARGET): $(OBJ) .$(TARGET).last
@$(if $(Q), echo LD $@,)
@touch .$(TARGET).last
$(Q)$(LD) $(OBJ) $(LDFLAGS) $(LIBS) -out:$(BUILD_DIR)/$(TARGET)
%.depend: ;
%.last: ;

View File

@ -369,7 +369,7 @@ bool glslang_parse_meta(const vector<string> &lines, glslang_meta *meta)
}
#ifdef HAVE_VULKAN
#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(WANT_GLSLANG)
bool glslang_compile_shader(const char *shader_path, glslang_output *output)
{
return false;

View File

@ -16,6 +16,7 @@
#include "spirv_cross.hpp"
#include "slang_reflection.hpp"
#include <vector>
#include <algorithm>
#include <stdio.h>
#include "../../verbosity.h"

View File

@ -17,11 +17,11 @@
#define HAVE_IBXM 1
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
#define HAVE_SHADERS
#define HAVE_SHADERS 1
#endif
#if defined(HAVE_ZLIB) || defined(HAVE_7ZIP)
#define HAVE_COMPRESSION
#define HAVE_COMPRESSION 1
#endif
#if _MSC_VER
@ -1050,7 +1050,7 @@ THREAD
NETPLAY
============================================================ */
#ifdef HAVE_NETWORKING
#define JSON_STATIC /* must come before netplay_room_parse and jsonsax_full */
#define JSON_STATIC 1 /* must come before netplay_room_parse and jsonsax_full */
#include "../network/netplay/netplay_delta.c"
#include "../network/netplay/netplay_frontend.c"
#include "../network/netplay/netplay_handshake.c"
@ -1298,7 +1298,7 @@ XML
============================================================ */
#if 0
#ifndef HAVE_LIBXML2
#define RXML_LIBXML2_COMPAT
#define RXML_LIBXML2_COMPAT 1
#include "../libretro-common/formats/xml/rxml.c"
#endif
#endif

View File

@ -14,14 +14,15 @@
*/
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
#define HAVE_SHADERS
#define HAVE_SHADERS 1
#endif
#if defined(HAVE_ZLIB) || defined(HAVE_7ZIP)
#define HAVE_COMPRESSION
#define HAVE_COMPRESSION 1
#endif
#if defined(_MSC_VER)
#include <string.h>
#include <compat/posix_string.h>
#endif
@ -81,7 +82,6 @@
#include "../deps/glslang/glslang/hlsl/hlslParseHelper.cpp"
#include "../deps/glslang/glslang/hlsl/hlslScanContext.cpp"
#include "../deps/glslang/glslang/hlsl/hlslTokenStream.cpp"
#ifdef _WIN32
#include "../deps/glslang/glslang/glslang/OSDependent/Windows/ossource.cpp"
#endif
@ -122,6 +122,7 @@ VIDEO DRIVER
#include "../gfx/drivers_shader/shader_vulkan.cpp"
#include "../gfx/drivers_shader/glslang_util.cpp"
#include "../gfx/drivers_shader/slang_reflection.cpp"
#include "../gfx/drivers_shader/slang_preprocess.cpp"
#include "../deps/SPIRV-Cross/spirv_cross.cpp"
#include "../deps/SPIRV-Cross/spirv_cfg.cpp"
#endif