Skip to content

Commit

Permalink
script/build: Update logic for copying built files -- and now directo…
Browse files Browse the repository at this point in the history
…ries -- to bin folder
  • Loading branch information
stephengtuggy committed Apr 29, 2024
1 parent 34a199c commit c340733
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ cmake $@ "${SRC_DIR}"

MAX_THREADS_TO_BUILD_WITH=8
NUM_THREADS_TO_BUILD_WITH=$(getconf _NPROCESSORS_ONLN)
if [ ${NUM_THREADS_TO_BUILD_WITH} -gt ${MAX_THREADS_TO_BUILD_WITH} ]
if [ "${NUM_THREADS_TO_BUILD_WITH}" -gt ${MAX_THREADS_TO_BUILD_WITH} ]
then
NUM_THREADS_TO_BUILD_WITH=${MAX_THREADS_TO_BUILD_WITH}
fi
Expand All @@ -76,4 +76,21 @@ cd "${ROOT_DIR}"

mkdir -pv "${BIN_DIR}"

cp -v "${BUILD_DIR}"/{vegastrike-engine,setup/vegasettings,objconv/vega-meshtool} "${BIN_DIR}"
declare -a files_to_copy_if_they_exist=("${BUILD_DIR}/vegastrike-engine" "${BUILD_DIR}/setup/vegasettings" "${BUILD_DIR}/objconv/vega-meshtool")
declare -a directories_to_copy_if_they_exist=("${BUILD_DIR}/vegastrike-engine.app")

for i in "${files_to_copy_if_they_exist[@]}"
do
if [ -f "$i" ]
then
cp -v "$i" "${BIN_DIR}"/
fi
done

for i in "${directories_to_copy_if_they_exist[@]}"
do
if [ -d "$i" ]
then
cp -v "$i" "${BIN_DIR}"/
fi
done

0 comments on commit c340733

Please sign in to comment.