From 143d3769c7f2296617f205e73908e1f96fb0a928 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Thu, 24 Jul 2025 19:59:36 +0200 Subject: [PATCH] fix(autogen): opening log file before created generated directory --- autogen/src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autogen/src/main.cpp b/autogen/src/main.cpp index e5843af..abdab16 100644 --- a/autogen/src/main.cpp +++ b/autogen/src/main.cpp @@ -43,6 +43,8 @@ int processHeader(fs::path srcRoot, fs::path srcPath, fs::path outPath) { return 1; } + fs::create_directories(outPath.parent_path()); // Make sure generated dir exists before we try writing to it + // We write to a special log file instead of stdout/stderr to // 1. avoid confusion // 2. prevent MSBuild from reading the word "error" and detecting there's a problem with the program (there isn't) @@ -74,8 +76,6 @@ int processHeader(fs::path srcRoot, fs::path srcPath, fs::path outPath) { data::analyzeClasses(cursor, srcRootStr, &dataAnlyState); enum_::analyzeClasses(cursor, srcRootStr, &enumAnlyState); - fs::create_directories(outPath.parent_path()); // Make sure generated dir exists before we try writing to it - printf("[AUTOGEN] Generating file %s...\n", relpathStr.c_str()); std::ofstream outStream(outPathStr);