summaryrefslogtreecommitdiff
path: root/cmake/scripts
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2021-02-22 19:02:48 +0100
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-02-22 23:17:45 +0100
commitb67245d71e3a9bb4819d85ffe4a6bf1091688c46 (patch)
treedfdff15ee731e913a3729f54a07e54ce83d861a3 /cmake/scripts
parentec9d1a6b8f906b098b89b168174805a0de234927 (diff)
downloadopenttd-b67245d71e3a9bb4819d85ffe4a6bf1091688c46.tar.xz
Fix: [CMake] CMake may use || at the end of custom commands
Diffstat (limited to 'cmake/scripts')
-rw-r--r--cmake/scripts/SquirrelIncludes.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmake/scripts/SquirrelIncludes.cmake b/cmake/scripts/SquirrelIncludes.cmake
index e64e2d25a..672ad0953 100644
--- a/cmake/scripts/SquirrelIncludes.cmake
+++ b/cmake/scripts/SquirrelIncludes.cmake
@@ -16,11 +16,18 @@ endif()
set(ARGC 1)
set(ARG_READ NO)
+# For MSVC CMake runs this script from a batch file using || to detect errors,
+# depending on source path it may quote args, and cause cmd to not understand ||
+# and pass it as argument to ourself.
# Read all the arguments given to CMake; we are looking for -- and everything
-# that follows. Those are our api files.
+# that follows, until ||. Those are our api files.
while(ARGC LESS CMAKE_ARGC)
set(ARG ${CMAKE_ARGV${ARGC}})
+ if(ARG STREQUAL "||")
+ set(ARG_READ NO)
+ endif()
+
if(ARG_READ)
list(APPEND SCRIPT_API_BINARY_FILES "${ARG}")
endif()