build: escape backslashes in path arguments given to cmake

This commit is contained in:
Andrew Kelley 2017-10-01 14:01:18 -04:00
parent 4bf149795a
commit 0227becb56
2 changed files with 7 additions and 3 deletions

View File

@ -20,6 +20,10 @@ set(ZIG_LIBC_INCLUDE_DIR "/usr/include" CACHE STRING "Default native target libc
set(ZIG_DYNAMIC_LINKER "" CACHE STRING "Override dynamic linker for native target") set(ZIG_DYNAMIC_LINKER "" CACHE STRING "Override dynamic linker for native target")
set(ZIG_EACH_LIB_RPATH off CACHE BOOL "Add each dynamic library to rpath for native target") set(ZIG_EACH_LIB_RPATH off CACHE BOOL "Add each dynamic library to rpath for native target")
string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_LIB_DIR_ESCAPED ${ZIG_LIBC_LIB_DIR})
string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_STATIC_LIB_DIR_ESCAPED ${ZIG_LIBC_STATIC_LIB_DIR})
string(REGEX REPLACE "\\\\" "\\\\\\\\" ZIG_LIBC_INCLUDE_DIR_ESCAPED ${ZIG_LIBC_INCLUDE_DIR})
option(ZIG_TEST_COVERAGE "Build Zig with test coverage instrumentation" OFF) option(ZIG_TEST_COVERAGE "Build Zig with test coverage instrumentation" OFF)
# To see what patches have been applied to LLD in this repository: # To see what patches have been applied to LLD in this repository:

View File

@ -15,9 +15,9 @@
#define ZIG_HEADERS_DIR "@CMAKE_INSTALL_PREFIX@/@C_HEADERS_DEST@" #define ZIG_HEADERS_DIR "@CMAKE_INSTALL_PREFIX@/@C_HEADERS_DEST@"
#define ZIG_STD_DIR "@CMAKE_INSTALL_PREFIX@/@ZIG_STD_DEST@" #define ZIG_STD_DIR "@CMAKE_INSTALL_PREFIX@/@ZIG_STD_DEST@"
#define ZIG_LIBC_INCLUDE_DIR "@ZIG_LIBC_INCLUDE_DIR@" #define ZIG_LIBC_INCLUDE_DIR "@ZIG_LIBC_INCLUDE_DIR_ESCAPED@"
#define ZIG_LIBC_LIB_DIR "@ZIG_LIBC_LIB_DIR@" #define ZIG_LIBC_LIB_DIR "@ZIG_LIBC_LIB_DIR_ESCAPED@"
#define ZIG_LIBC_STATIC_LIB_DIR "@ZIG_LIBC_STATIC_LIB_DIR@" #define ZIG_LIBC_STATIC_LIB_DIR "@ZIG_LIBC_STATIC_LIB_DIR_ESCAPED@"
#define ZIG_DYNAMIC_LINKER "@ZIG_DYNAMIC_LINKER@" #define ZIG_DYNAMIC_LINKER "@ZIG_DYNAMIC_LINKER@"
#cmakedefine ZIG_EACH_LIB_RPATH #cmakedefine ZIG_EACH_LIB_RPATH