aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorDavid Moc <personal@cdatgoose.org>2026-06-03 02:26:11 +0200
committerDavid Moc <personal@cdatgoose.org>2026-06-03 02:26:11 +0200
commitc6d44836fd8ed1442e01825cb0f9f97e7bf11515 (patch)
treed0e8cededdecafdf27476a744ac2d892d5a18620 /src/config.c
parentb68766967c86a6a789d65772f69f7f44939ebdf2 (diff)
Harden editor logging and packaging
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c
index 9c885ff..6e4b84f 100644
--- a/src/config.c
+++ b/src/config.c
@@ -339,9 +339,18 @@ static int add_include_path(ccdjit_context *ctx, const char *path) {
return ECEX_ERR;
}
+static int add_existing_include_path(ccdjit_context *ctx, const char *path) {
+ if (!path || !path[0] || !ecex_path_is_dir(path)) return ECEX_OK;
+ return add_include_path(ctx, path);
+}
+
int ecex_add_ccdjit_include_paths(ccdjit_context *ctx) {
- if (add_include_path(ctx, "include") != ECEX_OK) return ECEX_ERR;
- if (add_include_path(ctx, "../include") != ECEX_OK) return ECEX_ERR;
+ if (add_existing_include_path(ctx, "include") != ECEX_OK) return ECEX_ERR;
+ if (add_existing_include_path(ctx, "../include") != ECEX_OK) return ECEX_ERR;
+
+#ifdef ECEX_SYSTEM_INCLUDE_DIR
+ if (add_existing_include_path(ctx, ECEX_SYSTEM_INCLUDE_DIR) != ECEX_OK) return ECEX_ERR;
+#endif
const char *env_include = getenv("ECEX_INCLUDE");
if (env_include && env_include[0]) {