File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1616declare -r TARGET=" ${1} "
1717
1818check_buildroot () {
19- if ! [[ -d $BUILDROOT ]]; then
20- echo " Please set the BUILDROOT environment variable"
19+ if [[ -n ${TOOLCHAIN:- } ]] && [[ -d $TOOLCHAIN ]]; then
20+ return
21+ elif ! [[ -d $BUILDROOT ]]; then
22+ echo " Please set the BUILDROOT or TOOLCHAIN environment variable"
2123 exit 1
2224 fi
25+ TOOLCHAIN=" ${BUILDROOT} /output/host/"
2326}
2427
2528make_buildroot () {
29+ if [[ -z ${BUILDROOT:- } ]]; then
30+ return
31+ fi
2632 cd " $BUILDROOT "
2733 local -a deps=(toolchain sdl sdl_image)
2834 if [[ " $TARGET " == retrofw ]]; then
@@ -42,7 +48,7 @@ build() {
4248 cmake .. \
4349 -DCMAKE_BUILD_TYPE=Release \
4450 -DTARGET_PLATFORM=" $TARGET " \
45- -DCMAKE_TOOLCHAIN_FILE=" $BUILDROOT /output/host /usr/share/buildroot/toolchainfile.cmake"
51+ -DCMAKE_TOOLCHAIN_FILE=" ${TOOLCHAIN} /usr/share/buildroot/toolchainfile.cmake"
4652 cmake --build . -j $( getconf _NPROCESSORS_ONLN)
4753 cd -
4854}
You can’t perform that action at this time.
0 commit comments