Skip to content

Commit

Permalink
HelloZephyr compiles and runs on qemu
Browse files Browse the repository at this point in the history
  • Loading branch information
erlingrj committed Jan 9, 2023
1 parent ffd4669 commit 6236283
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
6 changes: 4 additions & 2 deletions org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,15 @@ CodeBuilder generateCMakeCode(
cMakeCode.newLine();

cMakeCode.pr("cmake_minimum_required(VERSION " + MIN_CMAKE_VERSION + ")");
cMakeCode.pr("project("+executableName+" LANGUAGES C)");
cMakeCode.newLine();

if (targetConfig.platformOptions.platform == Platform.ZEPHYR) {
cMakeCode.pr("find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})");
cMakeCode.newLine();
}

cMakeCode.pr("project("+executableName+" LANGUAGES C)");
cMakeCode.newLine();

// The Test build type is the Debug type plus coverage generation
cMakeCode.pr("if(CMAKE_BUILD_TYPE STREQUAL \"Test\")");
cMakeCode.pr(" set(CMAKE_BUILD_TYPE \"Debug\")");
Expand Down
1 change: 0 additions & 1 deletion test/C/src/zephyr/HelloZephyr.lf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ target C {
platform: "Zephyr",
build: "bash scripts/zephyr_build.sh qemu_cortex_m3 flash",
threading: false,
cmake-include: "scripts/zephyr.cmake"
}

main reactor {
Expand Down
16 changes: 0 additions & 16 deletions test/C/src/zephyr/scripts/zephyr.cmake

This file was deleted.

2 changes: 2 additions & 0 deletions test/C/src/zephyr/scripts/zephyr_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ else
echo "Unrecognized board $BOARD"
exit 1
fi

fi

1 comment on commit 6236283

@lhstrh
Copy link
Member

@lhstrh lhstrh commented on 6236283 Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🚀 🚀

Please # to comment.