Build system: add a central directory to collect all the include files

BodgeMaster-unfinished
BodgeMaster 2022-07-20 12:01:05 +02:00
parent 2cc2543b2a
commit 1804433a9f
5 changed files with 14 additions and 5 deletions

3
.gitignore vendored
View File

@ -4,6 +4,9 @@
/dependencies/* /dependencies/*
!/dependencies/.placeholder !/dependencies/.placeholder
/include/*
!/include/.placeholder
.localenv.bashrc .localenv.bashrc
# ignore endianness check # ignore endianness check

0
include/.placeholder Normal file
View File

View File

@ -49,7 +49,7 @@ fi
echo "Building libs..." echo "Building libs..."
mkdir -pv bin/lib mkdir -pv bin/lib
for lib in $(find ./src/lib -name "*.cpp"); do 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 echo $COMPILE_COMMAND
$COMPILE_COMMAND & $COMPILE_COMMAND &
$WAIT_ANYWAY $WAIT_ANYWAY
@ -72,8 +72,8 @@ echo "Building tools..."
mkdir -pv bin/tools mkdir -pv bin/tools
# add compile commands to this array # add compile commands to this array
COMPILE_COMMANDS=( 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/dumpnbt.cpp -I./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/hexnet.cpp -I./include -Lbin/lib -l:cli.so -l:libsockpp.so -o bin/tools/hexnet"
) )
for command in ${!COMPILE_COMMANDS[@]}; do for command in ${!COMPILE_COMMANDS[@]}; do
echo "${COMPILE_COMMANDS[command]}" echo "${COMPILE_COMMANDS[command]}"

View File

@ -16,14 +16,20 @@
# If not, see https://www.gnu.org/licenses/agpl-3.0.en.html # If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
rm -rv ./bin rm -rv ./bin
rm -rv ./include
rm -vf .endianness rm -vf .endianness
rm -vf resources/check_endianness rm -vf resources/check_endianness
mkdir -v ./bin mkdir -v ./bin
mkdir -v ./bin/lib 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 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 bin/lib/
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so.0.7.1 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 set -v
echo -n "" > ./bin/.placeholder echo -n "" > ./bin/.placeholder
echo -n "" > ./include/.placeholder

View File

@ -37,9 +37,9 @@ echo "Building tests..."
# add compile commands to this array # add compile commands to this array
COMPILE_COMMANDS=( 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/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 for command in ${!COMPILE_COMMANDS[@]}; do
echo "${COMPILE_COMMANDS[command]}" echo "${COMPILE_COMMANDS[command]}"