From cdc8ffde7e2ffd3377bcb93811fb2a931d0d86d6 Mon Sep 17 00:00:00 2001 From: Erling Rennemo Jellum Date: Mon, 22 Jan 2024 19:36:27 +0100 Subject: [PATCH] Only include prj.conf when its there --- .../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 93ebb64fc5..12953cd07e 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("# Include default lf conf-file and user supplied conf file."); + cMakeCode.pr("# Include default lf conf-file."); cMakeCode.pr("set(CONF_FILE prj_lf.conf)"); - cMakeCode.pr("set(OVERLAY_CONFIG prj.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() + ")");