Commit 479db43058ad31e92a32f5c7197d84b5213b741c

Sam Lantinga 2020-12-09T06:56:34

Fixed bug 5250 - updaterev.sh failed using CMake Tools on VSCode Remote Sebastian Vargas Vargas Running CMake configure from a Windows Subsystem for Linux using Visual Studio Code Remote doesn't generate the header file with the current source revision, it throws "/home/sebva/SDL/build-scripts/updaterev.sh: 13: cannot create /mnt/c/Users/sebva/.vscode/extensions/ms-vscode-remote.remote-wsl-0.44.4/include/SDL_revision.h.new: Directory nonexistent".

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 414b1a0..0c1550b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2077,7 +2077,8 @@ set(EXTRA_CFLAGS ${_EXTRA_CFLAGS})
 # Compat helpers for the configuration files
 if(NOT CMAKE_HOST_WIN32)
   # TODO: we need a Windows script, too
-  execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh)
+  execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh
+    WORKING_DIRECTORY ${SDL2_BINARY_DIR})
 endif()
 if(NOT WINDOWS OR CYGWIN)
   set(prefix ${CMAKE_INSTALL_PREFIX})