Commit 840fd786 authored by Victor Zverovich's avatar Victor Zverovich Committed by Facebook Github Bot

Fix singleton_thread_local_test CMake build

Summary:
Add the `singleton_thread_local_test` companion shared library to CMake config
and enable these only when folly is compiled with `-fPIC`. This should fix
Travis build.

Reviewed By: yfeldblum

Differential Revision: D13542693

fbshipit-source-id: 2372da298cc69c2e7e491fbde681fe90d8879d47
parent da78383f
......@@ -715,7 +715,6 @@ if (BUILD_TESTS)
# SingletonTest requires Subprocess
#TEST singleton_test SOURCES SingletonTest.cpp
TEST singleton_test_global SOURCES SingletonTestGlobal.cpp
TEST singleton_thread_local_test SOURCES SingletonThreadLocalTest.cpp
TEST small_vector_test WINDOWS_DISABLED
SOURCES small_vector_test.cpp
TEST sorted_vector_types_test SOURCES sorted_vector_test.cpp
......@@ -732,6 +731,18 @@ if (BUILD_TESTS)
TEST uri_test SOURCES UriTest.cpp
TEST varint_test SOURCES VarintTest.cpp
)
get_target_property(pic folly POSITION_INDEPENDENT_CODE)
if (pic)
add_library(singleton_thread_local_overload
SHARED ${FOLLY_DIR}/test/SingletonThreadLocalTestOverload.cpp)
apply_folly_compile_options_to_target(singleton_thread_local_overload)
set_target_properties(singleton_thread_local_overload PROPERTIES PREFIX "")
target_link_libraries(singleton_thread_local_overload PRIVATE folly)
folly_define_tests(
DIRECTORY test/
TEST singleton_thread_local_test SOURCES SingletonThreadLocalTest.cpp)
endif()
endif()
add_subdirectory(folly)
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