add multithreading ;)

BodgeMaster-unfinished
BodgeMaster 2022-06-24 12:36:15 +02:00
parent bb0dc05a30
commit 98490b3e50
1 changed files with 4 additions and 3 deletions

View File

@ -8,13 +8,14 @@ if [ -z "$CXXFLAGS" ]; then
fi fi
CXX_WITH_FLAGS="$CXX $CXXFLAGS" CXX_WITH_FLAGS="$CXX $CXXFLAGS"
# `.cpp` files in src/lib will be automatically picked up and compiled into dynamic libraries. # `.cpp` files in src/lib will be automatically picked up and compiled into
# dynamically linked libraries.
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 -shared -o $(sed -e 's/^.\/src/.\/bin/;s/cpp$/so/' <<< $lib) $lib" COMPILE_COMMAND="$CXX_WITH_FLAGS -shared -o $(sed -e 's/^.\/src/.\/bin/;s/cpp$/so/' <<< $lib) $lib"
echo $COMPILE_COMMAND echo $COMPILE_COMMAND
$COMPILE_COMMAND $COMPILE_COMMAND &
done done
@ -35,6 +36,6 @@ mkdir -pv bin/tools
# add compile commands to this variable # add compile commands to this variable
COMPILE_COMMANDS=" COMPILE_COMMANDS="
set -v set -v
$CXX_WITH_FLAGS src/tools/dumpnbt.cpp -Lbin/lib -lnbt -o bin/tools/dumpnbt $CXX_WITH_FLAGS src/tools/dumpnbt.cpp -Lbin/lib -lnbt -o bin/tools/dumpnbt &
" "
sh <<< $COMPILE_COMMANDS sh <<< $COMPILE_COMMANDS