Skip to content

Commit

Permalink
Add Android support (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
KGronek-Pubnub authored Oct 24, 2024
1 parent e2e7691 commit 538879c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 13 deletions.
23 changes: 15 additions & 8 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: c-core
schema: 1
version: "4.14.0"
version: "4.14.1"
scm: github.com/pubnub/c-core
changelog:
- date: 2024-10-24
version: v4.14.1
changes:
- type: bug
text: "Fix CMakeLists to build correctly on Windows."
- type: improvement
text: "Prepare CMakeLists to support builds for Arm64 architecture."
- date: 2024-10-15
version: v4.14.0
changes:
Expand Down Expand Up @@ -868,7 +875,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.14.0
location: https://github.com/pubnub/c-core/releases/tag/v4.14.1
requires:
-
name: "miniz"
Expand Down Expand Up @@ -934,7 +941,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.14.0
location: https://github.com/pubnub/c-core/releases/tag/v4.14.1
requires:
-
name: "miniz"
Expand Down Expand Up @@ -1000,7 +1007,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.14.0
location: https://github.com/pubnub/c-core/releases/tag/v4.14.1
requires:
-
name: "miniz"
Expand Down Expand Up @@ -1062,7 +1069,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.14.0
location: https://github.com/pubnub/c-core/releases/tag/v4.14.1
requires:
-
name: "miniz"
Expand Down Expand Up @@ -1123,7 +1130,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.14.0
location: https://github.com/pubnub/c-core/releases/tag/v4.14.1
requires:
-
name: "miniz"
Expand Down Expand Up @@ -1179,7 +1186,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.14.0
location: https://github.com/pubnub/c-core/releases/tag/v4.14.1
requires:
-
name: "miniz"
Expand Down Expand Up @@ -1232,7 +1239,7 @@ sdks:
distribution-type: source code
distribution-repository: GitHub release
package-name: C-Core
location: https://github.com/pubnub/c-core/releases/tag/v4.14.0
location: https://github.com/pubnub/c-core/releases/tag/v4.14.1
requires:
-
name: "miniz"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## v4.14.1
October 24 2024

#### Fixed
- Fix CMakeLists to build correctly on Windows.

#### Modified
- Prepare CMakeLists to support builds for Arm64 architecture.

## v4.14.0
October 15 2024

Expand Down
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ if(${OPENSSL})
if(WIN32 OR WIN64 OR MSVC)
find_library(OpenSSL REQUIRED NAMES libssl PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH)
find_library(Crypto REQUIRED NAMES libcrypto PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64")
# find_library doesn't work when building for Android architecture
set(OpenSSL "${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR}/libssl.a")
set(Crypto "${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR}/libcrypto.a")
link_libraries(${OpenSSL} ${Crypto})
else()
find_library(OpenSSL REQUIRED NAMES ssl PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH)
find_library(Crypto REQUIRED NAMES crypto PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH)
Expand Down Expand Up @@ -478,9 +483,15 @@ if(${OPENSSL})
${CMAKE_CURRENT_LIST_DIR}/openssl/pbpal_openssl_blocking_io.c
${FEATURE_SOURCEFILES})

set(FEATURE_SOURCEFILES
${CMAKE_CURRENT_LIST_DIR}/openssl/pbauto_heartbeat_init_posix.c
${FEATURE_SOURCEFILES})
if(UNIX)
set(FEATURE_SOURCEFILES
${CMAKE_CURRENT_LIST_DIR}/posix/pbauto_heartbeat_init_posix.c
${FEATURE_SOURCEFILES})
else()
set(FEATURE_SOURCEFILES
${CMAKE_CURRENT_LIST_DIR}/windows/pbauto_heartbeat_init_windows.c
${FEATURE_SOURCEFILES})
endif()

set(LDLIBS ${LDLIBS})

Expand Down Expand Up @@ -537,7 +548,7 @@ if(NOT ESP_PLATFORM)
set(LIBTYPE SHARED)
else()
message(STATUS "Building static library")
set(LIBYTPE STATIC)
set(LIBTYPE STATIC)
endif()

add_library(pubnub ${LIBTYPE} ${SOURCEFILES})
Expand Down
2 changes: 1 addition & 1 deletion core/pubnub_version_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define INC_PUBNUB_VERSION_INTERNAL


#define PUBNUB_SDK_VERSION "4.14.0"
#define PUBNUB_SDK_VERSION "4.14.1"


#endif /* !defined INC_PUBNUB_VERSION_INTERNAL */

0 comments on commit 538879c

Please sign in to comment.