Replies: 2 comments 7 replies
-
Unfortunately, CMake does not control its own build dir. It's set by VS Code's commands, and can be controlled via cmake.buildDirectory in .vscode/settings.json. I agree that having a different build dir for each Variant would be super useful, but it looks like this would have to be set up on the VS Code side. This page looks like it might be useful: microsoft/vscode-cmake-tools#151 . Maybe try setting |
Beta Was this translation helpful? Give feedback.
-
@JojoS62 in our case we have three CMake targest:
the 3 are configured independently with 3 different build directories by running: make config # --> _build/{TARGET_BOARD} by default 'LEKA_V1_2_DEV'
make config_tools # --> _build_cmake_tools
make config_unit_tests # --> _build_unit_tests we do handle the need to change the Mbed hardware target by calling make config # --> _build/LEKA_V1_2_DEV
make config TARGET_BOARD=LEKA_V1_2_DEV # --> _build/LEKA_V1_2_DEV
make config TARGET_BOARD=LEKA_DISCO # --> _build/LEKA_DISCO Doing so pulls all the dependencies again and allows you to compile for the hardware target you want without reconfiguring everything, you just need: make TARGET_BOARD={TARGET NAME}
make TARGET_BOARD=LEKA_DISCO
make TARGET_BOARD=LEKA_V1_2_DEV
make # equivalent to `make TARGET_BOARD=LEKA_V1_2_DEV` The whole logic is handled here: https://github.com/leka/LekaOS/blob/develop/Makefile This Makefile is not related to CMake (as when you generate the project using a Makefile) -- it's a dev tool for us, that could be replaced by a script or cli |
Beta Was this translation helpful? Give feedback.
-
Wenn the cmake-variants.yaml has entries for different targets, then CMake complains when switching from one target to another:
Is it possible to use the --fresh option? The newer cmaker 3.24 is available for a long time now and I guess it can be used without problems.
Even better would be to have target related build dirs as in mbed-os CLI2. How about changing the mbed-ce to use a build dir per target?
@multiplemonomials @ladislas @jay-sridharan
Beta Was this translation helpful? Give feedback.
All reactions