Skip to content
Permalink
Browse files

cmake: fix syntax error in Win32Deps.cmake

In a construct such as:

```cmake
if($ENV{FOO} MATCHES bar)
...
endif()
```

if the environment variable is not set, the if statement becomes a
syntax error because there is nothing being compared.

Fix this by quoting the environment variable like so:

```cmake
if("$ENV{FOO}" MATCHES bar)
...
endif()
```

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information...
rkitover committed Mar 23, 2019
1 parent 59e9c69 commit 23fe13d8fbf2103f6c9b33890096c64adedae2b6
Showing with 2 additions and 2 deletions.
  1. +1 −1 cmake/Win32Deps.cmake
  2. +1 −1 vcpkg
@@ -5,7 +5,7 @@ if(WIN32)
endif()

set(WINARCH x86)
if(CMAKE_C_COMPILER MATCHES x64 OR CMAKE_CXX_COMPILER MATCHES x64 OR $ENV{VSCMD_ARG_TGT_ARCH} MATCHES x64)
if(CMAKE_C_COMPILER MATCHES x64 OR CMAKE_CXX_COMPILER MATCHES x64 OR "$ENV{VSCMD_ARG_TGT_ARCH}" MATCHES x64)
set(WINARCH x64)
endif()

0 comments on commit 23fe13d

Please sign in to comment.
You can’t perform that action at this time.