diff --git a/ner_environment/build_system/build_system.py b/ner_environment/build_system/build_system.py index 7ef48e8a..e04e22ac 100644 --- a/ner_environment/build_system/build_system.py +++ b/ner_environment/build_system/build_system.py @@ -55,7 +55,7 @@ class OpenOCDLocation(str, Enum): # ============================================================================== @app.command(help="Build the project with GCC ARM Toolchain and Make/CMake") -def build(profile: str = typer.Option(None, "--profile", "-p", callback=unsupported_option_cb, help="(planned) Specify the build profile (e.g., debug, release)", show_default=True), +def build(profile: str = typer.Option("release", "--profile", "-p", help="Specify the build profile (e.g., debug, release)", show_default=True), clean: bool = typer.Option(False, "--clean", help="Clean the build directory before building", show_default=True)): is_cmake = os.path.exists("CMakeLists.txt") if is_cmake: # Repo uses CMake, so execute CMake commands. @@ -64,7 +64,7 @@ def build(profile: str = typer.Option(None, "--profile", "-p", callback=unsuppor run_command_docker('cmake --build build --target clean ; find . -type d -name "build" -exec rm -rf {} +') print("[#cccccc](ner build):[/#cccccc] [green]Ran build-cleaning command.[/green]") else: - run_command_docker("mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=cmake/gcc-arm-none-eabi.cmake .. && cmake --build .", stream_output=True) + run_command_docker(f"mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE={profile.capitalize()} -DCMAKE_TOOLCHAIN_FILE=cmake/gcc-arm-none-eabi.cmake .. && cmake --build .", stream_output=True) run_command_docker('chmod 777 -R ./build/*') else: # Repo uses Make, so execute Make commands. print("[#cccccc](ner build):[/#cccccc] [blue]Makefile-based project detected.[/blue]")