Do clang checks on Mac
This commit is contained in:
parent
75c4f6f94d
commit
1cc8778982
|
@ -1,7 +1,7 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
:: The following code simply checks that you have a compatible version of Clang.
|
:: The following code checks if you have the necessary programs to compile the samples.
|
||||||
:: This code exists to improve the experience of first-time Orca users and can
|
:: This code exists to improve the experience of first-time Orca users and can
|
||||||
:: be safely deleted in your own projects if you wish.
|
:: be safely deleted in your own projects if you wish.
|
||||||
if exist "..\..\scripts\sample_build_check.py" (
|
if exist "..\..\scripts\sample_build_check.py" (
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [[ -x /usr/local/opt/llvm/bin/clang ]]; then
|
# The following code checks if you have the necessary programs to compile the samples.
|
||||||
CLANG=/usr/local/opt/llvm/bin/clang
|
# This code exists to improve the experience of first-time Orca users and can
|
||||||
elif [[ -x /opt/homebrew/opt/llvm/bin/clang ]]; then
|
# be safely deleted in your own projects if you wish.
|
||||||
CLANG=/opt/homebrew/opt/llvm/bin/clang
|
if [ -f ../../scripts/sample_build_check.py ]; then
|
||||||
|
python3 ../../scripts/sample_build_check.py
|
||||||
else
|
else
|
||||||
echo "Could not find Homebrew clang; this script will probably not work."
|
echo "Could not check if you have the necessary tools to build the Orca samples."
|
||||||
CLANG=clang
|
echo "If you have copied this script to your own project, you can delete this code."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ORCA_DIR=../..
|
ORCA_DIR=../..
|
||||||
|
@ -25,6 +26,6 @@ wasmFlags="--target=wasm32 \
|
||||||
-I $ORCA_DIR/src \
|
-I $ORCA_DIR/src \
|
||||||
-I $ORCA_DIR/src/ext"
|
-I $ORCA_DIR/src/ext"
|
||||||
|
|
||||||
$CLANG $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
clang $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
||||||
|
|
||||||
orca bundle --orca-dir $ORCA_DIR --name Breakout --icon icon.png --resource-dir data module.wasm
|
orca bundle --orca-dir $ORCA_DIR --name Breakout --icon icon.png --resource-dir data module.wasm
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
:: The following code simply checks that you have a compatible version of Clang.
|
:: The following code checks if you have the necessary programs to compile the samples.
|
||||||
:: This code exists to improve the experience of first-time Orca users and can
|
:: This code exists to improve the experience of first-time Orca users and can
|
||||||
:: be safely deleted in your own projects if you wish.
|
:: be safely deleted in your own projects if you wish.
|
||||||
if exist "..\..\scripts\sample_build_check.py" (
|
if exist "..\..\scripts\sample_build_check.py" (
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [[ -x /usr/local/opt/llvm/bin/clang ]]; then
|
# The following code checks if you have the necessary programs to compile the samples.
|
||||||
CLANG=/usr/local/opt/llvm/bin/clang
|
# This code exists to improve the experience of first-time Orca users and can
|
||||||
elif [[ -x /opt/homebrew/opt/llvm/bin/clang ]]; then
|
# be safely deleted in your own projects if you wish.
|
||||||
CLANG=/opt/homebrew/opt/llvm/bin/clang
|
if [ -f ../../scripts/sample_build_check.py ]; then
|
||||||
|
python3 ../../scripts/sample_build_check.py
|
||||||
else
|
else
|
||||||
echo "Could not find Homebrew clang; this script will probably not work."
|
echo "Could not check if you have the necessary tools to build the Orca samples."
|
||||||
CLANG=clang
|
echo "If you have copied this script to your own project, you can delete this code."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ORCA_DIR=../..
|
ORCA_DIR=../..
|
||||||
|
@ -25,6 +26,6 @@ wasmFlags="--target=wasm32 \
|
||||||
-I $ORCA_DIR/src \
|
-I $ORCA_DIR/src \
|
||||||
-I $ORCA_DIR/src/ext"
|
-I $ORCA_DIR/src/ext"
|
||||||
|
|
||||||
$CLANG $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
clang $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
||||||
|
|
||||||
orca bundle --orca-dir $ORCA_DIR --name Clock --icon icon.png --resource-dir data module.wasm
|
orca bundle --orca-dir $ORCA_DIR --name Clock --icon icon.png --resource-dir data module.wasm
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
:: The following code simply checks that you have a compatible version of Clang.
|
:: The following code checks if you have the necessary programs to compile the samples.
|
||||||
:: This code exists to improve the experience of first-time Orca users and can
|
:: This code exists to improve the experience of first-time Orca users and can
|
||||||
:: be safely deleted in your own projects if you wish.
|
:: be safely deleted in your own projects if you wish.
|
||||||
if exist "..\..\scripts\sample_build_check.py" (
|
if exist "..\..\scripts\sample_build_check.py" (
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [[ -x /usr/local/opt/llvm/bin/clang ]]; then
|
# The following code checks if you have the necessary programs to compile the samples.
|
||||||
CLANG=/usr/local/opt/llvm/bin/clang
|
# This code exists to improve the experience of first-time Orca users and can
|
||||||
elif [[ -x /opt/homebrew/opt/llvm/bin/clang ]]; then
|
# be safely deleted in your own projects if you wish.
|
||||||
CLANG=/opt/homebrew/opt/llvm/bin/clang
|
if [ -f ../../scripts/sample_build_check.py ]; then
|
||||||
|
python3 ../../scripts/sample_build_check.py
|
||||||
else
|
else
|
||||||
echo "Could not find Homebrew clang; this script will probably not work."
|
echo "Could not check if you have the necessary tools to build the Orca samples."
|
||||||
CLANG=clang
|
echo "If you have copied this script to your own project, you can delete this code."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ORCA_DIR=../..
|
ORCA_DIR=../..
|
||||||
|
@ -27,6 +28,6 @@ wasmFlags="--target=wasm32 \
|
||||||
-I $ORCA_DIR/src \
|
-I $ORCA_DIR/src \
|
||||||
-I $ORCA_DIR/src/ext"
|
-I $ORCA_DIR/src/ext"
|
||||||
|
|
||||||
$CLANG $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
clang $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
||||||
|
|
||||||
orca bundle --orca-dir $ORCA_DIR --name Fluid --icon icon.png module.wasm
|
orca bundle --orca-dir $ORCA_DIR --name Fluid --icon icon.png module.wasm
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
:: The following code simply checks that you have a compatible version of Clang.
|
:: The following code checks if you have the necessary programs to compile the samples.
|
||||||
:: This code exists to improve the experience of first-time Orca users and can
|
:: This code exists to improve the experience of first-time Orca users and can
|
||||||
:: be safely deleted in your own projects if you wish.
|
:: be safely deleted in your own projects if you wish.
|
||||||
if exist "..\..\scripts\sample_build_check.py" (
|
if exist "..\..\scripts\sample_build_check.py" (
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [[ -x /usr/local/opt/llvm/bin/clang ]]; then
|
# The following code checks if you have the necessary programs to compile the samples.
|
||||||
CLANG=/usr/local/opt/llvm/bin/clang
|
# This code exists to improve the experience of first-time Orca users and can
|
||||||
elif [[ -x /opt/homebrew/opt/llvm/bin/clang ]]; then
|
# be safely deleted in your own projects if you wish.
|
||||||
CLANG=/opt/homebrew/opt/llvm/bin/clang
|
if [ -f ../../scripts/sample_build_check.py ]; then
|
||||||
|
python3 ../../scripts/sample_build_check.py
|
||||||
else
|
else
|
||||||
echo "Could not find Homebrew clang; this script will probably not work."
|
echo "Could not check if you have the necessary tools to build the Orca samples."
|
||||||
CLANG=clang
|
echo "If you have copied this script to your own project, you can delete this code."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ORCA_DIR=../..
|
ORCA_DIR=../..
|
||||||
|
@ -25,6 +26,6 @@ wasmFlags="--target=wasm32 \
|
||||||
-I $ORCA_DIR/src \
|
-I $ORCA_DIR/src \
|
||||||
-I $ORCA_DIR/src/ext"
|
-I $ORCA_DIR/src/ext"
|
||||||
|
|
||||||
$CLANG $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
clang $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
||||||
|
|
||||||
orca bundle --orca-dir $ORCA_DIR --name Triangle module.wasm
|
orca bundle --orca-dir $ORCA_DIR --name Triangle module.wasm
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
:: The following code simply checks that you have a compatible version of Clang.
|
:: The following code checks if you have the necessary programs to compile the samples.
|
||||||
:: This code exists to improve the experience of first-time Orca users and can
|
:: This code exists to improve the experience of first-time Orca users and can
|
||||||
:: be safely deleted in your own projects if you wish.
|
:: be safely deleted in your own projects if you wish.
|
||||||
if exist "..\..\scripts\sample_build_check.py" (
|
if exist "..\..\scripts\sample_build_check.py" (
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [[ -x /usr/local/opt/llvm/bin/clang ]]; then
|
# The following code checks if you have the necessary programs to compile the samples.
|
||||||
CLANG=/usr/local/opt/llvm/bin/clang
|
# This code exists to improve the experience of first-time Orca users and can
|
||||||
elif [[ -x /opt/homebrew/opt/llvm/bin/clang ]]; then
|
# be safely deleted in your own projects if you wish.
|
||||||
CLANG=/opt/homebrew/opt/llvm/bin/clang
|
if [ -f ../../scripts/sample_build_check.py ]; then
|
||||||
|
python3 ../../scripts/sample_build_check.py
|
||||||
else
|
else
|
||||||
echo "Could not find Homebrew clang; this script will probably not work."
|
echo "Could not check if you have the necessary tools to build the Orca samples."
|
||||||
CLANG=clang
|
echo "If you have copied this script to your own project, you can delete this code."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ORCA_DIR=../..
|
ORCA_DIR=../..
|
||||||
|
@ -25,6 +26,6 @@ wasmFlags="--target=wasm32 \
|
||||||
-I $ORCA_DIR/src \
|
-I $ORCA_DIR/src \
|
||||||
-I $ORCA_DIR/src/ext"
|
-I $ORCA_DIR/src/ext"
|
||||||
|
|
||||||
$CLANG $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
clang $wasmFlags -o ./module.wasm $ORCA_DIR/src/orca.c $STDLIB_DIR/src/*.c src/main.c
|
||||||
|
|
||||||
orca bundle --orca-dir $ORCA_DIR --name UI --resource-dir data module.wasm
|
orca bundle --orca-dir $ORCA_DIR --name UI --resource-dir data module.wasm
|
||||||
|
|
|
@ -13,7 +13,7 @@ def print_clang_install_info(upgrade):
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
printw(f"Please install Clang {CLANG_MAJOR}.{CLANG_MINOR} or newer. We recommend installing Clang via the Visual Studio installer. In the installer, search for \"C++ Clang Compiler\".")
|
printw(f"Please install Clang {CLANG_MAJOR}.{CLANG_MINOR} or newer. We recommend installing Clang via the Visual Studio installer. In the installer, search for \"C++ Clang Compiler\".")
|
||||||
elif platform.system() == "Darwin":
|
elif platform.system() == "Darwin":
|
||||||
printw(f"Please install Clang {CLANG_MAJOR}.{CLANG_MINOR} or newer. We recommend installing Clang via Homebrew:")
|
printw(f"Please install Clang {CLANG_MAJOR}.{CLANG_MINOR} or newer. We recommend installing Clang via Homebrew (https://brew.sh/):")
|
||||||
printw()
|
printw()
|
||||||
if upgrade:
|
if upgrade:
|
||||||
printw(" brew upgrade llvm")
|
printw(" brew upgrade llvm")
|
||||||
|
@ -43,6 +43,14 @@ except FileNotFoundError:
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
printw("WARNING: Could not check Clang version. You may encounter build errors.")
|
printw("WARNING: Could not check Clang version. You may encounter build errors.")
|
||||||
|
|
||||||
|
try:
|
||||||
|
subprocess.run(["wasm-ld", "--version"], capture_output=True, check=True)
|
||||||
|
except FileNotFoundError:
|
||||||
|
printw("ERROR: wasm-ld was not found on your system. This is a component of Clang that is required in order to produce WebAssembly modules. This likely means that an old or otherwise incompatible version of Clang is being used, such as Apple's version of Clang.")
|
||||||
|
printw()
|
||||||
|
print_clang_install_info(False)
|
||||||
|
exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.run(["orca", "version"], capture_output=True, shell=True, check=True)
|
subprocess.run(["orca", "version"], capture_output=True, shell=True, check=True)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
|
|
Loading…
Reference in New Issue