Build system: add a central directory to collect all the include files
parent
2cc2543b2a
commit
1804433a9f
|
@ -4,6 +4,9 @@
|
|||
/dependencies/*
|
||||
!/dependencies/.placeholder
|
||||
|
||||
/include/*
|
||||
!/include/.placeholder
|
||||
|
||||
.localenv.bashrc
|
||||
|
||||
# ignore endianness check
|
||||
|
|
|
@ -49,7 +49,7 @@ fi
|
|||
echo "Building libs..."
|
||||
mkdir -pv bin/lib
|
||||
for lib in $(find ./src/lib -name "*.cpp"); do
|
||||
COMPILE_COMMAND="$CXX_WITH_FLAGS -I dependencies/tiny-utf8-4.4.3/include -fPIC -shared -o $(sed -e 's/^.\/src/.\/bin/;s/cpp$/so/' <<< $lib) $lib"
|
||||
COMPILE_COMMAND="$CXX_WITH_FLAGS -I ./include -fPIC -shared -o $(sed -e 's/^.\/src/.\/bin/;s/cpp$/so/' <<< $lib) $lib"
|
||||
echo $COMPILE_COMMAND
|
||||
$COMPILE_COMMAND &
|
||||
$WAIT_ANYWAY
|
||||
|
@ -72,8 +72,8 @@ echo "Building tools..."
|
|||
mkdir -pv bin/tools
|
||||
# add compile commands to this array
|
||||
COMPILE_COMMANDS=(
|
||||
"$CXX_WITH_FLAGS src/tools/dumpnbt.cpp -I dependencies/tiny-utf8-4.4.3/include -Lbin/lib -l:nbt.so -l:javacompat.so -o bin/tools/dumpnbt"
|
||||
"$CXX_WITH_FLAGS src/tools/hexnet.cpp -Lbin/lib -l:cli.so -l:libsockpp.so -Idependencies/sockpp-0.7.1/include -o bin/tools/hexnet"
|
||||
"$CXX_WITH_FLAGS src/tools/dumpnbt.cpp -I./include -Lbin/lib -l:nbt.so -l:javacompat.so -o bin/tools/dumpnbt"
|
||||
"$CXX_WITH_FLAGS src/tools/hexnet.cpp -I./include -Lbin/lib -l:cli.so -l:libsockpp.so -o bin/tools/hexnet"
|
||||
)
|
||||
for command in ${!COMPILE_COMMANDS[@]}; do
|
||||
echo "${COMPILE_COMMANDS[command]}"
|
||||
|
|
|
@ -16,14 +16,20 @@
|
|||
# If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
|
||||
rm -rv ./bin
|
||||
rm -rv ./include
|
||||
rm -vf .endianness
|
||||
rm -vf resources/check_endianness
|
||||
mkdir -v ./bin
|
||||
mkdir -v ./bin/lib
|
||||
mkdir -v ./include
|
||||
|
||||
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so bin/lib/
|
||||
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so.0 bin/lib/
|
||||
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so.0.7.1 bin/lib/
|
||||
|
||||
ln -vs ../dependencies/sockpp-0.7.1/include/sockpp/ ./include/
|
||||
ln -vs ../dependencies/tiny-utf8-4.4.3/include/tinyutf8/ ./include/
|
||||
|
||||
set -v
|
||||
echo -n "" > ./bin/.placeholder
|
||||
echo -n "" > ./include/.placeholder
|
||||
|
|
|
@ -37,9 +37,9 @@ echo "Building tests..."
|
|||
|
||||
# add compile commands to this array
|
||||
COMPILE_COMMANDS=(
|
||||
"$CXX_WITH_FLAGS src/test/nbt_helpers.cpp -Idependencies/tiny-utf8-4.4.3/include -Lbin/lib -l:nbt.so -l:javacompat.so -o bin/test/nbt_helpers"
|
||||
"$CXX_WITH_FLAGS src/test/nbt_helpers.cpp -I./include -Lbin/lib -l:nbt.so -l:javacompat.so -o bin/test/nbt_helpers"
|
||||
"$CXX_WITH_FLAGS src/test/cli_argument_parser.cpp -Lbin/lib -l:cli.so -o bin/test/cli_argument_parser"
|
||||
"$CXX_WITH_FLAGS src/test/javacompat.cpp -Idependencies/tiny-utf8-4.4.3/include -Lbin/lib -l:javacompat.so -o bin/test/javacompat"
|
||||
"$CXX_WITH_FLAGS src/test/javacompat.cpp -I./include -Lbin/lib -l:javacompat.so -o bin/test/javacompat"
|
||||
)
|
||||
for command in ${!COMPILE_COMMANDS[@]}; do
|
||||
echo "${COMPILE_COMMANDS[command]}"
|
||||
|
|
Loading…
Reference in New Issue