From cc6f28f7c4a26cb3dc9bec8ecf84ea1afe4c679a Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 20 Sep 2018 09:33:14 -0700 Subject: [PATCH] Link static libraries statically (#277) Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/277 Link all dynamically loaded libraries statically with the exception of libevent. Reviewed By: jknoxville Differential Revision: D9967422 fbshipit-source-id: b33cec5da0c2b34f47217353f205b9d77f1acae2 --- android/third-party/native.gradle | 2 +- android/third-party/overrides/DoubleConversion/CMakeLists.txt | 2 +- android/third-party/overrides/Folly/CMakeLists.txt | 2 +- android/third-party/overrides/RSocket/CMakeLists.txt | 2 +- android/third-party/overrides/glog/CMakeLists.txt | 2 +- xplat/CMakeLists.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/third-party/native.gradle b/android/third-party/native.gradle index b51921221..18aab7ef3 100644 --- a/android/third-party/native.gradle +++ b/android/third-party/native.gradle @@ -4,7 +4,7 @@ import org.apache.tools.ant.filters.ReplaceTokens // Increment this when making changes to any of the native // dependencies. // !!! -final def CACHE_REVISION = 2 +final def CACHE_REVISION = 3 final def externalDir = new File("$projectDir/external") final def downloadsDir = new File("$buildDir/downloads") diff --git a/android/third-party/overrides/DoubleConversion/CMakeLists.txt b/android/third-party/overrides/DoubleConversion/CMakeLists.txt index af6748b35..ccead63ce 100644 --- a/android/third-party/overrides/DoubleConversion/CMakeLists.txt +++ b/android/third-party/overrides/DoubleConversion/CMakeLists.txt @@ -6,6 +6,6 @@ set(PACKAGE_NAME doubleconversion) set(doubleconversion_DIR double-conversion-3.0.0/double-conversion) include_directories(${doubleconversion_DIR}) file(GLOB SRCFILES ${doubleconversion_DIR}/*.cc) -add_library(${PACKAGE_NAME} SHARED ${SRCFILES}) +add_library(${PACKAGE_NAME} STATIC ${SRCFILES}) install(TARGETS ${PACKAGE_NAME} DESTINATION ./build/) target_link_libraries(${PACKAGE_NAME}) diff --git a/android/third-party/overrides/Folly/CMakeLists.txt b/android/third-party/overrides/Folly/CMakeLists.txt index 635432281..e3c4108ae 100644 --- a/android/third-party/overrides/Folly/CMakeLists.txt +++ b/android/third-party/overrides/Folly/CMakeLists.txt @@ -111,7 +111,7 @@ list(APPEND SRC_FILES ${FOLLY_DIR}/io/async/HHWheelTimer.cpp ${FOLLY_DIR}/memory/detail/MallocImpl.cpp ) -add_library(${PACKAGE_NAME} SHARED ${SRC_FILES}) +add_library(${PACKAGE_NAME} STATIC ${SRC_FILES}) set(build_DIR ${CMAKE_SOURCE_DIR}/build) diff --git a/android/third-party/overrides/RSocket/CMakeLists.txt b/android/third-party/overrides/RSocket/CMakeLists.txt index 480d6cd6b..82bb93b7d 100644 --- a/android/third-party/overrides/RSocket/CMakeLists.txt +++ b/android/third-party/overrides/RSocket/CMakeLists.txt @@ -61,7 +61,7 @@ add_compile_options( -Wno-tautological-constant-compare ) -add_library(${PACKAGE_NAME} SHARED ${SRC_FILES}) +add_library(${PACKAGE_NAME} STATIC ${SRC_FILES}) set(build_DIR ${CMAKE_SOURCE_DIR}/build) set(libfolly_build_DIR ${build_DIR}/libfolly/${ANDROID_ABI}) diff --git a/android/third-party/overrides/glog/CMakeLists.txt b/android/third-party/overrides/glog/CMakeLists.txt index 63cbf972d..bdf851da6 100644 --- a/android/third-party/overrides/glog/CMakeLists.txt +++ b/android/third-party/overrides/glog/CMakeLists.txt @@ -39,6 +39,6 @@ list(APPEND src_files ${glog_DIR}/src/demangle.cc ${glog_DIR}/src/vlog_is_on.cc ) -add_library(${PACKAGE_NAME} SHARED ${src_files}) +add_library(${PACKAGE_NAME} STATIC ${src_files}) install(TARGETS ${PACKAGE_NAME} DESTINATION ./build/) target_link_libraries(${PACKAGE_NAME}) diff --git a/xplat/CMakeLists.txt b/xplat/CMakeLists.txt index 90d0201c0..e122085b1 100644 --- a/xplat/CMakeLists.txt +++ b/xplat/CMakeLists.txt @@ -40,7 +40,7 @@ add_compile_options(-DFOLLY_NO_CONFIG file(GLOB SOURCES Sonar/*.cpp) -add_library(${PACKAGE_NAME} SHARED ${SOURCES}) +add_library(${PACKAGE_NAME} STATIC ${SOURCES}) set(build_DIR ${CMAKE_SOURCE_DIR}/build) set(libfolly_build_DIR ${build_DIR}/libfolly/${ANDROID_ABI})