From 8184f08cfe6001e5a1dab2f21815dadc8012c3f5 Mon Sep 17 00:00:00 2001 From: Erling Rennemo Jellum Date: Tue, 23 Jan 2024 17:54:46 +0100 Subject: [PATCH] Zephyr: Actually include the userwritten prj.conf if it exists. --- .../main/java/org/lflang/generator/c/CCmakeGenerator.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java b/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java index e928cfbd3e..91da4d43c8 100644 --- a/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java +++ b/core/src/main/java/org/lflang/generator/c/CCmakeGenerator.java @@ -144,9 +144,12 @@ CodeBuilder generateCMakeCode( // Setup the project header for different platforms switch (platformOptions.platform()) { case ZEPHYR: - cMakeCode.pr("# Set default configuration file. To add custom configurations,"); - cMakeCode.pr("# pass -- -DOVERLAY_CONFIG=my_config.prj to either cmake or west"); + cMakeCode.pr("# Include default lf conf-file."); cMakeCode.pr("set(CONF_FILE prj_lf.conf)"); + cMakeCode.pr("# Include user-provided conf-file, if it exists"); + cMakeCode.pr("if(EXISTS prj.conf)"); + cMakeCode.pr(" set(OVERLAY_CONFIG prj.conf)"); + cMakeCode.pr("endif()"); if (platformOptions.board() != null) { cMakeCode.pr("# Selecting board specified in target property"); cMakeCode.pr("set(BOARD " + platformOptions.board() + ")");