Commit b5ba7c30 authored by Georgios Bitzes's avatar Georgios Bitzes Committed by Facebook Github Bot

Fix ASan build when folly is embedded as a submodule (#960)

Summary:
When folly is used as a submodule, CMAKE_SOURCE_DIR
will point to the top-level repository, resulting
in set_source_files_properties not taking effect
when compiling with ASan.

Replacing CMAKE_SOURCE_DIR with PROJECT_SOURCE_DIR points
cmake to the intended file.
Pull Request resolved: https://github.com/facebook/folly/pull/960

Reviewed By: yfeldblum

Differential Revision: D12943633

Pulled By: Orvid

fbshipit-source-id: a73560c5578062282f38dc3ff6c7a3364fb6cf6e
parent 2b0923c6
...@@ -189,7 +189,7 @@ if (FOLLY_ASAN_ENABLED) ...@@ -189,7 +189,7 @@ if (FOLLY_ASAN_ENABLED)
# sanitizer, but even so, gcc fails to compile them for some reason when # sanitizer, but even so, gcc fails to compile them for some reason when
# sanitization is enabled on the compile line. # sanitization is enabled on the compile line.
set_source_files_properties( set_source_files_properties(
"${CMAKE_SOURCE_DIR}/folly/detail/Sse.cpp" "${PROJECT_SOURCE_DIR}/folly/detail/Sse.cpp"
PROPERTIES COMPILE_FLAGS -fno-sanitize=address,undefined PROPERTIES COMPILE_FLAGS -fno-sanitize=address,undefined
) )
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES Clang) elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES Clang)
......
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