8000 Add the ohos macro to the cmakelist,cpp and h files for OpenHarmony cross compilation by SC404 · Pull Request #8085 · realm/realm-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add the ohos macro to the cmakelist,cpp and h files for OpenHarmony cross compilation #8085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,13 @@ set(REALM_HAVE_BACKTRACE ${Backtrace_FOUND})

if(REALM_ENABLE_SYNC)
option(REALM_FORCE_OPENSSL "Always use OpenSSL for SSL needs, regardless of target platform." OFF)
if(CMAKE_SYSTEM_NAME MATCHES "^Windows|Linux|Android")
if(CMAKE_SYSTEM_NAME MATCHES "^Windows|Linux|Android|OHOS")
set(REALM_NEEDS_OPENSSL TRUE)
endif()
if(REALM_NEEDS_OPENSSL OR REALM_FORCE_OPENSSL)
option(REALM_INCLUDE_CERTS "Include a list of trust certificates in the build for OpenSSL certificate verification" ON)
endif()
elseif(REALM_ENABLE_ENCRYPTION AND CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
elseif(REALM_ENABLE_ENCRYPTION AND CMAKE_SYSTEM_NAME MATCHES "Linux|Android|OHOS")
set(REALM_NEEDS_OPENSSL TRUE)
endif()

Expand Down
6 changes: 5 additions & 1 deletion src/realm/util/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@
#if defined ANDROID || defined __ANDROID_API__
#define REALM_ANDROID 1
#define REALM_LINUX 0
#elif defined __OHOS__
#define REALM_ANDROID 0
#define REALM_LINUX 0
#define REALM_OHOS 1
#elif defined(__linux__)
#define REALM_ANDROID 0
#define REALM_LINUX 1
Expand Down Expand Up @@ -275,7 +279,7 @@
#define REALM_APPLE_DEVICE 0
#endif

#if REALM_ANDROID || REALM_IOS || REALM_WATCHOS || REALM_TVOS || REALM_UWP
#if REALM_ANDROID || REALM_IOS || REALM_WATCHOS || REALM_TVOS || REALM_UWP || REALM_OHOS
#define REALM_MOBILE 1
#else
#define REALM_MOBILE 0
Expand Down
4 changes: 4 additions & 0 deletions src/realm/util/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@
#if _POSIX_THREADS >= 200809L
#ifdef __GNU_LIBRARY__
#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 12 && !REALM_ANDROID
#ifndef REALM_OHOS
#define REALM_HAVE_ROBUST_PTHREAD_MUTEX
#endif
#endif
#elif !REALM_ANDROID
#ifndef REALM_OHOS
#define REALM_HAVE_ROBUST_PTHREAD_MUTEX
#endif
#endif
#endif
#endif
#endif


using namespace realm;
Expand Down
0