mirror of
https://github.com/Ed94/VEFontCache-Odin.git
synced 2025-08-06 06:52:44 -07:00
worflow: nproc doesn't exist on mac
This commit is contained in:
7
.github/workflows/macos_build.yaml
vendored
7
.github/workflows/macos_build.yaml
vendored
@@ -34,13 +34,6 @@ jobs:
|
|||||||
brew install bash
|
brew install bash
|
||||||
echo "Bash version: $(bash --version)"
|
echo "Bash version: $(bash --version)"
|
||||||
|
|
||||||
if command -v nproc &> /dev/null; then
|
|
||||||
echo "nproc is installed. Number of processors: $(nproc)"
|
|
||||||
else
|
|
||||||
echo "Error: nproc installation failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Run build script
|
- name: Run build script
|
||||||
run: |
|
run: |
|
||||||
if [ -f "./scripts/build_sokol_demo.sh" ]; then
|
if [ -f "./scripts/build_sokol_demo.sh" ]; then
|
||||||
|
@@ -19,8 +19,26 @@ if [ -f "$path_system_details" ]; then
|
|||||||
CoreCount_Physical=$(grep "PhysicalCores" "$path_system_details" | cut -d'=' -f2)
|
CoreCount_Physical=$(grep "PhysicalCores" "$path_system_details" | cut -d'=' -f2)
|
||||||
CoreCount_Logical=$(grep "LogicalCores" "$path_system_details" | cut -d'=' -f2)
|
CoreCount_Logical=$(grep "LogicalCores" "$path_system_details" | cut -d'=' -f2)
|
||||||
else
|
else
|
||||||
CoreCount_Physical=$(nproc --all)
|
# Detect the operating system
|
||||||
CoreCount_Logical=$(nproc)
|
OS=$(uname -s)
|
||||||
|
|
||||||
|
case "$OS" in
|
||||||
|
Darwin*)
|
||||||
|
# macOS-specific commands
|
||||||
|
CoreCount_Physical=$(sysctl -n hw.physicalcpu)
|
||||||
|
CoreCount_Logical=$(sysctl -n hw.logicalcpu)
|
||||||
|
;;
|
||||||
|
Linux*)
|
||||||
|
# Linux-specific commands
|
||||||
|
CoreCount_Physical=$(nproc --all)
|
||||||
|
CoreCount_Logical=$(nproc)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported operating system: $OS"
|
||||||
|
CoreCount_Physical=1
|
||||||
|
CoreCount_Logical=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
echo "[CPU]" > "$path_system_details"
|
echo "[CPU]" > "$path_system_details"
|
||||||
echo "PhysicalCores=$CoreCount_Physical" >> "$path_system_details"
|
echo "PhysicalCores=$CoreCount_Physical" >> "$path_system_details"
|
||||||
|
Reference in New Issue
Block a user