-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
74 lines (60 loc) · 1.58 KB
/
CMakeLists.txt
File metadata and controls
74 lines (60 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#
# Copyright (c) react-native-community
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
cmake_minimum_required(VERSION 3.13)
project(jscruntimefactory)
set(CMAKE_VERBOSE_MAKEFILE ON)
set (CMAKE_CXX_STANDARD 20)
string(APPEND CMAKE_CXX_FLAGS
" -fexceptions"
" -frtti"
" -O3"
" -Wno-unused-lambda-capture"
" -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}"
" -DREACT_NATIVE_PATCH_VERSION=${REACT_NATIVE_PATCH_VERSION}"
)
include("${REACT_NATIVE_DIR}/ReactAndroid/cmake-utils/folly-flags.cmake")
add_compile_options(${folly_FLAGS})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
set(PACKAGE_NAME "jscruntimefactory")
set(SRC_DIR "${CMAKE_SOURCE_DIR}/src/main/cpp")
set(COMMON_DIR "${CMAKE_SOURCE_DIR}/../common")
file(GLOB COMMON_SOURCES "${COMMON_DIR}/*.cpp")
add_library(
${PACKAGE_NAME}
SHARED
${COMMON_SOURCES}
"${SRC_DIR}/JSCExecutorFactory.cpp"
"${SRC_DIR}/OnLoad.cpp"
)
# includes
target_include_directories(
${PACKAGE_NAME}
PRIVATE
"${COMMON_DIR}"
"${REACT_NATIVE_DIR}/ReactCommon"
"${REACT_NATIVE_DIR}/ReactCommon/jsiexecutor"
"${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni"
)
# find libraries
find_library(
LOG_LIB
log
)
find_package(fbjni REQUIRED CONFIG)
find_package(jsc-android REQUIRED CONFIG)
find_package(ReactAndroid REQUIRED CONFIG)
# link to shared libraries
target_link_libraries(
${PACKAGE_NAME}
${LOG_LIB}
android
fbjni::fbjni
jsc-android::jsc
ReactAndroid::jsi
ReactAndroid::reactnative
)