Commit f817aff7 authored by Davide Cavalca's avatar Davide Cavalca Committed by Facebook GitHub Bot

folly: set shared libraries version

Summary:
This should make packaging folly easier, as it allows one to set the
.so version to denote ABI breaks. Specifically, we're looking to use this in
https://bugzilla.redhat.com/show_bug.cgi?id=1887621 to package folly in Fedora
and have the version match the tagged release version (i.e. treat every release
as ABI breaking).

Differential Revision: D24451669

fbshipit-source-id: f63be760c90567117f1ebbec37416c0d9d8a4736
parent 3b1bdb98
...@@ -38,7 +38,9 @@ set(CMAKE_MODULE_PATH ...@@ -38,7 +38,9 @@ set(CMAKE_MODULE_PATH
# package information # package information
set(PACKAGE_NAME "folly") set(PACKAGE_NAME "folly")
set(PACKAGE_VERSION "0.58.0-dev") if (NOT DEFINED PACKAGE_VERSION)
set(PACKAGE_VERSION "0.58.0-dev")
endif()
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "https://github.com/facebook/folly/issues") set(PACKAGE_BUGREPORT "https://github.com/facebook/folly/issues")
...@@ -378,6 +380,7 @@ option(PYTHON_EXTENSIONS ...@@ -378,6 +380,7 @@ option(PYTHON_EXTENSIONS
add_library(folly add_library(folly
$<TARGET_OBJECTS:folly_base> $<TARGET_OBJECTS:folly_base>
) )
set_property(TARGET folly PROPERTY VERSION ${PACKAGE_VERSION})
apply_folly_compile_options_to_target(folly) apply_folly_compile_options_to_target(folly)
target_compile_features(folly INTERFACE cxx_generic_lambdas) target_compile_features(folly INTERFACE cxx_generic_lambdas)
...@@ -388,6 +391,7 @@ add_library(folly_test_util ...@@ -388,6 +391,7 @@ add_library(folly_test_util
${FOLLY_DIR}/test/DeterministicSchedule.cpp ${FOLLY_DIR}/test/DeterministicSchedule.cpp
${FOLLY_DIR}/test/JsonTestUtil.cpp ${FOLLY_DIR}/test/JsonTestUtil.cpp
) )
set_property(TARGET folly_test_util PROPERTY VERSION ${PACKAGE_VERSION})
target_link_libraries(folly_test_util target_link_libraries(folly_test_util
PUBLIC PUBLIC
${BOOST_LIBRARIES} ${BOOST_LIBRARIES}
......
...@@ -16,6 +16,7 @@ add_library( ...@@ -16,6 +16,7 @@ add_library(
follybenchmark follybenchmark
Benchmark.cpp Benchmark.cpp
) )
set_property(TARGET follybenchmark PROPERTY VERSION ${PACKAGE_VERSION})
target_link_libraries(follybenchmark PUBLIC folly) target_link_libraries(follybenchmark PUBLIC folly)
apply_folly_compile_options_to_target(follybenchmark) apply_folly_compile_options_to_target(follybenchmark)
install( install(
......
...@@ -18,6 +18,7 @@ if (FOLLY_HAVE_ELF AND FOLLY_HAVE_DWARF) ...@@ -18,6 +18,7 @@ if (FOLLY_HAVE_ELF AND FOLLY_HAVE_DWARF)
ExceptionTracer.cpp ExceptionTracer.cpp
StackTrace.cpp StackTrace.cpp
) )
set_property(TARGET folly_exception_tracer_base PROPERTY VERSION ${PACKAGE_VERSION})
apply_folly_compile_options_to_target(folly_exception_tracer_base) apply_folly_compile_options_to_target(folly_exception_tracer_base)
target_link_libraries( target_link_libraries(
folly_exception_tracer_base folly_exception_tracer_base
...@@ -29,6 +30,7 @@ if (FOLLY_HAVE_ELF AND FOLLY_HAVE_DWARF) ...@@ -29,6 +30,7 @@ if (FOLLY_HAVE_ELF AND FOLLY_HAVE_DWARF)
ExceptionStackTraceLib.cpp ExceptionStackTraceLib.cpp
ExceptionTracerLib.cpp ExceptionTracerLib.cpp
) )
set_property(TARGET folly_exception_tracer PROPERTY VERSION ${PACKAGE_VERSION})
apply_folly_compile_options_to_target(folly_exception_tracer) apply_folly_compile_options_to_target(folly_exception_tracer)
target_link_libraries( target_link_libraries(
folly_exception_tracer folly_exception_tracer
...@@ -39,6 +41,7 @@ if (FOLLY_HAVE_ELF AND FOLLY_HAVE_DWARF) ...@@ -39,6 +41,7 @@ if (FOLLY_HAVE_ELF AND FOLLY_HAVE_DWARF)
folly_exception_counter folly_exception_counter
ExceptionCounterLib.cpp ExceptionCounterLib.cpp
) )
set_property(TARGET folly_exception_counter PROPERTY VERSION ${PACKAGE_VERSION})
apply_folly_compile_options_to_target(folly_exception_counter) apply_folly_compile_options_to_target(folly_exception_counter)
target_link_libraries( target_link_libraries(
folly_exception_counter folly_exception_counter
......
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