Skip to content

Commit

Permalink
DEBUG: keep dogfooding forwarder with cmake during build
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Aug 22, 2024
1 parent 67258a3 commit 8ec9c8c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ requirements:
- cmake
- ninja
- python >=3
- m2-sed # [win]
- libcxx {{ cxx_compiler_version }} # [osx]
host:
- libcxx {{ cxx_compiler_version }} # [osx]
Expand Down
1 change: 1 addition & 0 deletions recipe/win_forwarder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8ec9c8c

Please sign in to comment.