Skip to content

Commit 0af6b7c

Browse files
committed
Merge branch 'release-0615' into HEAD
1 parent a08ecc7 commit 0af6b7c

File tree

1,141 files changed

+88624
-84533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,141 files changed

+88624
-84533
lines changed

BuildLinux_clang.sh

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
#!/bin/bash
2+
3+
export ROOT=$(dirname $(readlink -f ${0}))
4+
5+
# 读取环境变量 MY_DIR
6+
DPS_PATH=${DEPS_ENV_DIR}
7+
8+
# 检查目录是否存在
9+
if [ -d "${DPS_PATH}" ]; then
10+
echo "Directory ${DPS_PATH} exists."
11+
else
12+
echo "Directory ${DPS_PATH} does not exist."
13+
DPS_PATH=${PWD}/deps/build/destdir
14+
fi
15+
16+
set -e # exit on first error
17+
18+
function check_available_memory_and_disk() {
19+
FREE_MEM_GB=$(free -g -t | grep 'Mem' | rev | cut -d" " -f1 | rev)
20+
MIN_MEM_GB=10
21+
22+
FREE_DISK_KB=$(df -k . | tail -1 | awk '{print $4}')
23+
MIN_DISK_KB=$((10 * 1024 * 1024))
24+
25+
if [ ${FREE_MEM_GB} -le ${MIN_MEM_GB} ]; then
26+
echo -e "\nERROR: Orca Slicer Builder requires at least ${MIN_MEM_GB}G of 'available' mem (systen has only ${FREE_MEM_GB}G available)"
27+
echo && free -h && echo
28+
exit 2
29+
fi
30+
31+
if [[ ${FREE_DISK_KB} -le ${MIN_DISK_KB} ]]; then
32+
echo -e "\nERROR: Orca Slicer Builder requires at least $(echo ${MIN_DISK_KB} |awk '{ printf "%.1fG\n", $1/1024/1024; }') (systen has only $(echo ${FREE_DISK_KB} | awk '{ printf "%.1fG\n", $1/1024/1024; }') disk free)"
33+
echo && df -h . && echo
34+
exit 1
35+
fi
36+
}
37+
38+
function usage() {
39+
echo "Usage: ./BuildLinux.sh [-1][-b][-c][-d][-i][-r][-s][-u]"
40+
echo " -1: limit builds to 1 core (where possible)"
41+
echo " -b: build in debug mode"
42+
echo " -c: force a clean build"
43+
echo " -d: build deps (optional)"
44+
echo " -h: this help output"
45+
echo " -i: Generate appimage (optional)"
46+
echo " -r: skip ram and disk checks (low ram compiling)"
47+
echo " -s: build orca-slicer (optional)"
48+
echo " -u: update and build dependencies (optional and need sudo)"
49+
echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
50+
echo " and then './BuildLinux.sh -dsi'"
51+
}
52+
53+
unset name
54+
while getopts ":1bcdghirsu" opt; do
55+
case ${opt} in
56+
1 )
57+
export CMAKE_BUILD_PARALLEL_LEVEL=1
58+
;;
59+
b )
60+
BUILD_DEBUG="1"
61+
;;
62+
c )
63+
CLEAN_BUILD=1
64+
;;
65+
d )
66+
BUILD_DEPS="1"
67+
;;
68+
h ) usage
69+
exit 0
70+
;;
71+
i )
72+
BUILD_IMAGE="1"
73+
;;
74+
r )
75+
SKIP_RAM_CHECK="1"
76+
;;
77+
s )
78+
BUILD_ORCA="1"
79+
;;
80+
u )
81+
UPDATE_LIB="1"
82+
;;
83+
esac
84+
done
85+
86+
if [ ${OPTIND} -eq 1 ]
87+
then
88+
usage
89+
exit 0
90+
fi
91+
92+
DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release)
93+
# treat ubuntu as debian
94+
if [ "${DISTRIBUTION}" == "ubuntu" ]
95+
then
96+
DISTRIBUTION="debian"
97+
fi
98+
if [ ! -f ./linux.d/${DISTRIBUTION} ]
99+
then
100+
echo "Your distribution does not appear to be currently supported by these build scripts"
101+
exit 1
102+
fi
103+
source ./linux.d/${DISTRIBUTION}
104+
105+
echo "FOUND_GTK3=${FOUND_GTK3}"
106+
if [[ -z "${FOUND_GTK3_DEV}" ]]
107+
then
108+
echo "Error, you must install the dependencies before."
109+
echo "Use option -u with sudo"
110+
exit 1
111+
fi
112+
113+
echo "Changing date in version..."
114+
{
115+
# change date in version
116+
sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
117+
}
118+
echo "done"
119+
120+
121+
if ! [[ -n "${SKIP_RAM_CHECK}" ]]
122+
then
123+
check_available_memory_and_disk
124+
fi
125+
126+
if [[ -n "${BUILD_DEPS}" ]]
127+
then
128+
echo "Configuring dependencies..."
129+
BUILD_ARGS="-DDEP_WX_GTK3=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
130+
if [[ -n "${CLEAN_BUILD}" ]]
131+
then
132+
rm -fr deps/build
133+
fi
134+
if [ ! -d "deps/build" ]
135+
then
136+
mkdir deps/build
137+
fi
138+
if [[ -n "${BUILD_DEBUG}" ]]
139+
then
140+
# have to build deps with debug & release or the cmake won't find everything it needs
141+
mkdir deps/build/release
142+
cmake -S deps -B deps/build/release -G Ninja -DDESTDIR="${DPS_PATH}" ${BUILD_ARGS}
143+
cmake --build deps/build/release
144+
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug"
145+
fi
146+
147+
echo "cmake -S deps -B deps/build -G Ninja ${BUILD_ARGS}"
148+
cmake -S deps -B deps/build -G Ninja -DDESTDIR="${DPS_PATH}" ${BUILD_ARGS}
149+
cmake --build deps/build
150+
fi
151+
152+
153+
if [[ -n "${BUILD_ORCA}" ]]
154+
then
155+
echo "Configuring CrealityPrint..."
156+
if [[ -n "${CLEAN_BUILD}" ]]
157+
then
158+
rm -fr build
159+
fi
160+
BUILD_ARGS=""
161+
if [[ -n "${FOUND_GTK3_DEV}" ]]
162+
then
163+
BUILD_ARGS="-DSLIC3R_GTK=3 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
164+
fi
165+
if [[ -n "${BUILD_DEBUG}" ]]
166+
then
167+
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug -DBBL_INTERNAL_TESTING=1"
168+
else
169+
BUILD_ARGS="${BUILD_ARGS} -DBBL_RELEASE_TO_PUBLIC=1 -DBBL_INTERNAL_TESTING=0 -DUPDATE_ONLINE_MACHINES=1"
170+
fi
171+
echo -e "cmake -S . -B build -G Ninja -DCMAKE_PREFIX_PATH="${DPS_PATH}/usr/local" -DSLIC3R_STATIC=1 ${BUILD_ARGS}"
172+
cmake -S . -B build -G Ninja \
173+
-DCMAKE_PREFIX_PATH="${DPS_PATH}/usr/local" \
174+
-DSLIC3R_STATIC=1 \
175+
-DORCA_TOOLS=ON \
176+
-DGENERATE_ORCA_HEADER=0 \
177+
-DENABLE_BREAKPAD=ON \
178+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
179+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
180+
${BUILD_ARGS}
181+
echo "done"
182+
echo "Building CrealityPrint ..."
183+
cmake --build build --target CrealityPrint
184+
echo "Building CrealityPrint_profile_validator .."
185+
cmake --build build --target CrealityPrint_profile_validator
186+
./run_gettext.sh
187+
echo "done"
188+
fi
189+
190+
if [[ -e ${ROOT}/build/src/BuildLinuxImage.sh ]]; then
191+
# Give proper permissions to script
192+
chmod 755 ${ROOT}/build/src/BuildLinuxImage.sh
193+
194+
echo "[9/9] Generating Linux app..."
195+
pushd build
196+
if [[ -n "${BUILD_IMAGE}" ]]
197+
then
198+
${ROOT}/build/src/BuildLinuxImage.sh -i
199+
else
200+
${ROOT}/build/src/BuildLinuxImage.sh
201+
fi
202+
popd
203+
echo "done"
204+
fi

build_release_vs2022.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ cd %WP%
5656
mkdir %build_dir%
5757
cd %build_dir%
5858

59-
echo cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DENABLE_BREAKPAD=ON
60-
cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0" -DENABLE_BREAKPAD=ON
59+
echo cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type%
60+
cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0"
6161
cmake --build . --config %build_type% --target ALL_BUILD -- -m
6262
cd ..
6363
call run_gettext.bat

0 commit comments

Comments
 (0)