mirror of
https://github.com/LNH-team/dspico-firmware.git
synced 2026-06-02 01:06:52 +02:00
Merge pull request #2 from PoroCYon/develop
Fix compatibility issues in compile.sh
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@
|
|||||||
Debug/
|
Debug/
|
||||||
Release/
|
Release/
|
||||||
build/
|
build/
|
||||||
|
cmake-build*/
|
||||||
out/
|
out/
|
||||||
|
|
||||||
# Compiled source #
|
# Compiled source #
|
||||||
|
|||||||
33
compile.sh
Normal file → Executable file
33
compile.sh
Normal file → Executable file
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
###############################################################
|
###############################################################
|
||||||
# File: compile.sh
|
# File: compile.sh
|
||||||
# Creation Date: 10/11/2022 (DD/MM/YYYY)
|
# Creation Date: 10/11/2022 (DD/MM/YYYY)
|
||||||
@@ -9,26 +9,41 @@
|
|||||||
# Copyright: LNH team (c) 2022, all rights reserved
|
# Copyright: LNH team (c) 2022, all rights reserved
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if command -v nproc >/dev/null 2>&1; then
|
||||||
|
NPROC="$(nproc)"
|
||||||
|
else
|
||||||
|
# macOS doesn't have nproc(1). using getconf here is also more general than
|
||||||
|
# using sysctl
|
||||||
|
NPROC="$(getconf _NPROCESSORS_ONLN)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# change directory to the one containing the source code project
|
||||||
|
cd "$(dirname "$(realpath "$0")")"
|
||||||
|
|
||||||
|
# check available CMake version
|
||||||
echo "[>] Configuring project with CMake.."
|
echo "[>] Configuring project with CMake.."
|
||||||
|
|
||||||
# Clean previous build/ folders if they exist
|
# Clean previous build/ folders if they exist
|
||||||
rm -rf build/
|
rm -rf build/ || true
|
||||||
mkdir build
|
mkdir -p build
|
||||||
|
|
||||||
# Export the SDK Path before running CMAKE
|
|
||||||
export PICO_SDK_PATH=../pico-sdk
|
|
||||||
|
|
||||||
# Specify CMAKE where we want the build tree to be at.
|
# Specify CMAKE where we want the build tree to be at.
|
||||||
# In our case, the build/ directory.
|
# In our case, the build/ directory.
|
||||||
# The source directory will be . (the current directory,
|
# The source directory will be . (the current directory,
|
||||||
# where the CMakeLists.txt is located).
|
# where the CMakeLists.txt is located).
|
||||||
cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -B build/ .
|
PICO_SDK_PATH=../pico-sdk \
|
||||||
|
CMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||||
|
cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
|
||||||
|
-B build/ .
|
||||||
|
|
||||||
echo "[>] Building FIRMWARE: "
|
echo "[>] Building FIRMWARE: "
|
||||||
|
|
||||||
# Go and build the firmware
|
# Go and build the firmware
|
||||||
cd build
|
PICO_SDK_PATH=../pico-sdk \
|
||||||
make
|
CMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||||
|
CMAKE_BUILD_PARALLEL_LEVEL="${NPROC}" \
|
||||||
|
cmake --build build
|
||||||
|
|
||||||
echo "[>] Build completed. Find the DSpico.uf2 file inside build/ folder"
|
echo "[>] Build completed. Find the DSpico.uf2 file inside build/ folder"
|
||||||
|
|||||||
Reference in New Issue
Block a user