Skip to content

Commit 37a5099

Browse files
michel-slmfacebook-github-bot
authored andcommitted
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
1 parent ed90931 commit 37a5099

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

build/fbcode_builder/CMake/FBThriftCppLibrary.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,14 @@ function(add_fbthrift_cpp_library LIB_NAME THRIFT_FILE)
127127
)
128128

129129
# Now emit the library rule to compile the sources
130+
if (BUILD_SHARED_LIBS)
131+
set(LIB_TYPE SHARED)
132+
else ()
133+
set(LIB_TYPE STATIC)
134+
endif ()
135+
130136
add_library(
131-
"${LIB_NAME}" STATIC
137+
"${LIB_NAME}" ${LIB_TYPE}
132138
${generated_sources}
133139
)
134140

0 commit comments

Comments
 (0)