Commit 2c064a01 authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook GitHub Bot

define FOLLY_XLOG_STRIP_PREFIXES correctly for all targets

Summary:
The `FOLLY_XLOG_STRIP_PREFIXES` macro tells folly::logging how to strip off
the absolute portion of the path when automatically computing log category
names from the source file name.

Previously this was set in FollyCompilerUnix.cmake, which caused it to only be
applied on Linux/Mac platforms, and only for targets that explicitly used
`apply_folly_compile_options_to_target()`.

This changes the code to apply this definition with a directory property, so
it affects all targets under the top-level directory, and it is also applied
on Windows.

Reviewed By: wez

Differential Revision: D21333014

fbshipit-source-id: 9256e14ab4fd03d19f28957e7ca298c930a22b18
parent 82070c96
......@@ -40,7 +40,6 @@ function(apply_folly_compile_options_to_target THETARGET)
PRIVATE
_REENTRANT
_GNU_SOURCE
"FOLLY_XLOG_STRIP_PREFIXES=\"${FOLLY_DIR_PREFIXES}\""
)
target_compile_options(${THETARGET}
PRIVATE
......
......@@ -117,6 +117,19 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h
)
# Define FOLLY_XLOG_STRIP_PREFIXES when compiling our sources so that
# folly/logging will automatically choose the correct log category names,
# using only the relative portion of the source file name inside the
# folly repository.
set_property(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
APPEND
PROPERTY
COMPILE_DEFINITIONS
"FOLLY_XLOG_STRIP_PREFIXES=\"${CMAKE_SOURCE_DIR}:${CMAKE_BINARY_DIR}\""
)
# We currently build the main libfolly library by finding all sources
# and header files. We then exclude specific files below.
#
......
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