Commit 1cb1ad79 authored by Joe Loser's avatar Joe Loser Committed by Facebook Github Bot

Fix to handle empty CMAKE_SYSTEM_ARCHITECTURE (#1040)

Summary:
- On some platforms, `CMAKE_SYSTEM_ARCHITECTURE` may resolve to an empty
  string.
- When this value is used without quotes to the `string` command, it is
  ill-formed with error:

```
  CMake Error at CMakeLists.txt:174 (string):
  string sub-command FIND requires 3 or 4 parameters.
```

- Explicitly wrap the value to the `string` operation in quotes to treat
  `CMAKE_SYSTEM_ARCHITECTURE` as a string, which is allowed to be empty.
  The result is that the `string` operation will not result in a hard
  error.
Pull Request resolved: https://github.com/facebook/folly/pull/1040

Reviewed By: calebmarchent

Differential Revision: D14293784

Pulled By: yfeldblum

fbshipit-source-id: cd5924fa62277aa07e930c7b088197ef596be977
parent 8d53d77b
......@@ -171,7 +171,7 @@ if (NOT ${LIBAIO_FOUND})
)
endif()
if (${LIBSODIUM_FOUND})
string(FIND ${CMAKE_LIBRARY_ARCHITECTURE} "x86_64" IS_X86_64_ARCH)
string(FIND "${CMAKE_LIBRARY_ARCHITECTURE}" "x86_64" IS_X86_64_ARCH)
if (${IS_X86_64_ARCH} STREQUAL "-1")
message(
STATUS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment