+# Exclude specific sources if we do not have third-party libraries
+# required to build them.
+if (NOT FOLLY_USE_SYMBOLIZER)
+ REMOVE_MATCHES_FROM_LISTS(files hfiles
+ MATCHES
+ "/experimental/exception_tracer/"
+ "/experimental/symbolizer/"
+ )
+ list(REMOVE_ITEM files
+ ${FOLLY_DIR}/SingletonStackTrace.cpp
+ )
+endif()
+if (NOT ${LIBURCU_FOUND})
+ list(REMOVE_ITEM files
+ ${FOLLY_DIR}/experimental/RCUUtils.cpp
+ )
+ list(REMOVE_ITEM hfiles
+ ${FOLLY_DIR}/experimental/RCURefCount.h
+ ${FOLLY_DIR}/experimental/RCUUtils.h
+ )
+endif()
+if (NOT ${LIBAIO_FOUND})
+ list(REMOVE_ITEM files
+ ${FOLLY_DIR}/experimental/io/AsyncIO.cpp
+ )
+ list(REMOVE_ITEM hfiles
+ ${FOLLY_DIR}/experimental/io/AsyncIO.h
+ )
+endif()
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ list(REMOVE_ITEM files
+ ${FOLLY_DIR}/Poly.cpp
+ ${FOLLY_DIR}/Subprocess.cpp
+ )
+ list(REMOVE_ITEM hfiles
+ ${FOLLY_DIR}/Poly.h
+ ${FOLLY_DIR}/Poly-inl.h
+ ${FOLLY_DIR}/detail/PolyDetail.h
+ ${FOLLY_DIR}/detail/TypeList.h
+ ${FOLLY_DIR}/poly/Nullable.h
+ ${FOLLY_DIR}/poly/Regular.h
+ )
+endif()
+