Skip to content

Commit

Permalink
modified cmake to only select one target at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
bsutherland333 committed Jun 28, 2024
1 parent 664532f commit 25e0706
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
15 changes: 6 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,16 @@ file(GLOB_RECURSE ROSFLIGHT_SOURCES

### select boards to compile ###

option(BUILD_VARMINT "Build the varmint board target" OFF)
option(BUILD_PIXRACER_PRO "Build the pixracer pro board target" OFF)
option(BUILD_TEST "Build the test board target" OFF)

if(BUILD_VARMINT)
set(BOARD_TO_BUILD "" CACHE STRING "Select the board to build")
if("${BOARD_TO_BUILD}" STREQUAL "varmint")
message("===== Selecting varmint board target. =====")
add_subdirectory(boards/varmint_h7/varmint_10X)
elseif (BUILD_PIXRACER_PRO)
elseif("${BOARD_TO_BUILD}" STREQUAL "pixracer_pro")
message("===== Selecting pixracer pro board target. =====")
add_subdirectory(boards/varmint_h7/pixracer_pro)
elseif(BUILD_TEST)
elseif("${BOARD_TO_BUILD}" STREQUAL "test")
message("===== Selecting test board target. ======")
add_subdirectory(test)
else()
message(FATAL_ERROR "No board selected! Please select the varmint, pixracer pro, or test board with -DBUILD_VARMINT=TRUE, -DBUILD_PIXRACER_PRO=TRUE, OR -DBUILD_TEST=TRUE.")
endif ()
message(FATAL_ERROR "No valid board selected! Please select the varmint, pixracer pro, or test board with -DBOARD_TO_BUILD=varmint, -DBOARD_TO_BUILD=pixracer_pro, OR -DBOARD_TO_BUILD=test.")
endif()
6 changes: 3 additions & 3 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ echo_blue "Test 1: Build varmint firmware"
rm -rf build
mkdir build
cd build
cmake .. -DBUILD_VARMINT=TRUE -DCMAKE_BUILD_TYPE=RELEASE && make -j8 -l8
cmake .. -DBOARD_TO_BUILD=varmint -DCMAKE_BUILD_TYPE=RELEASE && make -j8 -l8
print_result $?
cd ..

echo_blue "Test 1: Build pixracer pro firmware"
rm -rf build
mkdir build
cd build
cmake .. -DBUILD_PIXRACER_PRO=TRUE -DCMAKE_BUILD_TYPE=RELEASE && make -j8 -l8
cmake .. -DBOARD_TO_BUILD=pixracer_pro -DCMAKE_BUILD_TYPE=RELEASE && make -j8 -l8
print_result $?
cd ..

echo_blue "Test 2: Build test suite"
rm -rf build
mkdir build
cd build
cmake .. -DBUILD_TEST=TRUE -DCMAKE_BUILD_TYPE=RELEASE && make -j8 -l8
cmake .. -DBOARD_TO_BUILD=test -DCMAKE_BUILD_TYPE=RELEASE && make -j8 -l8
print_result $?

echo_blue "Test 3: Run test suite"
Expand Down

0 comments on commit 25e0706

Please sign in to comment.