@hxa-rn/react-native-gcanvas 6.0.25 → 6.0.26
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 +2 -2
- package/LICENSE +203 -21
- package/README.md +5 -5
- package/harmony/gcanvas/LICENSE +203 -21
- package/harmony/gcanvas/NOTICE +32 -32
- package/harmony/gcanvas/OAT.xml +37 -37
- package/harmony/gcanvas/build-profile.json5 +16 -16
- package/harmony/gcanvas/hvigorfile.ts +1 -1
- package/harmony/gcanvas/index.ets +1 -1
- package/harmony/gcanvas/oh-package.json5 +14 -14
- package/harmony/gcanvas/src/main/cpp/CMakeLists.txt +126 -126
- package/harmony/gcanvas/src/main/cpp/GCanvasNapi.cpp +485 -485
- package/harmony/gcanvas/src/main/cpp/GCanvasXComponent.cpp +106 -106
- package/harmony/gcanvas/src/main/cpp/GcanvasPackage.h +24 -24
- package/harmony/gcanvas/src/main/ets/GCanvasModuleTurboModule.ts +448 -448
- package/harmony/gcanvas/src/main/ets/GCanvasNativeEngine.ts +206 -206
- package/harmony/gcanvas/src/main/ets/components/GCanvasView.ets +64 -64
- package/harmony/gcanvas/src/main/module.json5 +21 -21
- package/harmony/gcanvas/src/main/resources/base/element/string.json +12 -12
- package/harmony/gcanvas/src/main/resources/en_US/element/string.json +8 -8
- package/harmony/gcanvas/src/main/resources/zh_CN/element/string.json +12 -12
- package/harmony/gcanvas.har +0 -0
- package/package.json +4 -4
- package/packages/gcanvas/.babelrc +4 -4
- package/packages/gcanvas/.eslintrc.js +133 -133
- package/packages/gcanvas/package.json +19 -19
- package/packages/gcanvas/rollup.config.js +13 -13
- package/packages/gcanvas/src/bridge/react-native.js +286 -286
- package/packages/gcanvas/src/bridge/weex.js +210 -210
- package/packages/gcanvas/src/context/2d/FillStyleLinearGradient.js +16 -16
- package/packages/gcanvas/src/context/2d/FillStylePattern.js +7 -7
- package/packages/gcanvas/src/context/2d/FillStyleRadialGradient.js +16 -16
- package/packages/gcanvas/src/context/2d/OffScreenRenderingContext.js +48 -48
- package/packages/gcanvas/src/context/2d/RenderingContext.js +787 -787
- package/packages/gcanvas/src/context/webgl/ActiveInfo.js +10 -10
- package/packages/gcanvas/src/context/webgl/Buffer.js +20 -20
- package/packages/gcanvas/src/context/webgl/Framebuffer.js +20 -20
- package/packages/gcanvas/src/context/webgl/GLenum.js +300 -300
- package/packages/gcanvas/src/context/webgl/GLmethod.js +141 -141
- package/packages/gcanvas/src/context/webgl/GLtype.js +22 -22
- package/packages/gcanvas/src/context/webgl/Program.js +20 -20
- package/packages/gcanvas/src/context/webgl/Renderbuffer.js +20 -20
- package/packages/gcanvas/src/context/webgl/RenderingContext.js +1479 -1479
- package/packages/gcanvas/src/context/webgl/Shader.js +21 -21
- package/packages/gcanvas/src/context/webgl/ShaderPrecisionFormat.js +10 -10
- package/packages/gcanvas/src/context/webgl/Texture.js +21 -21
- package/packages/gcanvas/src/context/webgl/UniformLocation.js +21 -21
- package/packages/gcanvas/src/context/webgl/classUtils.js +2 -2
- package/packages/gcanvas/src/env/canvas.js +210 -210
- package/packages/gcanvas/src/env/image.js +76 -76
- package/packages/gcanvas/src/env/off-screen-canvas.js +74 -74
- package/packages/gcanvas/src/index.js +56 -56
- package/src/components/CanvasView.js +20 -20
- package/src/components/GCanvasComponent.js +408 -408
- package/src/index.js +69 -69
- package/src/packages/gcanvas/.babelrc +4 -4
- package/src/packages/gcanvas/.eslintrc.js +133 -133
- package/src/packages/gcanvas/package.json +19 -19
- package/src/packages/gcanvas/rollup.config.js +13 -13
- package/src/packages/gcanvas/src/bridge/react-native.js +288 -288
- package/src/packages/gcanvas/src/bridge/weex.js +210 -210
- package/src/packages/gcanvas/src/context/2d/FillStyleLinearGradient.js +16 -16
- package/src/packages/gcanvas/src/context/2d/FillStylePattern.js +7 -7
- package/src/packages/gcanvas/src/context/2d/FillStyleRadialGradient.js +16 -16
- package/src/packages/gcanvas/src/context/2d/OffScreenRenderingContext.js +48 -48
- package/src/packages/gcanvas/src/context/2d/RenderingContext.js +801 -801
- package/src/packages/gcanvas/src/context/webgl/ActiveInfo.js +10 -10
- package/src/packages/gcanvas/src/context/webgl/Buffer.js +20 -20
- package/src/packages/gcanvas/src/context/webgl/Framebuffer.js +20 -20
- package/src/packages/gcanvas/src/context/webgl/GLenum.js +300 -300
- package/src/packages/gcanvas/src/context/webgl/GLmethod.js +141 -141
- package/src/packages/gcanvas/src/context/webgl/GLtype.js +22 -22
- package/src/packages/gcanvas/src/context/webgl/Program.js +20 -20
- package/src/packages/gcanvas/src/context/webgl/Renderbuffer.js +20 -20
- package/src/packages/gcanvas/src/context/webgl/RenderingContext.js +1479 -1479
- package/src/packages/gcanvas/src/context/webgl/Shader.js +21 -21
- package/src/packages/gcanvas/src/context/webgl/ShaderPrecisionFormat.js +10 -10
- package/src/packages/gcanvas/src/context/webgl/Texture.js +21 -21
- package/src/packages/gcanvas/src/context/webgl/UniformLocation.js +21 -21
- package/src/packages/gcanvas/src/context/webgl/classUtils.js +2 -2
- package/src/packages/gcanvas/src/env/canvas.js +210 -210
- package/src/packages/gcanvas/src/env/image.js +76 -76
- package/src/packages/gcanvas/src/env/off-screen-canvas.js +74 -74
- package/src/packages/gcanvas/src/index.js +56 -56
- package/src/specs/v1/GCanvasViewNativeComponent.ts +42 -42
- package/src/specs/v1/NativeGCanvasModule.ts +140 -140
package/harmony/gcanvas/OAT.xml
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<configuration>
|
|
3
|
-
<oatconfig>
|
|
4
|
-
<licensefile>LICENSE</licensefile>
|
|
5
|
-
<filefilterlist>
|
|
6
|
-
<filefilter name="copyrightPolicyFilter" desc="Filters for compatibility,license header policies">
|
|
7
|
-
<filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加版权头"/>
|
|
8
|
-
<filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加版权头"/>
|
|
9
|
-
<filteritem type="filename" name="*.proto" desc="资源文件,不需要添加版权头"/>
|
|
10
|
-
<filteritem type="filename" name="*.json" desc="资源文件,不需要添加版权头"/>
|
|
11
|
-
<filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
12
|
-
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
13
|
-
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
14
|
-
<filteritem type="filename" name="LICENSE" desc="工程文件,不修改版权头"/>
|
|
15
|
-
</filefilter>
|
|
16
|
-
<filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
|
|
17
|
-
<filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加许可证头"/>
|
|
18
|
-
<filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加许可证头"/>
|
|
19
|
-
<filteritem type="filename" name="LICENSE" desc="原三方库证书文件无需更改,因此添加过滤"/>
|
|
20
|
-
<filteritem type="filename" name="*.proto" desc="资源文件,不需要添加许可证头"/>
|
|
21
|
-
<filteritem type="filename" name="*.json" desc="资源文件,不需要添加许可证头"/>
|
|
22
|
-
<filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
23
|
-
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
24
|
-
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
25
|
-
</filefilter>
|
|
26
|
-
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for resources files policies">
|
|
27
|
-
<filteritem type="filename" name="icon.png" desc="应用图标"/>
|
|
28
|
-
<filteritem type="filename" name="app_icon.png" desc="应用图标"/>
|
|
29
|
-
<filteritem type="filename" name="warn.png" desc="页面展示图标"/>
|
|
30
|
-
</filefilter>
|
|
31
|
-
</filefilterlist>
|
|
32
|
-
<policylist>
|
|
33
|
-
<policy name="projectPolicy" desc="">
|
|
34
|
-
<policyitem type="license" name="MIT" path="*.*" desc="license under the MIT"/>
|
|
35
|
-
</policy>
|
|
36
|
-
</policylist>
|
|
37
|
-
</oatconfig>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<configuration>
|
|
3
|
+
<oatconfig>
|
|
4
|
+
<licensefile>LICENSE</licensefile>
|
|
5
|
+
<filefilterlist>
|
|
6
|
+
<filefilter name="copyrightPolicyFilter" desc="Filters for compatibility,license header policies">
|
|
7
|
+
<filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加版权头"/>
|
|
8
|
+
<filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加版权头"/>
|
|
9
|
+
<filteritem type="filename" name="*.proto" desc="资源文件,不需要添加版权头"/>
|
|
10
|
+
<filteritem type="filename" name="*.json" desc="资源文件,不需要添加版权头"/>
|
|
11
|
+
<filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
12
|
+
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
13
|
+
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
14
|
+
<filteritem type="filename" name="LICENSE" desc="工程文件,不修改版权头"/>
|
|
15
|
+
</filefilter>
|
|
16
|
+
<filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
|
|
17
|
+
<filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加许可证头"/>
|
|
18
|
+
<filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加许可证头"/>
|
|
19
|
+
<filteritem type="filename" name="LICENSE" desc="原三方库证书文件无需更改,因此添加过滤"/>
|
|
20
|
+
<filteritem type="filename" name="*.proto" desc="资源文件,不需要添加许可证头"/>
|
|
21
|
+
<filteritem type="filename" name="*.json" desc="资源文件,不需要添加许可证头"/>
|
|
22
|
+
<filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
23
|
+
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
24
|
+
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
|
|
25
|
+
</filefilter>
|
|
26
|
+
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for resources files policies">
|
|
27
|
+
<filteritem type="filename" name="icon.png" desc="应用图标"/>
|
|
28
|
+
<filteritem type="filename" name="app_icon.png" desc="应用图标"/>
|
|
29
|
+
<filteritem type="filename" name="warn.png" desc="页面展示图标"/>
|
|
30
|
+
</filefilter>
|
|
31
|
+
</filefilterlist>
|
|
32
|
+
<policylist>
|
|
33
|
+
<policy name="projectPolicy" desc="">
|
|
34
|
+
<policyitem type="license" name="MIT" path="*.*" desc="license under the MIT"/>
|
|
35
|
+
</policy>
|
|
36
|
+
</policylist>
|
|
37
|
+
</oatconfig>
|
|
38
38
|
</configuration>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"apiType": "stageMode",
|
|
3
|
-
"buildOption": {
|
|
4
|
-
"externalNativeOptions": {
|
|
5
|
-
"path": "./src/main/cpp/CMakeLists.txt",
|
|
6
|
-
"arguments": "",
|
|
7
|
-
"cppFlags": ""
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"targets": [
|
|
11
|
-
{
|
|
12
|
-
"name": "default",
|
|
13
|
-
"runtimeOS": "HarmonyOS"
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"apiType": "stageMode",
|
|
3
|
+
"buildOption": {
|
|
4
|
+
"externalNativeOptions": {
|
|
5
|
+
"path": "./src/main/cpp/CMakeLists.txt",
|
|
6
|
+
"arguments": "",
|
|
7
|
+
"cppFlags": ""
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"targets": [
|
|
11
|
+
{
|
|
12
|
+
"name": "default",
|
|
13
|
+
"runtimeOS": "HarmonyOS"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
|
1
|
+
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
|
2
2
|
export { harTasks } from '@ohos/hvigor-ohos-plugin';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { GcanvasPackage as default } from './src/main/ets/GcanvasTurboModulesFactory';
|
|
1
|
+
export { GcanvasPackage as default } from './src/main/ets/GcanvasTurboModulesFactory';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
"license": "Apache-2.0",
|
|
3
|
-
"devDependencies": {
|
|
4
|
-
|
|
5
|
-
},
|
|
6
|
-
"author": "",
|
|
7
|
-
"name": "@hxa-rn/react-native-gcanvas",
|
|
8
|
-
"description": "Please describe the basic information.",
|
|
9
|
-
"main": "index.ets",
|
|
10
|
-
"version": "1.0.0",
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@rnoh/react-native-openharmony": "file:../react_native_openharmony_release.har"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"license": "Apache-2.0",
|
|
3
|
+
"devDependencies": {
|
|
4
|
+
|
|
5
|
+
},
|
|
6
|
+
"author": "",
|
|
7
|
+
"name": "@hxa-rn/react-native-gcanvas",
|
|
8
|
+
"description": "Please describe the basic information.",
|
|
9
|
+
"main": "index.ets",
|
|
10
|
+
"version": "1.0.0",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@rnoh/react-native-openharmony": "file:../react_native_openharmony_release.har"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
# GCanvas 鸿蒙 C++ 库构建配置。
|
|
2
|
-
cmake_minimum_required(VERSION 3.13)
|
|
3
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
4
|
-
project(gcanvas_library)
|
|
5
|
-
|
|
6
|
-
# The public NAPI/XComponent entry remains libgcanvas.so. The vendored
|
|
7
|
-
# renderer/core is linked into it as a static implementation library.
|
|
8
|
-
set(GCANVAS_WEEX ON)
|
|
9
|
-
|
|
10
|
-
# RNOH/RN 头文件(ViewProps.h 等)使用 std::optional,要求 C++17。
|
|
11
|
-
set(CMAKE_CXX_STANDARD 17)
|
|
12
|
-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
13
|
-
|
|
14
|
-
find_package(react-native-openharmony REQUIRED CONFIG)
|
|
15
|
-
|
|
16
|
-
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/core/CMakeLists.txt")
|
|
17
|
-
add_subdirectory(core)
|
|
18
|
-
set(GCANVAS_CORE_LIB gcanvas_core)
|
|
19
|
-
else()
|
|
20
|
-
set(GCANVAS_CORE_LIB "")
|
|
21
|
-
endif()
|
|
22
|
-
|
|
23
|
-
# 从 imported 目标 rnoh_semi 的库位置反推 RNOH 包根目录。Windows 上可由
|
|
24
|
-
# -DRNOH_PKG_ROOT=<short-path> 覆盖,避免 ohpm 哈希目录触发 MAX_PATH。
|
|
25
|
-
if(NOT DEFINED RNOH_PKG_ROOT)
|
|
26
|
-
get_target_property(_rnoh_semi_loc react-native-openharmony::rnoh_semi IMPORTED_LOCATION)
|
|
27
|
-
get_filename_component(_rnoh_pkg_libdir "${_rnoh_semi_loc}" DIRECTORY) # .../libs/arm64-v8a
|
|
28
|
-
get_filename_component(_rnoh_pkg_libdir "${_rnoh_pkg_libdir}" DIRECTORY) # .../libs
|
|
29
|
-
get_filename_component(RNOH_PKG_ROOT "${_rnoh_pkg_libdir}" DIRECTORY) # <pkg_root>
|
|
30
|
-
endif()
|
|
31
|
-
set(RNOH_CPP_DIR "${RNOH_PKG_ROOT}/src/main/include")
|
|
32
|
-
set(REACT_COMMON_PATCH_DIR "${RNOH_CPP_DIR}/patches/react_native_core")
|
|
33
|
-
|
|
34
|
-
set(library_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
|
|
35
|
-
|
|
36
|
-
# folly F14 链接一致性:FOLLY_MOBILE=1(failure-lessons testing-cmake-004)。
|
|
37
|
-
set(folly_compile_options
|
|
38
|
-
-DFOLLY_NO_CONFIG=1
|
|
39
|
-
-DFOLLY_MOBILE=1
|
|
40
|
-
-DFOLLY_USE_LIBCPP=1
|
|
41
|
-
-DFOLLY_HAVE_RECVMMSG=1
|
|
42
|
-
-DFOLLY_HAVE_PTHREAD=1
|
|
43
|
-
-Wno-comma
|
|
44
|
-
-Wno-shorten-64-to-32
|
|
45
|
-
-faligned-new
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
include_directories(
|
|
49
|
-
${CMAKE_CURRENT_SOURCE_DIR}
|
|
50
|
-
${library_generated_dir}
|
|
51
|
-
${RNOH_CPP_DIR}
|
|
52
|
-
${REACT_COMMON_PATCH_DIR}
|
|
53
|
-
${RNOH_CPP_DIR}/third-party/folly
|
|
54
|
-
${RNOH_CPP_DIR}/third-party/rn/ReactCommon
|
|
55
|
-
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/react/nativemodule/core
|
|
56
|
-
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/jsi
|
|
57
|
-
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/callinvoker
|
|
58
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/utility/include
|
|
59
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/stacktrace/include
|
|
60
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/predef/include
|
|
61
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/array/include
|
|
62
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/throw_exception/include
|
|
63
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/config/include
|
|
64
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/core/include
|
|
65
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/preprocessor/include
|
|
66
|
-
${RNOH_CPP_DIR}/third-party/double-conversion
|
|
67
|
-
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/react/renderer/graphics/platform/cxx
|
|
68
|
-
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/runtimeexecutor
|
|
69
|
-
${RNOH_CPP_DIR}/third-party/glog/src
|
|
70
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/mpl/include
|
|
71
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/type_traits/include
|
|
72
|
-
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/yoga
|
|
73
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/intrusive/include
|
|
74
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/assert/include
|
|
75
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/move/include
|
|
76
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/static_assert/include
|
|
77
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/container_hash/include
|
|
78
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/describe/include
|
|
79
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/mp11/include
|
|
80
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/iterator/include
|
|
81
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/detail/include
|
|
82
|
-
${RNOH_CPP_DIR}/third-party/boost/libs/regex/include
|
|
83
|
-
${RNOH_CPP_DIR}/patches/react_native_core/react/renderer/textlayoutmanager/platform/harmony
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
# 不用 **/*.cpp:OHOS CMake 在 Windows 上常匹配不到 → 空列表 → No SOURCES。
|
|
87
|
-
# Codegen 的 TurboModule 与 Fabric 组件实现必须都进入插件目标;只保留头文件会让
|
|
88
|
-
# Package 虽能注册 descriptor,却在运行/最终链接阶段缺失 Props/EventEmitter vtable。
|
|
89
|
-
file(GLOB_RECURSE library_generated_SRC CONFIGURE_DEPENDS "${library_generated_dir}/*.cpp")
|
|
90
|
-
file(GLOB library_SRC CONFIGURE_DEPENDS *.cpp)
|
|
91
|
-
|
|
92
|
-
add_library(gcanvas SHARED
|
|
93
|
-
${library_SRC}
|
|
94
|
-
${library_generated_SRC}
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
target_compile_options(gcanvas PUBLIC ${folly_compile_options})
|
|
98
|
-
target_compile_options(gcanvas PUBLIC -Wno-unused-command-line-argument)
|
|
99
|
-
# RNOH 预编译 Fabric 库以 NDEBUG ABI 构建(Hvigor 的 debug profile 同样带
|
|
100
|
-
# -DNDEBUG);显式保持一致,避免独立插件构建误启用 React Native debug-only vtable。
|
|
101
|
-
target_compile_definitions(gcanvas PRIVATE OHOS=1 GCANVAS_WEEX=1 NDEBUG)
|
|
102
|
-
|
|
103
|
-
# 链接 RNOH 运行时(TurboModule 代理依赖 ArkTSTurboModule/TurboModule 等符号)与 GL/EGL/字体系统库。
|
|
104
|
-
target_link_libraries(gcanvas PUBLIC
|
|
105
|
-
react-native-openharmony::rnoh_semi
|
|
106
|
-
react-native-openharmony::react_nativemodule_core
|
|
107
|
-
react-native-openharmony::runtimeexecutor
|
|
108
|
-
react-native-openharmony::jsi
|
|
109
|
-
react-native-openharmony::react_utils
|
|
110
|
-
react-native-openharmony::react_render_core
|
|
111
|
-
react-native-openharmony::react_render_graphics
|
|
112
|
-
react-native-openharmony::rrc_view
|
|
113
|
-
${GCANVAS_CORE_LIB}
|
|
114
|
-
libace_napi.z.so # NAPI / XComponent(OH_NativeXComponent_*)
|
|
115
|
-
libace_ndk.z.so # ArkUI NDK
|
|
116
|
-
libhilog_ndk.z.so # OH_LOG_Print 日志
|
|
117
|
-
libEGL.so # Khronos EGL(eglCreateWindowSurface 等)
|
|
118
|
-
libGLESv3.so # OpenGL ES 3.2
|
|
119
|
-
libnative_drawing.so # OH_Drawing_RegisterFont / FontMgr 字体
|
|
120
|
-
libnative_window.so # OHNativeWindow
|
|
121
|
-
libimage_packer.so # toDataURL 图片编码
|
|
122
|
-
libimage_source.so # PixelMap/图片数据
|
|
123
|
-
libpixelmap.so # OH_PixelmapNative
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
target_link_options(gcanvas PRIVATE "-Wl,-z,max-page-size=16384")
|
|
1
|
+
# GCanvas 鸿蒙 C++ 库构建配置。
|
|
2
|
+
cmake_minimum_required(VERSION 3.13)
|
|
3
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
4
|
+
project(gcanvas_library)
|
|
5
|
+
|
|
6
|
+
# The public NAPI/XComponent entry remains libgcanvas.so. The vendored
|
|
7
|
+
# renderer/core is linked into it as a static implementation library.
|
|
8
|
+
set(GCANVAS_WEEX ON)
|
|
9
|
+
|
|
10
|
+
# RNOH/RN 头文件(ViewProps.h 等)使用 std::optional,要求 C++17。
|
|
11
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
12
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
13
|
+
|
|
14
|
+
find_package(react-native-openharmony REQUIRED CONFIG)
|
|
15
|
+
|
|
16
|
+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/core/CMakeLists.txt")
|
|
17
|
+
add_subdirectory(core)
|
|
18
|
+
set(GCANVAS_CORE_LIB gcanvas_core)
|
|
19
|
+
else()
|
|
20
|
+
set(GCANVAS_CORE_LIB "")
|
|
21
|
+
endif()
|
|
22
|
+
|
|
23
|
+
# 从 imported 目标 rnoh_semi 的库位置反推 RNOH 包根目录。Windows 上可由
|
|
24
|
+
# -DRNOH_PKG_ROOT=<short-path> 覆盖,避免 ohpm 哈希目录触发 MAX_PATH。
|
|
25
|
+
if(NOT DEFINED RNOH_PKG_ROOT)
|
|
26
|
+
get_target_property(_rnoh_semi_loc react-native-openharmony::rnoh_semi IMPORTED_LOCATION)
|
|
27
|
+
get_filename_component(_rnoh_pkg_libdir "${_rnoh_semi_loc}" DIRECTORY) # .../libs/arm64-v8a
|
|
28
|
+
get_filename_component(_rnoh_pkg_libdir "${_rnoh_pkg_libdir}" DIRECTORY) # .../libs
|
|
29
|
+
get_filename_component(RNOH_PKG_ROOT "${_rnoh_pkg_libdir}" DIRECTORY) # <pkg_root>
|
|
30
|
+
endif()
|
|
31
|
+
set(RNOH_CPP_DIR "${RNOH_PKG_ROOT}/src/main/include")
|
|
32
|
+
set(REACT_COMMON_PATCH_DIR "${RNOH_CPP_DIR}/patches/react_native_core")
|
|
33
|
+
|
|
34
|
+
set(library_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
|
|
35
|
+
|
|
36
|
+
# folly F14 链接一致性:FOLLY_MOBILE=1(failure-lessons testing-cmake-004)。
|
|
37
|
+
set(folly_compile_options
|
|
38
|
+
-DFOLLY_NO_CONFIG=1
|
|
39
|
+
-DFOLLY_MOBILE=1
|
|
40
|
+
-DFOLLY_USE_LIBCPP=1
|
|
41
|
+
-DFOLLY_HAVE_RECVMMSG=1
|
|
42
|
+
-DFOLLY_HAVE_PTHREAD=1
|
|
43
|
+
-Wno-comma
|
|
44
|
+
-Wno-shorten-64-to-32
|
|
45
|
+
-faligned-new
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
include_directories(
|
|
49
|
+
${CMAKE_CURRENT_SOURCE_DIR}
|
|
50
|
+
${library_generated_dir}
|
|
51
|
+
${RNOH_CPP_DIR}
|
|
52
|
+
${REACT_COMMON_PATCH_DIR}
|
|
53
|
+
${RNOH_CPP_DIR}/third-party/folly
|
|
54
|
+
${RNOH_CPP_DIR}/third-party/rn/ReactCommon
|
|
55
|
+
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/react/nativemodule/core
|
|
56
|
+
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/jsi
|
|
57
|
+
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/callinvoker
|
|
58
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/utility/include
|
|
59
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/stacktrace/include
|
|
60
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/predef/include
|
|
61
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/array/include
|
|
62
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/throw_exception/include
|
|
63
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/config/include
|
|
64
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/core/include
|
|
65
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/preprocessor/include
|
|
66
|
+
${RNOH_CPP_DIR}/third-party/double-conversion
|
|
67
|
+
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/react/renderer/graphics/platform/cxx
|
|
68
|
+
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/runtimeexecutor
|
|
69
|
+
${RNOH_CPP_DIR}/third-party/glog/src
|
|
70
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/mpl/include
|
|
71
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/type_traits/include
|
|
72
|
+
${RNOH_CPP_DIR}/third-party/rn/ReactCommon/yoga
|
|
73
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/intrusive/include
|
|
74
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/assert/include
|
|
75
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/move/include
|
|
76
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/static_assert/include
|
|
77
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/container_hash/include
|
|
78
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/describe/include
|
|
79
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/mp11/include
|
|
80
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/iterator/include
|
|
81
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/detail/include
|
|
82
|
+
${RNOH_CPP_DIR}/third-party/boost/libs/regex/include
|
|
83
|
+
${RNOH_CPP_DIR}/patches/react_native_core/react/renderer/textlayoutmanager/platform/harmony
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# 不用 **/*.cpp:OHOS CMake 在 Windows 上常匹配不到 → 空列表 → No SOURCES。
|
|
87
|
+
# Codegen 的 TurboModule 与 Fabric 组件实现必须都进入插件目标;只保留头文件会让
|
|
88
|
+
# Package 虽能注册 descriptor,却在运行/最终链接阶段缺失 Props/EventEmitter vtable。
|
|
89
|
+
file(GLOB_RECURSE library_generated_SRC CONFIGURE_DEPENDS "${library_generated_dir}/*.cpp")
|
|
90
|
+
file(GLOB library_SRC CONFIGURE_DEPENDS *.cpp)
|
|
91
|
+
|
|
92
|
+
add_library(gcanvas SHARED
|
|
93
|
+
${library_SRC}
|
|
94
|
+
${library_generated_SRC}
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
target_compile_options(gcanvas PUBLIC ${folly_compile_options})
|
|
98
|
+
target_compile_options(gcanvas PUBLIC -Wno-unused-command-line-argument)
|
|
99
|
+
# RNOH 预编译 Fabric 库以 NDEBUG ABI 构建(Hvigor 的 debug profile 同样带
|
|
100
|
+
# -DNDEBUG);显式保持一致,避免独立插件构建误启用 React Native debug-only vtable。
|
|
101
|
+
target_compile_definitions(gcanvas PRIVATE OHOS=1 GCANVAS_WEEX=1 NDEBUG)
|
|
102
|
+
|
|
103
|
+
# 链接 RNOH 运行时(TurboModule 代理依赖 ArkTSTurboModule/TurboModule 等符号)与 GL/EGL/字体系统库。
|
|
104
|
+
target_link_libraries(gcanvas PUBLIC
|
|
105
|
+
react-native-openharmony::rnoh_semi
|
|
106
|
+
react-native-openharmony::react_nativemodule_core
|
|
107
|
+
react-native-openharmony::runtimeexecutor
|
|
108
|
+
react-native-openharmony::jsi
|
|
109
|
+
react-native-openharmony::react_utils
|
|
110
|
+
react-native-openharmony::react_render_core
|
|
111
|
+
react-native-openharmony::react_render_graphics
|
|
112
|
+
react-native-openharmony::rrc_view
|
|
113
|
+
${GCANVAS_CORE_LIB}
|
|
114
|
+
libace_napi.z.so # NAPI / XComponent(OH_NativeXComponent_*)
|
|
115
|
+
libace_ndk.z.so # ArkUI NDK
|
|
116
|
+
libhilog_ndk.z.so # OH_LOG_Print 日志
|
|
117
|
+
libEGL.so # Khronos EGL(eglCreateWindowSurface 等)
|
|
118
|
+
libGLESv3.so # OpenGL ES 3.2
|
|
119
|
+
libnative_drawing.so # OH_Drawing_RegisterFont / FontMgr 字体
|
|
120
|
+
libnative_window.so # OHNativeWindow
|
|
121
|
+
libimage_packer.so # toDataURL 图片编码
|
|
122
|
+
libimage_source.so # PixelMap/图片数据
|
|
123
|
+
libpixelmap.so # OH_PixelmapNative
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
target_link_options(gcanvas PRIVATE "-Wl,-z,max-page-size=16384")
|