Files
coven/modules/PhysX/physx/physx-sys/make-sources.sh
Daniel Bross 84350b85ab Cramming PhysX in there
More PhysX work

More PhysX work
2025-07-10 01:10:22 +02:00

20 lines
521 B
Bash

#!/bin/bash
set -e
# This script finds all of the cpp files in a <directory> and generates a rust
# array of strings into physx-sys/sources/<name> that is used by the build script
# to compile all of the source files when compiling physx-sys
#
# usage: make-sources.sh <physx c++ source directory path> <name>
dir=$1
file="$(dirname "$0")/sources/$2"
printf "[\n" > "$file"
for entry in "$dir"/*.cpp
do
printf " \"%s\",\n" "$(echo "$entry" | sed -r "s/.+\/(.+)\..+/\1/")" >> "$file"
done
printf "]\n" >> "$file"