Skip to content

Commit

Permalink
fix: rewrite so that protobuf genereration can be skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelger committed Oct 1, 2024
1 parent 42ce737 commit 2412235
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bundle/src/assembly/resources/fed/ns3/ns3_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ get_arguments() {
-d|--no-deploy)
arg_deploy=false
;;
-p|--gen-protobuf)
arg_regen_protobuf=true
-p|--skip-gen-protobuf)
arg_regen_protobuf=false
;;
-f|--federate)
arg_federate_file="$2"
Expand Down Expand Up @@ -376,18 +376,18 @@ build_ns3()
cd ${current_dir}/federate
mv src/ClientServerChannel.h .
mv src/ClientServerChannel.cc .
if [ -f src/ClientServerChannelMessages.pb.h ]; then
rm src/ClientServerChannelMessages.pb.h
fi
if [ -f src/ClientServerChannelMessages.pb.cc ]; then
rm src/ClientServerChannelMessages.pb.cc
fi

# adjust build instruction to cover scrambled files
sed -i -e "s|/usr/local|.|" premake5.lua
sed -i -e "s|\"/usr/include\"|\"../ns-allinone-${ns3_version}/ns-${ns3_version}/build/include\"|" premake5.lua
sed -i -e "s|\"/usr/lib\"|\"../ns-allinone-${ns3_version}/ns-${ns3_version}/build/lib\"|" premake5.lua
if [ "${arg_regen_protobuf}" == "true" ]; then
if [ -f src/ClientServerChannelMessages.pb.h ]; then
rm src/ClientServerChannelMessages.pb.h
fi
if [ -f src/ClientServerChannelMessages.pb.cc ]; then
rm src/ClientServerChannelMessages.pb.cc
fi
./premake5 gmake --generate-protobuf --install
else
./premake5 gmake --install
Expand Down

0 comments on commit 2412235

Please sign in to comment.