Skip to content
Snippets Groups Projects
Commit a742d4af authored by Emilio Corigliano's avatar Emilio Corigliano
Browse files

[SBS] Updated cmake to test build a static library instead of an executable...

[SBS] Updated cmake to test build a static library instead of an executable and build also if build system finds clang++
parent 3fbe3475
Branches clang-support-dev
No related tags found
No related merge requests found
Pipeline #7901 failed
......@@ -19,6 +19,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# We want to test for building of static library and not an executable
# reference: https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
enable_language(C CXX ASM)
# Load in SBS_BASE the project path
......
......@@ -55,6 +55,7 @@ find_deps() {
command -v cmake > /dev/null 2>&1 && found_cmake=true
command -v arm-miosix-eabi-g++ > /dev/null 2>&1 && found_miosixgpp=true
command -v clang++ > /dev/null 2>&1 && found_clangpp=true
command -v ccache > /dev/null 2>&1 && found_ccache=true
command -v ninja > /dev/null 2>&1 && found_ninja=true
command -v python > /dev/null 2>&1 && found_python=true
......@@ -66,6 +67,7 @@ find_deps() {
printf "Found CMake: "; [ "$found_cmake" = true ] && echo "yes" || echo "no"
printf "Found arm-miosix-eabi-g++: "; [ "$found_miosixgpp" = true ] && echo "yes" || echo "no"
printf "Found clang++: "; [ "$found_clangpp" = true ] && echo "yes" || echo "no"
printf "Found Ccache: "; [ "$found_ccache" = true ] && echo "yes" || echo "no"
printf "Found Ninja: "; [ "$found_ninja" = true ] && echo "yes" || echo "no"
printf "Found Python: "; [ "$found_python" = true ] && echo "yes" || echo "no"
......@@ -75,8 +77,8 @@ find_deps() {
printf "Found flasher: "; [ "$found_stflash" = true ] && echo "st-flash" \
|| { [ "$found_stlink" = true ] && echo "st-link" || echo "no"; }
[ "$found_cmake" = true ] || { echo "Error: CMake must be installed"; return 1; }
[ "$found_miosixgpp" = true ] || { echo "Error: arm-miosix-eabi-g++ must be installed"; return 1; }
[ "$found_cmake" = true ] || { echo "Error: CMake must be installed"; return 1; }
[ "$found_clangpp" = true ] || { echo "Error: clang++ must be installed"; return 1; }
}
# Workaround: Disable tests in excluded subdirectories
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment