Repository navigation
Expand file tree
/
Copy pathbuild-cmd.sh
More file actions
executable file
·133 lines (112 loc) · 5.11 KB
/
Copy pathbuild-cmd.sh
File metadata and controls
executable file
·133 lines (112 loc) · 5.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/env bash
cd "$(dirname "$0")"
# turn on verbose debugging output for parabuild logs.
exec 4>&1; export BASH_XTRACEFD=4; set -x
# make errors fatal
set -e
# complain about unset env variables
set -u
if [ -z "$AUTOBUILD" ] ; then
exit 1
fi
if [ "$OSTYPE" = "cygwin" ] ; then
autobuild="$(cygpath -u $AUTOBUILD)"
else
autobuild="$AUTOBUILD"
fi
top="$(pwd)"
stage="$(pwd)/stage"
# load autobuild provided shell functions and variables
source_environment_tempfile="$stage/source_environment.sh"
"$autobuild" source_environment > "$source_environment_tempfile"
. "$source_environment_tempfile"
# remove_cxxstd
source "$(dirname "$AUTOBUILD_VARIABLES_FILE")/functions"
build=${AUTOBUILD_BUILD_ID:=0}
mkdir -p "$stage/include/luau"
mkdir -p "$stage/lib/release"
pushd "$top"
pushd "VM/include"
cp -v lua.h luaconf.h lualib.h llsl.h llruleset_builder.h "$stage/include/luau/"
popd
pushd "Compiler/include"
cp -v luacode.h "$stage/include/luau/"
popd
cp -rv "Common/include/Luau" "$stage/include/luau/"
# The executor's public headers, and what they include from other libraries
cp -v "Executor/include/Luau/Executor.h" "Executor/include/Luau/Script.h" "$stage/include/luau/Luau/"
cp -v "Bytecode/include/Luau/BytecodeHeader.h" "$stage/include/luau/Luau/"
cp -v "LSLBuiltins/include/Luau/LSLBuiltins.h" "$stage/include/luau/Luau/"
# Tailslide's headers, laid out for `#include <tailslide/...>`
cp -rv "Tailslide/tailslide" "$stage/include/tailslide"
find "$stage/include/tailslide" -type f ! -name '*.hh' -delete
# Don't litter the source directory with build artifacts
mkdir -p "$stage/build"
cd "$stage/build"
# 32-bit linux needs some different vars
case "$AUTOBUILD_PLATFORM" in
linux)
# These flags are all that are needed to successfully pass the conformance tests under -m32.
# 64-bit times are needed for the time tests, and SSE is needed so that x87 is not
# used for floating point math. SSE is the default under x64, so not a problem.
LL_BUILD_RELEASE="${LL_BUILD_RELEASE} -msse3 -mfpmath=sse -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
;;
esac
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="$(remove_cxxstd $opts)" \
-DCMAKE_CXX_FLAGS="$opts" \
"$top"
cmake --build . -- /p:Configuration=Release
cmake --build . --target Luau.Repl.CLI -- /p:Configuration=Release
mkdir -p "$stage/bin"
cp -v "Release/Luau.Ast.lib" "$stage/lib/release/"
cp -v "Release/Luau.Bytecode.lib" "$stage/lib/release/"
cp -v "Release/Luau.CodeGen.lib" "$stage/lib/release/"
cp -v "Release/Luau.Compiler.lib" "$stage/lib/release/"
cp -v "Release/Luau.Config.lib" "$stage/lib/release/"
cp -v "Release/Luau.VM.lib" "$stage/lib/release/"
cp -v "Release/Luau.Executor.lib" "$stage/lib/release/"
cp -v "Release/Luau.LSLBuiltins.lib" "$stage/lib/release/"
cp -v "Release/Luau.Common.lib" "$stage/lib/release/"
cp -v "Tailslide/Release/tailslide.lib" "$stage/lib/release/"
cp -v Release/slua.exe "$stage/bin/"
cp -v Release/slua-harness.exe "$stage/bin/"
;;
darwin*|linux*)
# Optimized builds use the inherited release flags as-is, any local
# adjustments to them belong inside this guard
if [[ -z "${SLUA_OPTIMIZED_BUILD:-}" ]]; then
# Continue compiling with asserts for now
LL_BUILD_RELEASE="$(remove_switch -DNDEBUG $LL_BUILD_RELEASE)"
fi
cmake -DCMAKE_INSTALL_PREFIX:STRING="${stage}" \
-DCMAKE_CXX_FLAGS="$LL_BUILD_RELEASE -m$AUTOBUILD_ADDRSIZE" \
-DCMAKE_C_FLAGS="$(remove_cxxstd $LL_BUILD_RELEASE) -m$AUTOBUILD_ADDRSIZE" \
"$top"
cmake --build . -- -j8
mkdir -p "$stage/bin"
cp -v "libLuau.Ast.a" "$stage/lib/release"
cp -v "libLuau.Bytecode.a" "$stage/lib/release"
cp -v "libLuau.CodeGen.a" "$stage/lib/release"
cp -v "libLuau.Common.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"
cp -v "libLuau.Executor.a" "$stage/lib/release"
cp -v "libLuau.LSLBuiltins.a" "$stage/lib/release"
cp -v "Tailslide/libtailslide.a" "$stage/lib/release"
cp -v "slua" "$stage/bin/"
cp -v "slua-harness" "$stage/bin/"
# Run the conformance test for good measure
"${stage}/build/Luau.Conformance"
;;
esac
popd
mkdir -p "$stage/LICENSES"
cp "$top/LICENSE.txt" "$stage/LICENSES/luau.txt"
cp "$top/Tailslide/LICENSE" "$stage/LICENSES/tailslide.txt"