From 8ec9c8c1e2e075e7e232507de7f42e4bccde605a Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 22 Aug 2024 15:44:39 +1100 Subject: [PATCH] DEBUG: keep dogfooding forwarder with cmake during build --- recipe/bld.bat | 12 ++++++++++++ recipe/meta.yaml | 1 + recipe/win_forwarder.c | 1 + 3 files changed, 14 insertions(+) diff --git a/recipe/bld.bat b/recipe/bld.bat index b2581b77..08a197d5 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -1,5 +1,17 @@ echo on +move %BUILD_PREFIX%\Library\bin\cmake.exe %BUILD_PREFIX%\Library\bin\cmake-19.exe +REM forwarder just calls the versioned binary; needs to be compiled +REM to be usable without extra ceremony; the forwarder constructs the +REM call based on its own filename, so we only need to compile it once +copy %RECIPE_DIR%\win_forwarder.c .\win_forwarder.c +REM replace templated version number in code +sed -i "s/{{ majorversion }}/%PKG_VERSION:~0,2%/g" .\win_forwarder.c +%CC% .\win_forwarder.c +type .\win_forwarder.c + +copy .\win_forwarder.exe %BUILD_PREFIX%\Library\bin\cmake.exe + mkdir build cd build diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 34114a75..3a2a4240 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -32,6 +32,7 @@ requirements: - cmake - ninja - python >=3 + - m2-sed # [win] - libcxx {{ cxx_compiler_version }} # [osx] host: - libcxx {{ cxx_compiler_version }} # [osx] diff --git a/recipe/win_forwarder.c b/recipe/win_forwarder.c index cd7b1316..fb563c48 100644 --- a/recipe/win_forwarder.c +++ b/recipe/win_forwarder.c @@ -35,6 +35,7 @@ int _tmain( int argc, TCHAR *argv[] ) strcat(forwarded, argv[i]); strcat(forwarded, "\""); } + printf("Reconstructed call: %s\n", forwarded); // Start the child process. if( !CreateProcess( NULL, // No module name (use command line)