expo-gl 13.4.0 → 13.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/ExpoGL.podspec +2 -2
- package/android/CMakeLists.txt +1 -2
- package/android/build.gradle +7 -40
- package/build/Canvas.d.ts.map +1 -1
- package/build/Canvas.js +8 -4
- package/build/Canvas.js.map +1 -1
- package/package.json +2 -2
- package/src/Canvas.tsx +9 -4
- package/android/legacy/CMakeLists.txt +0 -62
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,25 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 13.6.0 — 2023-12-12
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- Bump C++ compiler setting to C++20. ([#25548](https://github.com/expo/expo/pull/25548) by [@kudo](https://github.com/kudo))
|
|
18
|
+
|
|
19
|
+
## 13.5.0 — 2023-11-14
|
|
20
|
+
|
|
21
|
+
### 🛠 Breaking changes
|
|
22
|
+
|
|
23
|
+
- Bumped iOS deployment target to 13.4. ([#25063](https://github.com/expo/expo/pull/25063) by [@gabrieldonadel](https://github.com/gabrieldonadel))
|
|
24
|
+
- On `Android` bump `compileSdkVersion` and `targetSdkVersion` to `34`. ([#24708](https://github.com/expo/expo/pull/24708) by [@alanjhughes](https://github.com/alanjhughes))
|
|
25
|
+
|
|
26
|
+
### 💡 Others
|
|
27
|
+
|
|
28
|
+
- Use `pointerEvent` style instead of prop for components on web. ([#24931](https://github.com/expo/expo/pull/24931) by [@EvanBacon](https://github.com/EvanBacon))
|
|
29
|
+
- Remove deprecated `REACT_NATIVE_OVERRIDE_VERSION` for React Native nightly testing. ([#25151](https://github.com/expo/expo/pull/25151) by [@kudo](https://github.com/kudo))
|
|
30
|
+
- Removed backward compatible code for deprecated SDKs. ([#25154](https://github.com/expo/expo/pull/25154) by [@kudo](https://github.com/kudo))
|
|
31
|
+
|
|
13
32
|
## 13.4.0 — 2023-10-17
|
|
14
33
|
|
|
15
34
|
### 🛠 Breaking changes
|
package/ExpoGL.podspec
CHANGED
|
@@ -10,14 +10,14 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.platform = :ios, '13.
|
|
13
|
+
s.platform = :ios, '13.4'
|
|
14
14
|
s.source = { git: 'https://github.com/expo/expo-gl.git' }
|
|
15
15
|
s.static_framework = true
|
|
16
16
|
|
|
17
17
|
s.dependency 'ExpoModulesCore'
|
|
18
18
|
s.dependency 'ReactCommon/turbomodule/core'
|
|
19
19
|
|
|
20
|
-
s.compiler_flags = '-x objective-c++ -std=c++
|
|
20
|
+
s.compiler_flags = '-x objective-c++ -std=c++20'
|
|
21
21
|
s.pod_target_xcconfig = {
|
|
22
22
|
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GLES_SILENCE_DEPRECATION=1'
|
|
23
23
|
}
|
package/android/CMakeLists.txt
CHANGED
|
@@ -4,12 +4,11 @@ project(expo-gl)
|
|
|
4
4
|
|
|
5
5
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
6
6
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
7
|
-
set(CMAKE_CXX_STANDARD
|
|
7
|
+
set(CMAKE_CXX_STANDARD 20)
|
|
8
8
|
|
|
9
9
|
set(PACKAGE_NAME "expo-gl")
|
|
10
10
|
set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
|
|
11
11
|
set(COMMON_DIR ${CMAKE_SOURCE_DIR}/../common)
|
|
12
|
-
set(ignoreMe "${REACT_NATIVE_DIR} ${RN_SO_DIR}")
|
|
13
12
|
|
|
14
13
|
add_library(
|
|
15
14
|
${PACKAGE_NAME} SHARED
|
package/android/build.gradle
CHANGED
|
@@ -3,23 +3,9 @@ import java.nio.file.Paths
|
|
|
3
3
|
apply plugin: 'com.android.library'
|
|
4
4
|
apply plugin: 'kotlin-android'
|
|
5
5
|
apply plugin: 'maven-publish'
|
|
6
|
-
apply plugin: "de.undercouch.download"
|
|
7
6
|
|
|
8
7
|
group = 'host.exp.exponent'
|
|
9
|
-
version = '13.
|
|
10
|
-
|
|
11
|
-
def REACT_NATIVE_BUILD_FROM_SOURCE = findProject(":ReactAndroid") != null
|
|
12
|
-
def REACT_NATIVE_DIR = REACT_NATIVE_BUILD_FROM_SOURCE
|
|
13
|
-
? findProject(":ReactAndroid").getProjectDir().parent
|
|
14
|
-
: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent
|
|
15
|
-
def RN_SO_DIR = REACT_NATIVE_BUILD_FROM_SOURCE
|
|
16
|
-
? Paths.get(findProject(":ReactAndroid").getProjectDir().toString(), "build", "intermediates", "library_*", "*", "jni")
|
|
17
|
-
: "${buildDir}/react/jni"
|
|
18
|
-
|
|
19
|
-
def reactProperties = new Properties()
|
|
20
|
-
file("$REACT_NATIVE_DIR/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) }
|
|
21
|
-
def REACT_NATIVE_VERSION = System.getenv("REACT_NATIVE_OVERRIDE_VERSION") ?: reactProperties.getProperty("VERSION_NAME")
|
|
22
|
-
def REACT_NATIVE_TARGET_VERSION = REACT_NATIVE_VERSION.split("\\.")[1].toInteger()
|
|
8
|
+
version = '13.6.0'
|
|
23
9
|
|
|
24
10
|
def reactNativeArchitectures() {
|
|
25
11
|
def value = project.getProperties().get("reactNativeArchitectures")
|
|
@@ -58,7 +44,6 @@ buildscript {
|
|
|
58
44
|
|
|
59
45
|
dependencies {
|
|
60
46
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
61
|
-
classpath("de.undercouch:gradle-download-task:5.3.0")
|
|
62
47
|
}
|
|
63
48
|
}
|
|
64
49
|
|
|
@@ -83,11 +68,11 @@ if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
|
83
68
|
android {
|
|
84
69
|
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
85
70
|
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
86
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
71
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 34)
|
|
87
72
|
|
|
88
73
|
defaultConfig {
|
|
89
74
|
minSdkVersion safeExtGet("minSdkVersion", 23)
|
|
90
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
75
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
91
76
|
}
|
|
92
77
|
|
|
93
78
|
publishing {
|
|
@@ -123,25 +108,19 @@ android {
|
|
|
123
108
|
namespace "expo.modules.gl"
|
|
124
109
|
defaultConfig {
|
|
125
110
|
versionCode 31
|
|
126
|
-
versionName "13.
|
|
111
|
+
versionName "13.6.0"
|
|
127
112
|
|
|
128
113
|
externalNativeBuild {
|
|
129
114
|
cmake {
|
|
130
115
|
abiFilters (*reactNativeArchitectures())
|
|
131
|
-
arguments "-DANDROID_STL=c++_shared"
|
|
132
|
-
"-DREACT_NATIVE_DIR=${REACT_NATIVE_DIR}",
|
|
133
|
-
"-DRN_SO_DIR=${RN_SO_DIR}"
|
|
116
|
+
arguments "-DANDROID_STL=c++_shared"
|
|
134
117
|
}
|
|
135
118
|
}
|
|
136
119
|
}
|
|
137
120
|
|
|
138
121
|
externalNativeBuild {
|
|
139
122
|
cmake {
|
|
140
|
-
|
|
141
|
-
path "CMakeLists.txt"
|
|
142
|
-
} else {
|
|
143
|
-
path "legacy/CMakeLists.txt"
|
|
144
|
-
}
|
|
123
|
+
path "CMakeLists.txt"
|
|
145
124
|
}
|
|
146
125
|
}
|
|
147
126
|
|
|
@@ -174,17 +153,5 @@ dependencies {
|
|
|
174
153
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
175
154
|
}
|
|
176
155
|
|
|
177
|
-
|
|
178
|
-
if (REACT_NATIVE_TARGET_VERSION >= 71) {
|
|
179
|
-
compileOnly 'com.facebook.react:react-android'
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Remove this when we drop SDK 47
|
|
184
|
-
if (REACT_NATIVE_TARGET_VERSION < 71) {
|
|
185
|
-
project.ext.extraLegacyReactNativeLibs = [
|
|
186
|
-
'prepareDoubleConversion',
|
|
187
|
-
'prepareFolly',
|
|
188
|
-
]
|
|
189
|
-
applyLegacyReactNativeLibsExtractionPlugin()
|
|
156
|
+
compileOnly 'com.facebook.react:react-android'
|
|
190
157
|
}
|
package/build/Canvas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAmD,SAAS,EAAE,MAAM,cAAc,CAAC;AA2B1F,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,iBAAiB,CAC1C,SAAS,GAAG;IACV,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACzC,CAyEF,CAAC;AAQF,eAAe,aAAa,CAAC"}
|
package/build/Canvas.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Platform } from 'expo-modules-core';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { findDOMNode } from 'react-dom';
|
|
4
3
|
import { PixelRatio, StyleSheet, View } from 'react-native';
|
|
@@ -23,7 +22,7 @@ function setRef(refProp, ref) {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
const Canvas = React.forwardRef((props, ref) => createElement('canvas', { ...props, ref }));
|
|
26
|
-
const CanvasWrapper = ({ pointerEvents, children, ...props }) => {
|
|
25
|
+
const CanvasWrapper = ({ pointerEvents, children, style, ...props }) => {
|
|
27
26
|
const [size, setSize] = React.useState(null);
|
|
28
27
|
const ref = React.useRef(null);
|
|
29
28
|
const _canvasRef = React.useRef(null);
|
|
@@ -43,7 +42,7 @@ const CanvasWrapper = ({ pointerEvents, children, ...props }) => {
|
|
|
43
42
|
if (size) {
|
|
44
43
|
return size;
|
|
45
44
|
}
|
|
46
|
-
else if (!ref.current ||
|
|
45
|
+
else if (!ref.current || typeof window === 'undefined') {
|
|
47
46
|
return { width: 0, height: 0 };
|
|
48
47
|
}
|
|
49
48
|
const element = getElement(ref.current);
|
|
@@ -74,10 +73,15 @@ const CanvasWrapper = ({ pointerEvents, children, ...props }) => {
|
|
|
74
73
|
}
|
|
75
74
|
setRef(props.canvasRef, canvas);
|
|
76
75
|
}, [_canvasRef]);
|
|
77
|
-
return (<View {...props}
|
|
76
|
+
return (<View {...props} style={[styles.wrapper, style]} ref={ref} onLayout={onLayout}>
|
|
78
77
|
<Canvas ref={_canvasRef} pointerEvents={pointerEvents} style={StyleSheet.absoluteFill}/>
|
|
79
78
|
{children}
|
|
80
79
|
</View>);
|
|
81
80
|
};
|
|
81
|
+
const styles = StyleSheet.create({
|
|
82
|
+
wrapper: {
|
|
83
|
+
pointerEvents: 'box-none',
|
|
84
|
+
},
|
|
85
|
+
});
|
|
82
86
|
export default CanvasWrapper;
|
|
83
87
|
//# sourceMappingURL=Canvas.js.map
|
package/build/Canvas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAqB,UAAU,EAAE,UAAU,EAAE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B,IAAI,GAAG,CAAC,OAAO,IAAI,IAAI,EAAE;YACvB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;SACpB;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,gBAAgB,EAAE,CAAC;IACrB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,MAAM,EAAE;YACV,gBAAgB,EAAE,CAAC;SACpB;QACD,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CACL,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAC5E;MAAA,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,EACtF;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,aAAa,EAAE,UAAU;KAC1B;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { findDOMNode } from 'react-dom';\nimport { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';\nimport createElement from 'react-native-web/dist/exports/createElement';\n\nfunction getElement(component) {\n try {\n return findDOMNode(component);\n } catch {\n return component;\n }\n}\n\nfunction setRef<T>(refProp: React.Ref<T>, ref: T | null) {\n if (!refProp) return;\n\n if (typeof refProp === 'function') {\n refProp(ref);\n } else if ('current' in refProp) {\n // @ts-ignore\n refProp.current = ref;\n }\n}\n\nconst Canvas = React.forwardRef(\n (props: React.ComponentProps<typeof View>, ref: React.Ref<HTMLCanvasElement>) =>\n createElement('canvas', { ...props, ref })\n);\n\nconst CanvasWrapper: React.FunctionComponent<\n ViewProps & {\n canvasRef: React.Ref<HTMLCanvasElement>;\n }\n> = ({ pointerEvents, children, style, ...props }) => {\n const [size, setSize] = React.useState<{ width: number; height: number } | null>(null);\n\n const ref = React.useRef<View>(null);\n const _canvasRef = React.useRef<HTMLCanvasElement>(null);\n\n function updateCanvasSize(): void {\n const canvas = _canvasRef.current;\n // eslint-disable-next-line no-undef\n if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {\n const size = getSize();\n const scale = PixelRatio.get();\n\n canvas.style.width = `${size.width}px`;\n canvas.style.height = `${size.height}px`;\n\n canvas.width = size.width * scale;\n canvas.height = size.height * scale;\n }\n }\n\n function getSize(): { width: number; height: number } {\n if (size) {\n return size;\n } else if (!ref.current || typeof window === 'undefined') {\n return { width: 0, height: 0 };\n }\n const element = getElement(ref.current);\n const { offsetWidth: width = 0, offsetHeight: height = 0 } = element;\n return { width, height };\n }\n\n const onLayout = (event: LayoutChangeEvent) => {\n const {\n nativeEvent: {\n layout: { width, height },\n },\n } = event;\n\n if (width !== size?.width || height !== size.height) {\n setSize({ width, height });\n\n if (props.onLayout) {\n props.onLayout(event);\n }\n }\n };\n\n React.useEffect(() => {\n if (ref.current != null) {\n setSize(getSize());\n }\n }, [ref]);\n\n React.useEffect(() => {\n updateCanvasSize();\n }, [size]);\n\n React.useEffect(() => {\n const canvas = _canvasRef.current;\n if (canvas) {\n updateCanvasSize();\n }\n setRef(props.canvasRef, canvas);\n }, [_canvasRef]);\n\n return (\n <View {...props} style={[styles.wrapper, style]} ref={ref} onLayout={onLayout}>\n <Canvas ref={_canvasRef} pointerEvents={pointerEvents} style={StyleSheet.absoluteFill} />\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n wrapper: {\n pointerEvents: 'box-none',\n },\n});\n\nexport default CanvasWrapper;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-gl",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.6.0",
|
|
4
4
|
"description": "Provides GLView that acts as OpenGL ES render target and gives GL context object implementing WebGL 2.0 specification.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"expo": "*"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "6aca7ce098ddc667776a3d7cf612adbb985e264a"
|
|
53
53
|
}
|
package/src/Canvas.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Platform } from 'expo-modules-core';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { findDOMNode } from 'react-dom';
|
|
4
3
|
import { LayoutChangeEvent, PixelRatio, StyleSheet, View, ViewProps } from 'react-native';
|
|
@@ -32,7 +31,7 @@ const CanvasWrapper: React.FunctionComponent<
|
|
|
32
31
|
ViewProps & {
|
|
33
32
|
canvasRef: React.Ref<HTMLCanvasElement>;
|
|
34
33
|
}
|
|
35
|
-
> = ({ pointerEvents, children, ...props }) => {
|
|
34
|
+
> = ({ pointerEvents, children, style, ...props }) => {
|
|
36
35
|
const [size, setSize] = React.useState<{ width: number; height: number } | null>(null);
|
|
37
36
|
|
|
38
37
|
const ref = React.useRef<View>(null);
|
|
@@ -56,7 +55,7 @@ const CanvasWrapper: React.FunctionComponent<
|
|
|
56
55
|
function getSize(): { width: number; height: number } {
|
|
57
56
|
if (size) {
|
|
58
57
|
return size;
|
|
59
|
-
} else if (!ref.current ||
|
|
58
|
+
} else if (!ref.current || typeof window === 'undefined') {
|
|
60
59
|
return { width: 0, height: 0 };
|
|
61
60
|
}
|
|
62
61
|
const element = getElement(ref.current);
|
|
@@ -99,11 +98,17 @@ const CanvasWrapper: React.FunctionComponent<
|
|
|
99
98
|
}, [_canvasRef]);
|
|
100
99
|
|
|
101
100
|
return (
|
|
102
|
-
<View {...props}
|
|
101
|
+
<View {...props} style={[styles.wrapper, style]} ref={ref} onLayout={onLayout}>
|
|
103
102
|
<Canvas ref={_canvasRef} pointerEvents={pointerEvents} style={StyleSheet.absoluteFill} />
|
|
104
103
|
{children}
|
|
105
104
|
</View>
|
|
106
105
|
);
|
|
107
106
|
};
|
|
108
107
|
|
|
108
|
+
const styles = StyleSheet.create({
|
|
109
|
+
wrapper: {
|
|
110
|
+
pointerEvents: 'box-none',
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
109
114
|
export default CanvasWrapper;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# Remove this legacy folder when we drop SDK 47
|
|
2
|
-
cmake_minimum_required(VERSION 3.4.1)
|
|
3
|
-
|
|
4
|
-
project(expo-gl)
|
|
5
|
-
|
|
6
|
-
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
8
|
-
set(CMAKE_CXX_STANDARD 17)
|
|
9
|
-
|
|
10
|
-
set(PACKAGE_NAME "expo-gl")
|
|
11
|
-
set(BUILD_DIR ${CMAKE_SOURCE_DIR}/../build)
|
|
12
|
-
set(COMMON_DIR ${CMAKE_SOURCE_DIR}/../../common)
|
|
13
|
-
|
|
14
|
-
add_library(
|
|
15
|
-
${PACKAGE_NAME} SHARED
|
|
16
|
-
${COMMON_DIR}/EXGLNativeApi.cpp
|
|
17
|
-
${COMMON_DIR}/EXGLNativeApi.h
|
|
18
|
-
${COMMON_DIR}/EXGLImageUtils.cpp
|
|
19
|
-
${COMMON_DIR}/EXGLImageUtils.h
|
|
20
|
-
${COMMON_DIR}/EXGLNativeContext.cpp
|
|
21
|
-
${COMMON_DIR}/EXGLNativeContext.h
|
|
22
|
-
${COMMON_DIR}/EXGLContextManager.cpp
|
|
23
|
-
${COMMON_DIR}/EXGLContextManager.h
|
|
24
|
-
${COMMON_DIR}/EXWebGLMethods.cpp
|
|
25
|
-
${COMMON_DIR}/EXWebGLMethods.h
|
|
26
|
-
${COMMON_DIR}/EXWebGLRenderer.cpp
|
|
27
|
-
${COMMON_DIR}/EXWebGLRenderer.h
|
|
28
|
-
${COMMON_DIR}/EXTypedArrayApi.cpp
|
|
29
|
-
${COMMON_DIR}/EXTypedArrayApi.h
|
|
30
|
-
../src/main/cpp/EXGLJniApi.cpp)
|
|
31
|
-
|
|
32
|
-
# Extracted AAR: ${BUILD_DIR}/react-native-0*/jni/${ANDROID_ABI}
|
|
33
|
-
file(GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}")
|
|
34
|
-
if(NOT LIBRN_DIR)
|
|
35
|
-
# If /${ANDROID_ABI} dir not found, then ${RN_SO_DIR} is probably:
|
|
36
|
-
# ReactAndroid/build/react-ndk/exported
|
|
37
|
-
file(GLOB LIBRN_DIR "${RN_SO_DIR}")
|
|
38
|
-
endif()
|
|
39
|
-
|
|
40
|
-
target_include_directories(
|
|
41
|
-
${PACKAGE_NAME} PRIVATE "${REACT_NATIVE_DIR}/ReactCommon/jsi"
|
|
42
|
-
"${COMMON_DIR}")
|
|
43
|
-
|
|
44
|
-
find_library(
|
|
45
|
-
JSI_LIB jsi
|
|
46
|
-
PATHS ${LIBRN_DIR}
|
|
47
|
-
NO_CMAKE_FIND_ROOT_PATH)
|
|
48
|
-
|
|
49
|
-
find_library(LOG_LIB log)
|
|
50
|
-
find_library(GLES_LIB GLESv3)
|
|
51
|
-
|
|
52
|
-
target_compile_options(
|
|
53
|
-
${PACKAGE_NAME}
|
|
54
|
-
PRIVATE -O2
|
|
55
|
-
-fexceptions
|
|
56
|
-
-frtti
|
|
57
|
-
-Wall
|
|
58
|
-
-Wextra
|
|
59
|
-
-Wno-unused-parameter
|
|
60
|
-
-Wshorten-64-to-32
|
|
61
|
-
-Wstrict-prototypes)
|
|
62
|
-
target_link_libraries(${PACKAGE_NAME} ${JSI_LIB} ${LOG_LIB} ${GLES_LIB} android)
|