Commit da420c9a authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

cmake: split exception_tracer out into separate libraries

Summary:
The exception_tracer code changes program behavior when you link it in.
Therefore it should not be included in the main libfolly library.

This splits the exception_tracer code out into 3 separate libraries, which
matches the behavior described in the exception_tracer README.md file.

Reviewed By: yfeldblum

Differential Revision: D6787807

fbshipit-source-id: 51400c3ff464d359b4acc56679b5f584f3b586fd
parent 5249f02a
...@@ -100,6 +100,7 @@ auto_sources(hfiles "*.h" "RECURSE" "${FOLLY_DIR}") ...@@ -100,6 +100,7 @@ auto_sources(hfiles "*.h" "RECURSE" "${FOLLY_DIR}")
REMOVE_MATCHES_FROM_LISTS(files hfiles REMOVE_MATCHES_FROM_LISTS(files hfiles
MATCHES MATCHES
"/build/" "/build/"
"/experimental/exception_tracer/"
"/experimental/hazptr/bench/" "/experimental/hazptr/bench/"
"/experimental/hazptr/example/" "/experimental/hazptr/example/"
"/experimental/logging/example/" "/experimental/logging/example/"
...@@ -124,7 +125,6 @@ list(REMOVE_ITEM hfiles ...@@ -124,7 +125,6 @@ list(REMOVE_ITEM hfiles
if (NOT FOLLY_USE_SYMBOLIZER) if (NOT FOLLY_USE_SYMBOLIZER)
REMOVE_MATCHES_FROM_LISTS(files hfiles REMOVE_MATCHES_FROM_LISTS(files hfiles
MATCHES MATCHES
"/experimental/exception_tracer/"
"/experimental/symbolizer/" "/experimental/symbolizer/"
) )
list(REMOVE_ITEM files list(REMOVE_ITEM files
......
...@@ -9,3 +9,5 @@ install(TARGETS follybenchmark ...@@ -9,3 +9,5 @@ install(TARGETS follybenchmark
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib) ARCHIVE DESTINATION lib)
add_subdirectory(experimental/exception_tracer)
if (FOLLY_USE_SYMBOLIZER)
add_library(
folly_exception_tracer_base
ExceptionTracer.cpp
StackTrace.cpp
)
apply_folly_compile_options_to_target(folly_exception_tracer_base)
target_include_directories(folly_exception_tracer_base
PUBLIC
${FOLLY_INCLUDE_DIRECTORIES}
)
target_link_libraries(
folly_exception_tracer_base
PUBLIC folly ${FOLLY_LINK_LIBRARIES}
)
install(
TARGETS folly_exception_tracer_base
EXPORT folly_exception_tracer
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
add_library(
folly_exception_tracer
ExceptionStackTraceLib.cpp
ExceptionTracerLib.cpp
)
apply_folly_compile_options_to_target(folly_exception_tracer)
target_include_directories(folly_exception_tracer
PUBLIC
${FOLLY_INCLUDE_DIRECTORIES}
)
target_link_libraries(
folly_exception_tracer
PUBLIC folly_exception_tracer_base
)
install(
TARGETS folly_exception_tracer
EXPORT folly_exception_tracer
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
add_library(
folly_exception_counter
ExceptionCounterLib.cpp
)
apply_folly_compile_options_to_target(folly_exception_counter)
target_include_directories(folly_exception_counter
PUBLIC
${FOLLY_INCLUDE_DIRECTORIES}
)
target_link_libraries(
folly_exception_counter
PUBLIC folly_exception_tracer
)
install(
TARGETS folly_exception_counter
EXPORT folly_exception_tracer
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(
FILES
ExceptionAbi.h
ExceptionCounterLib.h
ExceptionTracer.h
ExceptionTracerLib.h
StackTrace.h
DESTINATION
include/folly/experimental/exception_tracer
)
install(
EXPORT folly_exception_tracer
DESTINATION share/folly
NAMESPACE Folly::
FILE folly-exception-tracer-targets.cmake
)
endif()
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