forked from SFTtech/openage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple
executable file
·32 lines (26 loc) · 1.96 KB
/
simple
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# compiler invocations that should do about the same thing as the real build system.
#
# may be used
# - for understanding what the 'big' buildsystem actually does
# - as an last resort, if you can't get cmake to work
# - if you ever wanted to do a single g++ invocation that takes serveral minutes to complete
#
# depending on your distribution and current decade, minor to major adjustments may be neccesary.
#
# this script was written by carefully looking at the output of make VERBOSE=1.
# if you add libraries/etc to the project, please update this script accordingly (and test it).
PYVER=3.4m
PYVERDOTLESS=34m
shopt -s globstar
# build py ext module (openage.convert.cabextract.lzxd)
g++ -O3 -Wall -Wextra -pedantic -std=c++11 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fwrapv -fstack-protector-strong --param=ssp-buffer-size=4 -fPIC -I/usr/include/python${PYVER} -lpthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro -lpython${PYVER} -o py/openage/convert/cabextract/lzxd.cpython-${PYVERDOTLESS}.so py/openage/convert/cabextract/lzxd/{lzxd.cpp,pyinterface.cpp,util.cpp}
# these files would be filled with actual test lists by testing.cmake
touch assets/tests_py assets/tests_cpp
# this file would be generated by cmake
echo "global_asset_dir = '/usr/share/openage'" > py/openage/config.py
echo "version = '`cat openage_version`'" >> py/openage/config.py
# generate C code from convert script
PYTHONPATH="$PYTHONPATH:py" python3 -m openage.codegen --target-cache=/tmp/codegentargets --depend-cache=/tmp/codegendepends --cpp-src-dir=cpp --write-to-sourcedir
# build binary (bin/openage)
g++ -O3 -Wall -Wextra -pedantic -std=c++11 -I/usr/include/freetype2 -I/usr/include/FTGL -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/opus -I/usr/include/python${PYVER} -I/usr/include/SDL2 -lfontconfig -lfreetype -lftgl -lGLEW -lm -lGLU -lGL -lSM -lICE -lX11 -lXext -lopusfile -lpython${PYVER} -lSDL2_image -lSDL2 -lpthread -lSDL2 -lpthread -lutil -o openage cpp/**/*.cpp