linux bundling fixes

This commit is contained in:
julian
2023-12-29 17:37:19 -06:00
parent b8200b2f99
commit 0bbb19bab3
2 changed files with 6 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.10)
# Project-level configuration.
set(PROJECT_NAME "flutter_libsparkmobile")
set(PROJECT_SYSTEM_NAME "linux")
set(BUILD_FOR_SYSTEM_NAME "linux")
project(${PROJECT_NAME} LANGUAGES CXX)

View File

@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.7 FATAL_ERROR)
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
project(sparkmobile)
if(BUILD_FOR_SYSTEM_NAME STREQUAL "linux")
ADD_DEFINITIONS(-fPIC)
endif()
set(OPENSSL_USE_STATIC_LIBS OFF CACHE BOOL "" FORCE)
if(BUILD_FOR_SYSTEM_NAME STREQUAL "macos" OR BUILD_FOR_SYSTEM_NAME STREQUAL "ios")
@@ -68,7 +72,7 @@ set_property(SOURCE src/spark.cpp
LINK_DIRECTORIES(${OPENSSL_LIBRARIES_DIR})
if(BUILD_FOR_SYSTEM_NAME STREQUAL "ios")
if(BUILD_FOR_SYSTEM_NAME STREQUAL "ios" OR BUILD_FOR_SYSTEM_NAME STREQUAL "linux")
SET(CUSTOM_LIB_TYPE STATIC)
else()
SET(CUSTOM_LIB_TYPE SHARED)