Commit 0a981a1c authored by Martin Finkel's avatar Martin Finkel
Browse files

build: allow building for x86

parent 8d5f4f2e
......@@ -5,15 +5,24 @@ SRCS = RenderingPlugin.cpp RenderAPI.cpp RenderAPI_D3D11.cpp Log.cpp
OBJS = $(SRCS:.cpp=.o)
CXXFLAGS = -O2 -fdebug-prefix-map='/mnt/d/'='d:/' -Wall -I./include/ -I./mingw.thread
# LDFLAGS = -shared -m64
# gcc (ubuntu)
#LDFLAGS = -static-libgcc -static-libstdc++ -shared -L/mnt/d/Projects/vlc/win64/win64/vlc-4.0.0-dev/sdk/lib
# clang
LDFLAGS = -static-libgcc -static-libstdc++ -shared -Wl,-pdb= -L/mnt/d/vlc-4.0.0-dev/sdk/lib
ifeq ($(ARCH), x86_64)
LIB=/mnt/d/vlc-4.0.0-dev/sdk/lib
else
LIB=/mnt/d/vlc-4.0.0-dev-x86/sdk/lib
endif
LDFLAGS = -static-libgcc -static-libstdc++ -shared -Wl,-pdb= -L$(LIB)
LIBS = -lvlc -ld3d11 -ld3dcompiler_47 -ldxgi
ifeq ($(ARCH), x86_64)
BIN_PREFIX = x86_64-w64-mingw32
COMPILEFLAG = m64
else
BIN_PREFIX = i686-w64-mingw32
COMPILEFLAG = m32
endif
OUTPUT = $(TARGET).dll
CXX = $(BIN_PREFIX)-c++
......@@ -34,4 +43,4 @@ $(OUTPUT): $(OBJS)
$(CXX) $(LDFLAGS) -o $(OUTPUT) $(OBJS) $(LIBS)
.cpp.o:
$(CXX) $(CXXFLAGS) -m64 -c -o $@ $<
\ No newline at end of file
$(CXX) $(CXXFLAGS) -$(COMPILEFLAG) -c -o $@ $<
\ No newline at end of file
#! /bin/bash
cd Assets/VLC-Unity-Windows/Plugins/Source && make clean && make
cp RenderingPlugin.{dll,pdb} ../x86_64 -f
\ No newline at end of file
set -e
while [ $# -gt 0 ]; do
case $1 in
help|--help|-h)
echo "Use -a to set the ARCH:"
echo " ARM: (armeabi-v7a|arm)"
echo " ARM64: (arm64-v8a|arm64)"
echo " x64: x64, x86_64"
echo " x86: x86, i686"
echo " "
echo "Use -p to set the PLATFORM:"
echo " Windows: win"
echo " Android: android"
echo " "
echo "Use --release to build in release mode"
exit 0
;;
a|-a)
ARCH=$2
shift
;;
p|-p)
PLATFORM=$2
shift
;;
-r|release|--release)
RELEASE=1
;;
*)
diagnostic "$0: Invalid option '$1'."
diagnostic "$0: Try --help for more information."
exit 1
;;
esac
shift
done
echo "Building for OS '$PLATFORM' with target arch '$ARCH'"
OUTPUT="../$ARCH"
cd Assets/VLC-Unity-Windows/Plugins/Source && make clean && make PLATFORM=$PLATFORM ARCH=$ARCH
cp RenderingPlugin.{dll,pdb} $OUTPUT -f
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment