Skip to content

Commit

Permalink
Merge pull request #3 from secondlife/macos-target
Browse files Browse the repository at this point in the history
Use LL_BUILD_RELEASE for macOS and Linux as well as Windows.
  • Loading branch information
nat-goodspeed authored Feb 12, 2024
2 parents 13065ac + 9c7d705 commit 49c1f8e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches: [main]
tags: ["v*.*.*"]
tags: ["v*.*"]

jobs:
build:
Expand Down
33 changes: 14 additions & 19 deletions build-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"

# remove_cxxstd
source "$(dirname "$AUTOBUILD_VARIABLES_FILE")/functions"

LUAU_VERSION="0.609"
build=${AUTOBUILD_BUILD_ID:=0}

Expand All @@ -41,15 +44,18 @@ pushd "$top/luau"
cp -v luacode.h "$stage/include/luau/"
popd

# Don't litter the source directory with build artifacts
mkdir -p ../build
cd ../build
case "$AUTOBUILD_PLATFORM" in
windows*)
set -o igncr
opts="$LL_BUILD_RELEASE /EHsc"
cmake -G "$AUTOBUILD_WIN_CMAKE_GEN" -A "$AUTOBUILD_WIN_VSPLATFORM" \
-DCMAKE_INSTALL_PREFIX="$(cygpath -m "$stage")" \
-DCMAKE_C_FLAGS="$opts" \
-DCMAKE_C_FLAGS="$(remove_cxxstd $opts)" \
-DCMAKE_CXX_FLAGS="$opts" \
.
../luau
cmake --build . -- /p:Configuration=Release
cmake --build . --target Luau.Repl.CLI -- /p:Configuration=Release

Expand All @@ -63,8 +69,11 @@ pushd "$top/luau"

cp -v Release/luau.exe "$stage/bin/"
;;
darwin*)
cmake . -DCMAKE_INSTALL_PREFIX:STRING="${stage}"
darwin*|linux64*)
cmake -DCMAKE_INSTALL_PREFIX:STRING="${stage}" \
-DCMAKE_CXX_FLAGS="$LL_BUILD_RELEASE" \
-DCMAKE_C_FLAGS="$(remove_cxxstd $LL_BUILD_RELEASE)" \
../luau
cmake --build . --target Luau.Repl.CLI

cp -v "libLuau.Ast.a" "$stage/lib/release"
Expand All @@ -73,23 +82,9 @@ pushd "$top/luau"
cp -v "libLuau.Config.a" "$stage/lib/release"
cp -v "libLuau.VM.a" "$stage/lib/release"
;;
linux64)
# Don't litter the source directory with build artifacts
mkdir -p ../build
pushd ../build
cmake ../luau -DCMAKE_INSTALL_PREFIX:STRING="${stage}"
cmake --build . --target Luau.Repl.CLI

cp -v "libLuau.Ast.a" "$stage/lib/release"
cp -v "libLuau.CodeGen.a" "$stage/lib/release"
cp -v "libLuau.Compiler.a" "$stage/lib/release"
cp -v "libLuau.Config.a" "$stage/lib/release"
cp -v "libLuau.VM.a" "$stage/lib/release"
popd
;;
esac
popd

echo "$LUAU_VERSION.$build" > "$stage/VERSION.txt"
echo "$LUAU_VERSION-$build" > "$stage/VERSION.txt"
mkdir -p "$stage/LICENSES"
cp "$top/LICENSE" "$stage/LICENSES/luau.txt"

0 comments on commit 49c1f8e

Please sign in to comment.