Commit 7851b439 authored by Matt Glazar's avatar Matt Glazar Committed by Facebook Github Bot

Avoid Linux-specific dependency for macOS builds

Summary:
In Facebook's Buck-based build system, folly/system/MemoryMapping.cpp depends on folly/experimental/io/HugePages.cpp. This works well on Linux, and in theory works well on macOS because HugePages.cpp has no OS-specific code at build time. However, because HugePages.cpp has a transitive dependency on the range-v3 library, and because range-v3 isn't available in Facebook's build system for macOS yet, building HugePages.cpp on macOS fails.

On macOS, avoid MemoryMapping.cpp's dependency on HugePages.cpp (and thus the transitive dependency on range-v3). Use a manual annotation to prevent the Facebook's autodeps tool from forcing the dependency on macOS in Buck. (It looks like autodeps does not interpret `#ifdef __linux__`.)

On Linux (servers), this diff should not change behavior.

This diff does not fix the issue in folly's CMake build system.

Reviewed By: yfeldblum

Differential Revision: D15775751

fbshipit-source-id: 612790caab673c0fc52eb3054aa5789f767c7353
parent b2a27c9d
......@@ -27,7 +27,7 @@
#include <folly/portability/SysMman.h>
#ifdef __linux__
#include <folly/experimental/io/HugePages.h>
#include <folly/experimental/io/HugePages.h> // @manual
#endif
#include <fcntl.h>
......
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