Skip to content

Commit

Permalink
build: new variable make board selection easier (#22)
Browse files Browse the repository at this point in the history
* build: new variable make board selection easier

when setting ORB=pearl or ORB=diamond, the board
is selected automatically.
it allows to use one profile per Orb on CLion:
the profile selects the board when loading the CMakeLists.txt.
We still have to create a new profile for Debug/Release

* build: unset to remove BOARD from CMakeCache

before overwriting it

Co-authored-by: Moritz Diller <[email protected]>

---------

Co-authored-by: Moritz Diller <[email protected]>
  • Loading branch information
fouge and moritz-diller authored May 8, 2024
1 parent 3fb76f2 commit 7b513eb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main_board/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ set_property(

set_property(GLOBAL PROPERTY CSTD gnu11)

# optional Orb variable allows to select the board
if ("$ENV{ORB}" STREQUAL "pearl")
unset(BOARD CACHE)
set(ENV{BOARD} pearl_main)
elseif ("$ENV{ORB}" STREQUAL "diamond")
unset(BOARD CACHE)
set(ENV{BOARD} diamond_main)
endif ()

# Load board before Zephyr loads it to get some custom/private board configuration.
# Private config is not available publicly as the name suggests and contains
# paths to private keys.
Expand Down

0 comments on commit 7b513eb

Please sign in to comment.