From 8de123fd7d63459017455a850cdeb3f2a0c7cead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Wed, 1 Sep 2021 08:56:04 +0200 Subject: [PATCH] Add IDL compiler option to specify the output directory for the generated code (requires cyclonedds PR #922) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Günter Obiltschnig --- src/idlcxx/src/generator.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/idlcxx/src/generator.c b/src/idlcxx/src/generator.c index 24b541a7..a3118366 100644 --- a/src/idlcxx/src/generator.c +++ b/src/idlcxx/src/generator.c @@ -766,7 +766,12 @@ idl_retcode_t generate(const idl_pstate_t *pstate) } file = sep ? sep + 1 : path; - if (idl_isabsolute(path) || !sep) + if (pstate->outdir) { + if (!(dir = idl_strdup(pstate->outdir))) { + goto err_dir; + } + } + else if (idl_isabsolute(path) || !sep) dir = empty; else if (!(dir = idl_strndup(path, (size_t)(sep-path)))) goto err_dir;