Commit cfa6e9c6 authored by Michel Salim's avatar Michel Salim Committed by Facebook GitHub Bot

add shared library support to add_fbthrift_cpp_library

Summary:
`add_fbthrift_cpp_library` should honor `BUILD_SHARED_LIBS`, and call
`add_library` with the right setting (`SHARED` if enabled, `STATIC` otherwise)

Reviewed By: yns88

Differential Revision: D24911124

fbshipit-source-id: 79df7640a758a592a3df3e9e79bb129dd57f2d47
parent d4340c0a
...@@ -127,8 +127,14 @@ function(add_fbthrift_cpp_library LIB_NAME THRIFT_FILE) ...@@ -127,8 +127,14 @@ function(add_fbthrift_cpp_library LIB_NAME THRIFT_FILE)
) )
# Now emit the library rule to compile the sources # Now emit the library rule to compile the sources
if (BUILD_SHARED_LIBS)
set(LIB_TYPE SHARED)
else ()
set(LIB_TYPE STATIC)
endif ()
add_library( add_library(
"${LIB_NAME}" STATIC "${LIB_NAME}" ${LIB_TYPE}
${generated_sources} ${generated_sources}
) )
......
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