fbthrift: condition shared libraries on platform setting

This commit is contained in:
Emily 2024-11-13 19:41:11 +00:00
parent dc60c66359
commit 3bdc69269d

View File

@ -55,11 +55,17 @@ stdenv.mkDerivation (finalAttrs: {
(darwinMinVersionHook "11.0")
];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isDarwin then "OFF" else "ON"}"
cmakeFlags =
[
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "thriftpy" false)
];
(lib.cmakeBool "thriftpy" false)
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Homebrew sets this, and the shared library build fails without
# it. I dont know, either. It scares me.
(lib.cmakeFeature "CMAKE_SHARED_LINKER_FLAGS" "-Wl,-undefined,dynamic_lookup")
];
meta = {
description = "Facebook's branch of Apache Thrift";