Skip to content

Commit

Permalink
Make code portable to Linux (cryptopp will be added later)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moligaloo committed Jun 30, 2013
1 parent f43bf56 commit 5ce9533
Show file tree
Hide file tree
Showing 6 changed files with 793 additions and 489 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -26,3 +26,6 @@ src/core/crypt0.h
lua5*.dll
li*3.dll
QSanguo*.exe
*.o
moc_*
QSanguosha
8 changes: 6 additions & 2 deletions QSanguosha.pro
Expand Up @@ -9,7 +9,7 @@ macx : ICON = resource/icon/sgs.icns
CONFIG += warn_on audio

# If you want to use crypto and rcc, please uncomment the following line:
# CONFIG += crypto
#CONFIG += crypto
# However, this is not supported under Linux or Mac OS X temporarily

# If you want to enable joystick support, please uncomment the following line:
Expand Down Expand Up @@ -300,7 +300,11 @@ OTHER_FILES += \
CONFIG(audio){
DEFINES += AUDIO_SUPPORT
INCLUDEPATH += include/fmod
LIBS += -lfmodex
unix{
LIBS += lib/libfmodex.so
}else{
LIBS += -lfmodex
}
SOURCES += src/core/audio.cpp
}

Expand Down
25 changes: 20 additions & 5 deletions compile.sh 100644 → 100755
Expand Up @@ -3,18 +3,30 @@
# This is a Shell script that ease our compilation work in Linux
# You should has Qt, swig, and plib installed before running this script

which -s qmake
if [[ $? != 0 ]]; then
if ! which -s qmake ; then
echo "Qt is not installed or its tools are not in the PATH"
exit 1
fi

which -s swig
if [[ $? != 0 ]]; then
if ! which -s swig ; then
echo "Swig is not installed!"
exit 1
fi

if ! which -s 7z ; then
echo "You need 7z to unzip some files"
exit 1
fi


echo "Decompressing ttf file"
cd font
7z x font.7z
if [ -f "FONT.TTF" ]; then
mv FONT.TTF font.ttf # to lowercase
fi
cd $OLDPWD

# first, generate Lua binding C++ code
echo "Generate lua binding code"
sh swig/swig.sh
Expand All @@ -25,7 +37,10 @@ qmake QSanguosha.pro

# then do make
echo "Compile it"
make
if ! make ; then
echo "Compiling error"
exit 1
fi

# Compile the translation file
lrelease QSanguosha.pro
Expand Down
Binary file added lib/libfmodex.so
Binary file not shown.

0 comments on commit 5ce9533

Please sign in to comment.