diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 6c780a3623cd7ef38342c44f7ed2bf3100a6f08a..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# tpc_c_cplusplus - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 6cb6dfa9cea496fa05185a0da03ec3f5bf1d5acd..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# tpc_c_cplusplus - -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README_zh.md b/README_zh.md new file mode 100755 index 0000000000000000000000000000000000000000..7bccfe514222db10b0f483e113c9a28750574cbc --- /dev/null +++ b/README_zh.md @@ -0,0 +1,39 @@ +# tpc_c_cplusplus + +#### 简介 +本仓库主要用于存放已经适配OpenHarmony的C/C++三方库的适配脚本,三方库的适配/使用指导;每个三方库目录下包含了GN化的适配指导、编译脚本和包含了cmake的适配指导、编译脚本。 + + + +#### 目录 + +``` +tpc_c_cplusplus +├── README_zh.md +├── common #通用说明文档的文件夹 +├── 三方库1 +│ ├──gn #gn构建脚本、适配指导的文件夹 +│ ├──cmake #cmake构建脚本、适配指导的文件夹 +│ ├──README_zh.md #注意readme中要表明三方库的license +├── 三方库2 +│ ├──gn #gn构建脚本、适配指导的文件夹 +│ ├──cmake #cmake构建脚本、适配指导的文件夹 +│ ├──README_zh.md #注意readme中要表明三方库的license +...... +``` + + + +#### 如何贡献 + +- 为了更好的维护仓库,提交的PR请保持仓库的目录结构,不符合仓库目录结构的PR可能不被合入 +- [遵守OpenHarmony编码贡献规范](https://gitee.com/openharmony-sig/knowledge_demo_smart_home/blob/master/dev/docs/contribute/README.md) + + + +#### 三方库列表 + +工具类 + +- [xerces-c](xerces-c) + diff --git a/common/cmake_build.md b/common/cmake_build.md new file mode 100755 index 0000000000000000000000000000000000000000..f66c62537ee432c6f48bc869294f00644363a64a --- /dev/null +++ b/common/cmake_build.md @@ -0,0 +1,15 @@ +# 三方库引入IDE(DevEco Studio)工程 + +这里以helloworld工程引入三方库为例,如下图: + +![cmake_build](resources/cmake_build.png) + +如上图所示: + +1.将三方库加入到工程目录下; + +2.在工程根目录下的CMakeLists.txt中,使用add_subdirectory命令调用子目录中的CMakeLists.txt来进行编译; + +3.引入三方库头文件,使用include_directories命令指定工程所使用的三方库的头文件的目录; + +4.链接三方库的动态库,注意,生成的三方库动态库名称可以在三方库构建脚本中查到。 \ No newline at end of file diff --git a/common/gn_build.md b/common/gn_build.md new file mode 100755 index 0000000000000000000000000000000000000000..f115bd6956f5fd2d174c6edabc2d05f58589e566 --- /dev/null +++ b/common/gn_build.md @@ -0,0 +1,48 @@ +# 三方库引入GN工程 + +这里以三方库thirdpartyA、动态库名libA的三方库引入到helloworld工程为例: + +三方库thirdpartyA目录结构如下: + +``` +third_party/thirdpartyA +├── src +├── include +├── BUILD.gn +..... +``` + +helloworld工程目录结构如下: + +``` +third_party/helloworld +├── src +├── include +├── BUILD.gn +..... +``` + +在helloworld工程构建脚本中引入三方库thirdpartyA: + +``` +import("//build/ohos.gni") # 导入编译模板 +ohos_executable("helloworld") { # 可执行模块 + sources = [ # 模块源码 + "src/helloworld.c" + ] + include_dirs = [ # 模块依赖头文件目录 + "include" , + “//third_party/thirdpartyA/include”, #依赖三方库头文件的目录 + ] + cflags = [] + cflags_c = [] + cflags_cc = [] + ldflags = [] + configs = [] + deps =[] # 部件内部依赖 + deps += [ “//third_party/thirdpartyA:libA” ] #依赖三方库库文件 + part_name = "hello" # 所属部件名称,必选 + install_enable = true # 是否默认安装(缺省默认不安装),可选 +} +``` + diff --git a/common/gn_compile_build.md b/common/gn_compile_build.md new file mode 100755 index 0000000000000000000000000000000000000000..dc6dba692b5c470f030d519358db28d53adacc34 --- /dev/null +++ b/common/gn_compile_build.md @@ -0,0 +1,109 @@ +# 工程加入OpenHarmony构建体系 + +#### 这里以helloworld工程为例: + +###### 新增工程目录 + +``` +#在源码根目录下创建工程目录 +mkdir ~/openharmony/helloworld + +#在helloworld工程目录下新建源码文件 +touch hello.c + +#编写源文件内容如下 +#include + +void HelloPrint() +{ + printf("\n************************************************\n"); + printf("\n\t\tHello World!\n"); + printf("\n************************************************\n"); +} + +int main(int argc, char **argv) +{ + HelloPrint(); + return 0; +} + + +``` + + + +###### 新增工程构建脚本 + +``` +#在helloworld工程目录下新增BUILD.gn脚本,内容如下 + +import("//build/ohos.gni") +ohos_executable("hello") { + sources = [ + "helloworld.c" + ] + include_dirs = [] + deps = [] + part_name = "hello" + install_enable = true +} +``` + + + +###### 新增组件定义脚本 + +``` +#在helloworld工程目录下新增ohos.build脚本,内容如下 +{ + "subsystem": "helloworld", + "parts": { + "hello": { + "module_list": [ + "//helloworld:hello" + ] + } + } +} +``` + + + +###### 新增产品定义 + +``` +#在vendor目录下新增产品的定义,这里以rk3568为例 +#在openharmony源码根目录下的vendor/hihope/rk3568/config.json,新增如下内容 + { + "subsystem": "helloworld", + "components": [ + { + "component": "hello", + "features": [] + } + ] + } + +``` + + + +###### 新增子系统定义 + +``` +#在openharmony源码根目录下的build/subsystem_config.json中新增子系统定义 + + "helloworld": { + "path": "helloworld", + "name": "helloworld" + } +``` + + + +###### 编译构建 + +``` +hb build +``` + diff --git a/common/resources/cmake_build.png b/common/resources/cmake_build.png new file mode 100755 index 0000000000000000000000000000000000000000..6d4813d7d4243a165ae7e4daffe5ff48e8a89016 Binary files /dev/null and b/common/resources/cmake_build.png differ diff --git a/xerces-c/README_zh.md b/xerces-c/README_zh.md new file mode 100755 index 0000000000000000000000000000000000000000..30cf6858e34333cbc1ab08b1e499c513eadd6472 --- /dev/null +++ b/xerces-c/README_zh.md @@ -0,0 +1,10 @@ +### 三方库xerces-c构建使用指导文档 + +| 三方库 | License | 说明 | +| -------- | ------------------- | --------------------------------- | +| xerces-c | Apache License V2.0 | 该License无强制开放源码义务条款。 | + +本目录是三方库xerces-c的构建脚本目录,内容包括: + +- [gn构建](gn) +- [cmake构建](cmake) \ No newline at end of file diff --git a/xerces-c/cmake/README_zh.md b/xerces-c/cmake/README_zh.md new file mode 100755 index 0000000000000000000000000000000000000000..fa6438e21860e6eb33e308becef81c333fba118d --- /dev/null +++ b/xerces-c/cmake/README_zh.md @@ -0,0 +1,31 @@ +# 三方库xerces-c适配脚本的使用 + + + +#### 三方库源码下载 + +- 下载三方库xerces-c + +        在github上下载xerces-c源码,版本取Tags/v3.2.3 ,[源库地址](https://github.com/apache/xerces-c) + +- 下载三方库icu + +        下载xerces-c的依赖库icu,[下载地址](https://gitee.com/openharmony/third_party_icu) + + + +#### 修改编译脚本 + +- 将三方库third_party_icu拷贝至三方库xerces-c/src下; + +- 将[xerces-c](xerces-c)/config.h拷贝到源库xerces-c目录下; + +- 将[xerces-c](xerces-c)/src/CMakeLists.txt文件替换源库xerces-c/src/CMakeLists.txt文件; + +- 将[xerces-c](xerces-c)/src/third_party_icu/CMakeLists.txt文件替换源库xerces-c/src/third_party_icu/CMakeLists.txt文件; + + + +#### 相关资料 + +[三方库引入IDE(DevEco Studio)工程](../../common/cmake_build.md) \ No newline at end of file diff --git a/xerces-c/cmake/xerces-c/config.h b/xerces-c/cmake/xerces-c/config.h new file mode 100755 index 0000000000000000000000000000000000000000..aa261252fdabe03a2cc3adda2e1dffc2b08827f7 --- /dev/null +++ b/xerces-c/cmake/xerces-c/config.h @@ -0,0 +1,506 @@ +/* +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/ + + +/* config.h.cmake.in. Not generated, but originated from autoheader. */ +/* This file must be kept up-to-date with needed substitutions from config.h.in. */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CSTDINT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +#if defined(__cplusplus) && defined(HAVE_CSTDINT) +#include +#elif HAVE_STDINT_H +#include +#elif HAVE_INTTYPES_H +#include +#endif + +/* Define to specify no threading is used */ +/* #undef APP_NO_THREADS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_NAMESER_COMPAT_H 1 + +/* define if bool is a built-in type */ +#define HAVE_BOOL 1 + +/* Define to 1 if you have the `catclose' function. */ +#define HAVE_CATCLOSE 1 + +/* Define to 1 if you have the `catgets' function. */ +#define HAVE_CATGETS 1 + +/* Define to 1 if you have the `catopen' function. */ +#define HAVE_CATOPEN 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have cpuid.h */ +/* #undef HAVE_CPUID_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FLOAT_H 1 + +/* Define to 1 if you have the `ftime' function. */ +#define HAVE_FTIME 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `gethostbyaddr' function. */ +#define HAVE_GETHOSTBYADDR 1 + +/* Define to 1 if you have the `gethostbyname' function. */ +#define HAVE_GETHOSTBYNAME 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + +/* Define to 1 if you have the `iconv' function. */ +#define HAVE_ICONV 1 + +/* Define to 1 if you have the `iconv_close' function. */ +#define HAVE_ICONV_CLOSE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ICONV_H 1 + +/* Define to 1 if you have the `iconv_open' function. */ +#define HAVE_ICONV_OPEN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +#define HAVE_LIBNSL 1 + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `localeconv' function. */ +#define HAVE_LOCALECONV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* define if the compiler implements L"widestring" */ +#define HAVE_LSTRING 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_ENDIAN_H */ + +/* Define to 1 if you have the `mblen' function. */ +#define HAVE_MBLEN 1 + +/* Define to 1 if you have the `mbrlen' function. */ +#define HAVE_MBRLEN 1 + +/* Define to 1 if you have the `mbsrtowcs' function. */ +#define HAVE_MBSRTOWCS 1 + +/* Define to 1 if you have the `mbstowcs' function. */ +#define HAVE_MBSTOWCS 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NL_TYPES_H 1 + +/* Define to 1 if you have the `pathconf' function. */ +#define HAVE_PATHCONF 1 + +/* Define to 1 if you have the PATH_MAX macro. */ +#define HAVE_PATH_MAX 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the `realpath' function. */ +#define HAVE_REALPATH 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if stdbool.h conforms to C99. */ +/* #undef HAVE_STDBOOL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* define if the compiler supports ISO C++ standard library */ +#define HAVE_STD_LIBS 1 + +/* define if the compiler supports the std namespace */ +#define HAVE_STD_NAMESPACE 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `stricmp' function. */ +/* #undef HAVE_STRICMP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncasecmp' function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the `strnicmp' function. */ +/* #undef HAVE_STRNICMP */ + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the `strstr' function. */ +#define HAVE_STRSTR 1 + +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIMEB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `timegm' function. */ +#define HAVE_TIMEGM 1 + +/* Define to 1 if you have the `towlower' function. */ +#define HAVE_TOWLOWER 1 + +/* Define to 1 if you have the `towupper' function. */ +#define HAVE_TOWUPPER 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the `wcsicmp' function. */ +/* #undef HAVE_WCSICMP */ + +/* Define to 1 if you have the `wcslwr' function. */ +/* #undef HAVE_WCSLWR */ + +/* Define to 1 if you have the `wcsnicmp' function. */ +/* #undef HAVE_WCSNICMP */ + +/* Define to 1 if you have the `wcsrtombs' function. */ +#define HAVE_WCSRTOMBS 1 + +/* Define to 1 if you have the `wcstombs' function. */ +#define HAVE_WCSTOMBS 1 + +/* Define to 1 if you have the `wcsupr' function. */ +/* #undef HAVE_WCSUPR */ + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINSOCK2_H */ + +/* Define to 1 if you have to use const char* with iconv, to 0 if you must use + char*. */ +#define ICONV_USES_CONST_POINTER 0 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "xerces-c" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "xerces-c" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "xerces-c 3.2.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "xerces-c" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.2.3" + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `wchar_t', as computed by sizeof. */ +#define SIZEOF_WCHAR_T 4 + +/* The size of `__int64', as computed by sizeof. */ +#define SIZEOF___INT64 0 + +/* Version number of package */ +#define VERSION "3.2.3" + +/* Define if DLL symbols should be exported */ +/* #undef XERCES_DLL_EXPORT */ + +/* Define if namespaces is supported by the compiler */ +#define XERCES_HAS_CPP_NAMESPACE 1 + +/* Define to have SSE2 instruction support detected at runtime using __cpuid + */ +/* #undef XERCES_HAVE_CPUID_INTRINSIC */ + +/* Define to 1 if you have emmintrin.h */ +/* #undef XERCES_HAVE_EMMINTRIN_H */ + +/* Define to have SSE2 instruction support detected at runtime using + __get_cpuid */ +/* #undef XERCES_HAVE_GETCPUID */ + +/* Define to 1 if you have intrin.h */ +/* #undef XERCES_HAVE_INTRIN_H */ + +/* Define to 1 if we have inttypes.h */ +#define XERCES_HAVE_INTTYPES_H 1 + +/* Define to have SSE2 instruction used at runtime */ +/* #undef XERCES_HAVE_SSE2_INTRINSIC */ + +/* Define to 1 if we have sys/types.h */ +#define XERCES_HAVE_SYS_TYPES_H 1 + +/* Define to have Xerces_autoconf_config.hpp include wchar.h */ +/* #undef XERCES_INCLUDE_WCHAR_H */ + +/* Define if there is support for L"widestring" */ +#define XERCES_LSTRSUPPORT 1 + +/* Define if the isstream library can be included as */ +#define XERCES_NEW_IOSTREAMS 1 + +/* Define to have XMemory.hpp avoid declaring a matching operator delete for + the placement operator new */ +/* #undef XERCES_NO_MATCHING_DELETE_OPERATOR */ + +/* Define if there is no native bool support in this environment */ +/* #undef XERCES_NO_NATIVE_BOOL */ + +/* Define to use backslash as an extra path delimiter character */ +/* #undef XERCES_PATH_DELIMITER_BACKSLASH */ + +/* Define as the platform's export attribute */ +#define XERCES_PLATFORM_EXPORT + +/* Define as the platform's import attribute */ +#define XERCES_PLATFORM_IMPORT + +/* An appropriate signed 16 bit integer type */ +#define XERCES_S16BIT_INT int16_t + +/* An appropriate signed 32 bit integer type */ +#define XERCES_S32BIT_INT int32_t + +/* An appropriate signed 64 bit integer type */ +#define XERCES_S64BIT_INT int64_t + +/* Define as the appropriate SIZE_MAX macro */ +#define XERCES_SIZE_MAX SIZE_MAX + +/* Define as the appropriate size_t type */ +#define XERCES_SIZE_T size_t + +/* Define as the appropriate SSIZE_MAX macro */ +#define XERCES_SSIZE_MAX SSIZE_MAX + +/* Define as the appropriate ssize_t type */ +#define XERCES_SSIZE_T ssize_t + +/* Define if building a static library */ +/* #undef XERCES_STATIC_LIBRARY */ + +/* Define if the std namespace is supported */ +#define XERCES_STD_NAMESPACE 1 + +/* An appropriate unsigned 16 bit integer type */ +#define XERCES_U16BIT_INT uint16_t + +/* An appropriate unsigned 32 bit integer type */ +#define XERCES_U32BIT_INT uint32_t + +/* An appropriate unsigned 64 bit integer type */ +#define XERCES_U64BIT_INT uint64_t + +/* Define to use the POSIX file mgr */ +#define XERCES_USE_FILEMGR_POSIX 1 + +/* Define to use the Windows file mgr */ +/* #undef XERCES_USE_FILEMGR_WINDOWS */ + +/* Define to use the iconv-based MsgLoader */ +/* #undef XERCES_USE_MSGLOADER_ICONV */ + +/* Define to use the ICU-based MsgLoader */ +/* #undef XERCES_USE_MSGLOADER_ICU */ + +/* Define to use the InMemory MsgLoader */ +#define XERCES_USE_MSGLOADER_INMEMORY 1 + +/* Define to use the NoThread mutex mgr */ +/* #undef XERCES_USE_MUTEXMGR_NOTHREAD */ + +/* Define to use the C++11 standard mutex mgr */ +#define XERCES_USE_MUTEXMGR_STD 1 + +/* Define to use the POSIX mutex mgr */ +/* #undef XERCES_USE_MUTEXMGR_POSIX */ + +/* Define to use the Windows mutex mgr */ +/* #undef XERCES_USE_MUTEXMGR_WINDOWS */ + +/* Define to use the Mac OS X CFURL NetAccessor */ +/* #undef XERCES_USE_NETACCESSOR_CFURL */ + +/* Define to use the CURL NetAccessor */ +/* #undef XERCES_USE_NETACCESSOR_CURL */ + +/* Define to use the Sockets-based NetAccessor */ +#define XERCES_USE_NETACCESSOR_SOCKET 1 + +/* Define to use the WinSock NetAccessor */ +/* #undef XERCES_USE_NETACCESSOR_WINSOCK */ + +/* Define to use the GNU iconv transcoder */ +/* #undef XERCES_USE_TRANSCODER_GNUICONV */ + +/* Define to use the iconv transcoder */ +/* #undef XERCES_USE_TRANSCODER_ICONV */ + +/* Define to use the ICU-based transcoder */ +#define XERCES_USE_TRANSCODER_ICU 1 + +/* Define to use the Mac OS UnicodeConverter-based transcoder */ +/* #undef XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER */ + +/* Define to use the Windows transcoder */ +/* #undef XERCES_USE_TRANSCODER_WINDOWS */ + +/* Define to the 16 bit type used to represent Xerces UTF-16 characters */ +#define XERCES_XMLCH_T char16_t + + diff --git a/xerces-c/cmake/xerces-c/src/CMakeLists.txt b/xerces-c/cmake/xerces-c/src/CMakeLists.txt new file mode 100755 index 0000000000000000000000000000000000000000..5868f071c25e89ee61fc33946eaefaf300c661ba --- /dev/null +++ b/xerces-c/cmake/xerces-c/src/CMakeLists.txt @@ -0,0 +1,330 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_CXX_STANDARD 17) +project(xerces) + +add_subdirectory(third_party_icu) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-memset-transposed-args -fPIC -std=c++17 -Wno-unused-command-line-argument -frtti -fexceptions -DHAVE_CONFIG_H=1 -DXERCES_BUILDING_LIBRARY=1 -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE=1 -Dxerces_c_EXPORTS") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wno-unused-command-line-argument -DHAVE_CONFIG_H=1 -DXERCES_BUILDING_LIBRARY=1 -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE=1 -Dxerces_c_EXPORTS") + +#message(WARNING "${CMAKE_CXX_FLAGS}") +set(src "xercesc/util/Base64.cpp" + "xercesc/util/BinFileInputStream.cpp" + "xercesc/util/BinInputStream.cpp" + "xercesc/util/BinMemInputStream.cpp" + "xercesc/util/BitSet.cpp" + "xercesc/util/DefaultPanicHandler.cpp" + "xercesc/util/EncodingValidator.cpp" + "xercesc/util/HeaderDummy.cpp" + "xercesc/util/HexBin.cpp" + "xercesc/util/JanitorExports.cpp" + "xercesc/util/KVStringPair.cpp" + "xercesc/util/Mutexes.cpp" + "xercesc/util/PanicHandler.cpp" + "xercesc/util/PlatformUtils.cpp" + "xercesc/util/PSVIUni.cpp" + "xercesc/util/QName.cpp" + "xercesc/util/regx/ASCIIRangeFactory.cpp" + "xercesc/util/regx/BlockRangeFactory.cpp" + "xercesc/util/regx/BMPattern.cpp" + "xercesc/util/regx/CharToken.cpp" + "xercesc/util/regx/ClosureToken.cpp" + "xercesc/util/regx/ConcatToken.cpp" + "xercesc/util/regx/Match.cpp" + "xercesc/util/regx/Op.cpp" + "xercesc/util/regx/OpFactory.cpp" + "xercesc/util/regx/ParenToken.cpp" + "xercesc/util/regx/ParserForXMLSchema.cpp" + "xercesc/util/regx/RangeFactory.cpp" + "xercesc/util/regx/RangeToken.cpp" + "xercesc/util/regx/RangeTokenMap.cpp" + "xercesc/util/regx/RegularExpression.cpp" + "xercesc/util/regx/RegxParser.cpp" + "xercesc/util/regx/RegxUtil.cpp" + "xercesc/util/regx/StringToken.cpp" + "xercesc/util/regx/Token.cpp" + "xercesc/util/regx/TokenFactory.cpp" + "xercesc/util/regx/UnicodeRangeFactory.cpp" + "xercesc/util/regx/UnionToken.cpp" + "xercesc/util/regx/XMLRangeFactory.cpp" + "xercesc/util/regx/XMLUniCharacter.cpp" + "xercesc/util/StringPool.cpp" + "xercesc/util/SynchronizedStringPool.cpp" + "xercesc/util/TransService.cpp" + "xercesc/util/XMemory.cpp" + "xercesc/util/XML256TableTranscoder.cpp" + "xercesc/util/XML88591Transcoder.cpp" + "xercesc/util/XMLAbstractDoubleFloat.cpp" + "xercesc/util/XMLASCIITranscoder.cpp" + "xercesc/util/XMLBigDecimal.cpp" + "xercesc/util/XMLBigInteger.cpp" + "xercesc/util/XMLChar.cpp" + "xercesc/util/XMLChTranscoder.cpp" + "xercesc/util/XMLDateTime.cpp" + "xercesc/util/XMLDouble.cpp" + "xercesc/util/XMLEBCDICTranscoder.cpp" + "xercesc/util/XMLException.cpp" + "xercesc/util/XMLFloat.cpp" + "xercesc/util/XMLIBM1047Transcoder.cpp" + "xercesc/util/XMLIBM1140Transcoder.cpp" + "xercesc/util/XMLInitializer.cpp" + "xercesc/util/XMLMsgLoader.cpp" + "xercesc/util/XMLNumber.cpp" + "xercesc/util/XMLString.cpp" + "xercesc/util/XMLStringTokenizer.cpp" + "xercesc/util/XMLUCS4Transcoder.cpp" + "xercesc/util/XMLUni.cpp" + "xercesc/util/XMLUri.cpp" + "xercesc/util/XMLURL.cpp" + "xercesc/util/XMLUTF16Transcoder.cpp" + "xercesc/util/XMLUTF8Transcoder.cpp" + "xercesc/util/XMLWin1252Transcoder.cpp" + "xercesc/dom/DOMException.cpp" + "xercesc/dom/DOMLSException.cpp" + "xercesc/dom/DOMRangeException.cpp" + "xercesc/dom/DOMXPathException.cpp" + "xercesc/dom/impl/DOMAttrImpl.cpp" + "xercesc/dom/impl/DOMAttrMapImpl.cpp" + "xercesc/dom/impl/DOMAttrNSImpl.cpp" + "xercesc/dom/impl/DOMCDATASectionImpl.cpp" + "xercesc/dom/impl/DOMCharacterDataImpl.cpp" + "xercesc/dom/impl/DOMChildNode.cpp" + "xercesc/dom/impl/DOMCommentImpl.cpp" + "xercesc/dom/impl/DOMConfigurationImpl.cpp" + "xercesc/dom/impl/DOMDeepNodeListImpl.cpp" + "xercesc/dom/impl/DOMDocumentFragmentImpl.cpp" + "xercesc/dom/impl/DOMDocumentImpl.cpp" + "xercesc/dom/impl/DOMDocumentTypeImpl.cpp" + "xercesc/dom/impl/DOMElementImpl.cpp" + "xercesc/dom/impl/DOMElementNSImpl.cpp" + "xercesc/dom/impl/DOMEntityImpl.cpp" + "xercesc/dom/impl/DOMEntityReferenceImpl.cpp" + "xercesc/dom/impl/DOMErrorImpl.cpp" + "xercesc/dom/impl/DOMImplementationImpl.cpp" + "xercesc/dom/impl/DOMImplementationListImpl.cpp" + "xercesc/dom/impl/DOMImplementationRegistry.cpp" + "xercesc/dom/impl/DOMLocatorImpl.cpp" + "xercesc/dom/impl/DOMNamedNodeMapImpl.cpp" + "xercesc/dom/impl/DOMNodeIDMap.cpp" + "xercesc/dom/impl/DOMNodeImpl.cpp" + "xercesc/dom/impl/DOMNodeIteratorImpl.cpp" + "xercesc/dom/impl/DOMNodeListImpl.cpp" + "xercesc/dom/impl/DOMNodeVector.cpp" + "xercesc/dom/impl/DOMNormalizer.cpp" + "xercesc/dom/impl/DOMNotationImpl.cpp" + "xercesc/dom/impl/DOMParentNode.cpp" + "xercesc/dom/impl/DOMProcessingInstructionImpl.cpp" + "xercesc/dom/impl/DOMRangeImpl.cpp" + "xercesc/dom/impl/DOMStringListImpl.cpp" + "xercesc/dom/impl/DOMStringPool.cpp" + "xercesc/dom/impl/DOMTextImpl.cpp" + "xercesc/dom/impl/DOMTreeWalkerImpl.cpp" + "xercesc/dom/impl/DOMTypeInfoImpl.cpp" + "xercesc/dom/impl/DOMLSSerializerImpl.cpp" + "xercesc/dom/impl/DOMLSInputImpl.cpp" + "xercesc/dom/impl/DOMLSOutputImpl.cpp" + "xercesc/dom/impl/DOMXPathExpressionImpl.cpp" + "xercesc/dom/impl/DOMXPathNSResolverImpl.cpp" + "xercesc/dom/impl/DOMXPathResultImpl.cpp" + "xercesc/dom/impl/XSDElementNSImpl.cpp" + "xercesc/framework/BinOutputStream.cpp" + "xercesc/framework/LocalFileFormatTarget.cpp" + "xercesc/framework/LocalFileInputSource.cpp" + "xercesc/framework/MemBufFormatTarget.cpp" + "xercesc/framework/MemBufInputSource.cpp" + "xercesc/framework/psvi/PSVIAttribute.cpp" + "xercesc/framework/psvi/PSVIAttributeList.cpp" + "xercesc/framework/psvi/PSVIElement.cpp" + "xercesc/framework/psvi/PSVIItem.cpp" + "xercesc/framework/psvi/XSAnnotation.cpp" + "xercesc/framework/psvi/XSAttributeDeclaration.cpp" + "xercesc/framework/psvi/XSAttributeGroupDefinition.cpp" + "xercesc/framework/psvi/XSAttributeUse.cpp" + "xercesc/framework/psvi/XSComplexTypeDefinition.cpp" + "xercesc/framework/psvi/XSElementDeclaration.cpp" + "xercesc/framework/psvi/XSFacet.cpp" + "xercesc/framework/psvi/XSIDCDefinition.cpp" + "xercesc/framework/psvi/XSModel.cpp" + "xercesc/framework/psvi/XSModelGroup.cpp" + "xercesc/framework/psvi/XSModelGroupDefinition.cpp" + "xercesc/framework/psvi/XSMultiValueFacet.cpp" + "xercesc/framework/psvi/XSNamespaceItem.cpp" + "xercesc/framework/psvi/XSNotationDeclaration.cpp" + "xercesc/framework/psvi/XSObject.cpp" + "xercesc/framework/psvi/XSParticle.cpp" + "xercesc/framework/psvi/XSSimpleTypeDefinition.cpp" + "xercesc/framework/psvi/XSTypeDefinition.cpp" + "xercesc/framework/psvi/XSValue.cpp" + "xercesc/framework/psvi/XSWildcard.cpp" + "xercesc/framework/StdInInputSource.cpp" + "xercesc/framework/StdOutFormatTarget.cpp" + "xercesc/framework/URLInputSource.cpp" + "xercesc/framework/Wrapper4DOMLSInput.cpp" + "xercesc/framework/Wrapper4InputSource.cpp" + "xercesc/framework/XMLAttDef.cpp" + "xercesc/framework/XMLAttDefList.cpp" + "xercesc/framework/XMLAttr.cpp" + "xercesc/framework/XMLBuffer.cpp" + "xercesc/framework/XMLBufferMgr.cpp" + "xercesc/framework/XMLContentModel.cpp" + "xercesc/framework/XMLDTDDescription.cpp" + "xercesc/framework/XMLElementDecl.cpp" + "xercesc/framework/XMLEntityDecl.cpp" + "xercesc/framework/XMLFormatter.cpp" + "xercesc/framework/XMLGrammarDescription.cpp" + "xercesc/framework/XMLGrammarPoolImpl.cpp" + "xercesc/framework/XMLNotationDecl.cpp" + "xercesc/framework/XMLRecognizer.cpp" + "xercesc/framework/XMLRefInfo.cpp" + "xercesc/framework/XMLSchemaDescription.cpp" + "xercesc/framework/XMLValidator.cpp" + "xercesc/internal/BinFileOutputStream.cpp" + "xercesc/internal/BinMemOutputStream.cpp" + "xercesc/internal/DGXMLScanner.cpp" + "xercesc/internal/ElemStack.cpp" + "xercesc/internal/IGXMLScanner.cpp" + "xercesc/internal/IGXMLScanner2.cpp" + "xercesc/internal/MemoryManagerImpl.cpp" + "xercesc/internal/ReaderMgr.cpp" + "xercesc/internal/SGXMLScanner.cpp" + "xercesc/internal/ValidationContextImpl.cpp" + "xercesc/internal/VecAttributesImpl.cpp" + "xercesc/internal/VecAttrListImpl.cpp" + "xercesc/internal/WFXMLScanner.cpp" + "xercesc/internal/XMLReader.cpp" + "xercesc/internal/XMLScanner.cpp" + "xercesc/internal/XMLScannerResolver.cpp" + "xercesc/internal/XProtoType.cpp" + "xercesc/internal/XSAXMLScanner.cpp" + "xercesc/internal/XSerializeEngine.cpp" + "xercesc/internal/XSObjectFactory.cpp" + "xercesc/internal/XTemplateSerializer.cpp" + "xercesc/parsers/AbstractDOMParser.cpp" + "xercesc/parsers/DOMLSParserImpl.cpp" + "xercesc/parsers/SAX2XMLFilterImpl.cpp" + "xercesc/parsers/SAX2XMLReaderImpl.cpp" + "xercesc/parsers/SAXParser.cpp" + "xercesc/parsers/XercesDOMParser.cpp" + "xercesc/sax/Dummy.cpp" + "xercesc/sax/InputSource.cpp" + "xercesc/sax/SAXException.cpp" + "xercesc/sax/SAXParseException.cpp" + "xercesc/sax2/sax2Dummy.cpp" + "xercesc/validators/common/AllContentModel.cpp" + "xercesc/validators/common/CMAny.cpp" + "xercesc/validators/common/CMBinaryOp.cpp" + "xercesc/validators/common/CMUnaryOp.cpp" + "xercesc/validators/common/ContentLeafNameTypeVector.cpp" + "xercesc/validators/common/ContentSpecNode.cpp" + "xercesc/validators/common/DFAContentModel.cpp" + "xercesc/validators/common/Grammar.cpp" + "xercesc/validators/common/GrammarResolver.cpp" + "xercesc/validators/common/MixedContentModel.cpp" + "xercesc/validators/common/SimpleContentModel.cpp" + "xercesc/validators/datatype/AbstractNumericFacetValidator.cpp" + "xercesc/validators/datatype/AbstractNumericValidator.cpp" + "xercesc/validators/datatype/AbstractStringValidator.cpp" + "xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp" + "xercesc/validators/datatype/AnyURIDatatypeValidator.cpp" + "xercesc/validators/datatype/Base64BinaryDatatypeValidator.cpp" + "xercesc/validators/datatype/BooleanDatatypeValidator.cpp" + "xercesc/validators/datatype/DatatypeValidator.cpp" + "xercesc/validators/datatype/DatatypeValidatorFactory.cpp" + "xercesc/validators/datatype/DateDatatypeValidator.cpp" + "xercesc/validators/datatype/DateTimeDatatypeValidator.cpp" + "xercesc/validators/datatype/DateTimeValidator.cpp" + "xercesc/validators/datatype/DayDatatypeValidator.cpp" + "xercesc/validators/datatype/DecimalDatatypeValidator.cpp" + "xercesc/validators/datatype/DoubleDatatypeValidator.cpp" + "xercesc/validators/datatype/DurationDatatypeValidator.cpp" + "xercesc/validators/datatype/ENTITYDatatypeValidator.cpp" + "xercesc/validators/datatype/FloatDatatypeValidator.cpp" + "xercesc/validators/datatype/HexBinaryDatatypeValidator.cpp" + "xercesc/validators/datatype/IDDatatypeValidator.cpp" + "xercesc/validators/datatype/IDREFDatatypeValidator.cpp" + "xercesc/validators/datatype/ListDatatypeValidator.cpp" + "xercesc/validators/datatype/MonthDatatypeValidator.cpp" + "xercesc/validators/datatype/MonthDayDatatypeValidator.cpp" + "xercesc/validators/datatype/NameDatatypeValidator.cpp" + "xercesc/validators/datatype/NCNameDatatypeValidator.cpp" + "xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp" + "xercesc/validators/datatype/QNameDatatypeValidator.cpp" + "xercesc/validators/datatype/StringDatatypeValidator.cpp" + "xercesc/validators/datatype/TimeDatatypeValidator.cpp" + "xercesc/validators/datatype/UnionDatatypeValidator.cpp" + "xercesc/validators/datatype/XMLCanRepGroup.cpp" + "xercesc/validators/datatype/YearDatatypeValidator.cpp" + "xercesc/validators/datatype/YearMonthDatatypeValidator.cpp" + "xercesc/validators/DTD/DTDAttDef.cpp" + "xercesc/validators/DTD/DTDAttDefList.cpp" + "xercesc/validators/DTD/DTDElementDecl.cpp" + "xercesc/validators/DTD/DTDEntityDecl.cpp" + "xercesc/validators/DTD/DTDGrammar.cpp" + "xercesc/validators/DTD/DTDScanner.cpp" + "xercesc/validators/DTD/DTDValidator.cpp" + "xercesc/validators/DTD/XMLDTDDescriptionImpl.cpp" + "xercesc/validators/schema/ComplexTypeInfo.cpp" + "xercesc/validators/schema/GeneralAttributeCheck.cpp" + "xercesc/validators/schema/identity/FieldActivator.cpp" + "xercesc/validators/schema/identity/FieldValueMap.cpp" + "xercesc/validators/schema/identity/IC_Field.cpp" + "xercesc/validators/schema/identity/IC_Key.cpp" + "xercesc/validators/schema/identity/IC_KeyRef.cpp" + "xercesc/validators/schema/identity/IC_Selector.cpp" + "xercesc/validators/schema/identity/IC_Unique.cpp" + "xercesc/validators/schema/identity/IdentityConstraint.cpp" + "xercesc/validators/schema/identity/IdentityConstraintHandler.cpp" + "xercesc/validators/schema/identity/ValueStore.cpp" + "xercesc/validators/schema/identity/ValueStoreCache.cpp" + "xercesc/validators/schema/identity/XercesXPath.cpp" + "xercesc/validators/schema/identity/XPathMatcher.cpp" + "xercesc/validators/schema/identity/XPathMatcherStack.cpp" + "xercesc/validators/schema/identity/XPathSymbols.cpp" + "xercesc/validators/schema/NamespaceScope.cpp" + "xercesc/validators/schema/SchemaAttDef.cpp" + "xercesc/validators/schema/SchemaAttDefList.cpp" + "xercesc/validators/schema/SchemaElementDecl.cpp" + "xercesc/validators/schema/SchemaGrammar.cpp" + "xercesc/validators/schema/SchemaInfo.cpp" + "xercesc/validators/schema/SchemaSymbols.cpp" + "xercesc/validators/schema/SchemaValidator.cpp" + "xercesc/validators/schema/SubstitutionGroupComparator.cpp" + "xercesc/validators/schema/TraverseSchema.cpp" + "xercesc/validators/schema/XercesAttGroupInfo.cpp" + "xercesc/validators/schema/XercesElementWildcard.cpp" + "xercesc/validators/schema/XercesGroupInfo.cpp" + "xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp" + "xercesc/validators/schema/XSDDOMParser.cpp" + "xercesc/validators/schema/XSDErrorReporter.cpp" + "xercesc/validators/schema/XSDLocator.cpp" + "xercesc/validators/schema/XUtil.cpp" + "xercesc/xinclude/XIncludeDOMDocumentProcessor.cpp" + "xercesc/xinclude/XIncludeLocation.cpp" + "xercesc/xinclude/XIncludeUtils.cpp" + "stricmp.c" + "strnicmp.c" + "xercesc/util/NetAccessors/Socket/SocketNetAccessor.cpp" + "xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp" + "xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp" + "xercesc/util/Transcoders/ICU/ICUTransService.cpp" + "xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp" + "xercesc/util/MutexManagers/StdMutexMgr.cpp" + "xercesc/util/FileManagers/PosixFileMgr.cpp") +include_directories(.) +include_directories(..) +include_directories(third_partyt_icu/icu4c/source/common) +#message(WARNING "${src}") +add_library(xerces-c SHARED ${src}) +target_link_libraries(xerces-c PUBLIC icu) \ No newline at end of file diff --git a/xerces-c/cmake/xerces-c/src/third_party_icu/CMakeLists.txt b/xerces-c/cmake/xerces-c/src/third_party_icu/CMakeLists.txt new file mode 100755 index 0000000000000000000000000000000000000000..276462132e86d6021ee9fec41f343734acb27903 --- /dev/null +++ b/xerces-c/cmake/xerces-c/src/third_party_icu/CMakeLists.txt @@ -0,0 +1,41 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_CXX_STANDARD 11) +project(icu) +#set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ignored-attributes -std=c++11 -O3 -frtti -fexceptions -pedantic -Wno-unused-parameter -Wno-unused-const-variable -Wno-unneeded-internal-declaration") +#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ") +set(LibIcuSrc "${CMAKE_CURRENT_SOURCE_DIR}/icu4c/source") +include_directories( + ${LibIcuSrc} + ${LibIcuSrc}/common + ${LibIcuSrc}/i18n + ) +add_definitions( + -DU_ATTRIBUTE_DEPRECATED= + -DU_COMMON_IMPLEMENTATION + -DUPRV_BLOCK_MACRO_BEGIN= + -DUPRV_BLOCK_MACRO_END= + -DUCONFIG_USE_WINDOWS_LCID_MAPPING_API=0 + -D_REENTRANT + ) +set(icustubdata "icu4c/source/stubdata/stubdata.cpp") +aux_source_directory(icu4c/source/common icucommon) + +set(src ${icucommon} + ${icustubdata} + ) + +add_library(icu SHARED ${src}) diff --git a/xerces-c/gn/README_zh.md b/xerces-c/gn/README_zh.md new file mode 100755 index 0000000000000000000000000000000000000000..d99c5b5ad739559bf3d14c5faa088958799a7a2c --- /dev/null +++ b/xerces-c/gn/README_zh.md @@ -0,0 +1,29 @@ +# 三方库xerces-c适配脚本的使用 + +#### 三方库源码下载 + +- 下载三方库xerces-c + + ``` + #在OpenHarmony源码根目录下的third_party目录下获取源库 + git clone https://github.com/apache/xerces-c.git -b v3.2.3 + ``` + + + +#### 修改编译脚本 + +- 将[xerces-c](xerces-c)/config.h文件拷贝到源库xerces-c根目录下;注意,config.h文件中,如果系统是32位,SIZEOF_LONG的值修改为4,如果系统是64为,值修改为8 +- 将[xerces-c](xerces-c)/src/BUILD.gn文件拷贝到源库xerces-c/src目录下 +- 将[xerces-c](xerces-c)/tests/BUILD.gn文件拷贝到源库xerces-c/tests目录下 +- 将[xerces-c](xerces-c)/samples/BUILD.gn文件拷贝到源库xerces-c/samples目录下 + + + +#### 相关资料 + +- [工程加入OpenHarmony构建体系](../../common/gn_compile_build.md) +- [三方库引入GN工程](../../common/gn_build.md) + + + diff --git a/xerces-c/gn/xerces-c/config.h b/xerces-c/gn/xerces-c/config.h new file mode 100755 index 0000000000000000000000000000000000000000..aa261252fdabe03a2cc3adda2e1dffc2b08827f7 --- /dev/null +++ b/xerces-c/gn/xerces-c/config.h @@ -0,0 +1,506 @@ +/* +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +*/ + + +/* config.h.cmake.in. Not generated, but originated from autoheader. */ +/* This file must be kept up-to-date with needed substitutions from config.h.in. */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CSTDINT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +#if defined(__cplusplus) && defined(HAVE_CSTDINT) +#include +#elif HAVE_STDINT_H +#include +#elif HAVE_INTTYPES_H +#include +#endif + +/* Define to specify no threading is used */ +/* #undef APP_NO_THREADS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_NAMESER_COMPAT_H 1 + +/* define if bool is a built-in type */ +#define HAVE_BOOL 1 + +/* Define to 1 if you have the `catclose' function. */ +#define HAVE_CATCLOSE 1 + +/* Define to 1 if you have the `catgets' function. */ +#define HAVE_CATGETS 1 + +/* Define to 1 if you have the `catopen' function. */ +#define HAVE_CATOPEN 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CORESERVICES_CORESERVICES_H */ + +/* Define to 1 if you have cpuid.h */ +/* #undef HAVE_CPUID_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FLOAT_H 1 + +/* Define to 1 if you have the `ftime' function. */ +#define HAVE_FTIME 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `gethostbyaddr' function. */ +#define HAVE_GETHOSTBYADDR 1 + +/* Define to 1 if you have the `gethostbyname' function. */ +#define HAVE_GETHOSTBYNAME 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + +/* Define to 1 if you have the `iconv' function. */ +#define HAVE_ICONV 1 + +/* Define to 1 if you have the `iconv_close' function. */ +#define HAVE_ICONV_CLOSE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ICONV_H 1 + +/* Define to 1 if you have the `iconv_open' function. */ +#define HAVE_ICONV_OPEN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the `nsl' library (-lnsl). */ +#define HAVE_LIBNSL 1 + +/* Define to 1 if you have the `socket' library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the `localeconv' function. */ +#define HAVE_LOCALECONV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* define if the compiler implements L"widestring" */ +#define HAVE_LSTRING 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_ENDIAN_H */ + +/* Define to 1 if you have the `mblen' function. */ +#define HAVE_MBLEN 1 + +/* Define to 1 if you have the `mbrlen' function. */ +#define HAVE_MBRLEN 1 + +/* Define to 1 if you have the `mbsrtowcs' function. */ +#define HAVE_MBSRTOWCS 1 + +/* Define to 1 if you have the `mbstowcs' function. */ +#define HAVE_MBSTOWCS 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* define if the compiler implements namespaces */ +#define HAVE_NAMESPACES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the `nl_langinfo' function. */ +#define HAVE_NL_LANGINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NL_TYPES_H 1 + +/* Define to 1 if you have the `pathconf' function. */ +#define HAVE_PATHCONF 1 + +/* Define to 1 if you have the PATH_MAX macro. */ +#define HAVE_PATH_MAX 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the `realpath' function. */ +#define HAVE_REALPATH 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if stdbool.h conforms to C99. */ +/* #undef HAVE_STDBOOL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* define if the compiler supports ISO C++ standard library */ +#define HAVE_STD_LIBS 1 + +/* define if the compiler supports the std namespace */ +#define HAVE_STD_NAMESPACE 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `stricmp' function. */ +/* #undef HAVE_STRICMP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncasecmp' function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the `strnicmp' function. */ +/* #undef HAVE_STRNICMP */ + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the `strstr' function. */ +#define HAVE_STRSTR 1 + +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIMEB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the `timegm' function. */ +#define HAVE_TIMEGM 1 + +/* Define to 1 if you have the `towlower' function. */ +#define HAVE_TOWLOWER 1 + +/* Define to 1 if you have the `towupper' function. */ +#define HAVE_TOWUPPER 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the `wcsicmp' function. */ +/* #undef HAVE_WCSICMP */ + +/* Define to 1 if you have the `wcslwr' function. */ +/* #undef HAVE_WCSLWR */ + +/* Define to 1 if you have the `wcsnicmp' function. */ +/* #undef HAVE_WCSNICMP */ + +/* Define to 1 if you have the `wcsrtombs' function. */ +#define HAVE_WCSRTOMBS 1 + +/* Define to 1 if you have the `wcstombs' function. */ +#define HAVE_WCSTOMBS 1 + +/* Define to 1 if you have the `wcsupr' function. */ +/* #undef HAVE_WCSUPR */ + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINSOCK2_H */ + +/* Define to 1 if you have to use const char* with iconv, to 0 if you must use + char*. */ +#define ICONV_USES_CONST_POINTER 0 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "xerces-c" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "xerces-c" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "xerces-c 3.2.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "xerces-c" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.2.3" + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `wchar_t', as computed by sizeof. */ +#define SIZEOF_WCHAR_T 4 + +/* The size of `__int64', as computed by sizeof. */ +#define SIZEOF___INT64 0 + +/* Version number of package */ +#define VERSION "3.2.3" + +/* Define if DLL symbols should be exported */ +/* #undef XERCES_DLL_EXPORT */ + +/* Define if namespaces is supported by the compiler */ +#define XERCES_HAS_CPP_NAMESPACE 1 + +/* Define to have SSE2 instruction support detected at runtime using __cpuid + */ +/* #undef XERCES_HAVE_CPUID_INTRINSIC */ + +/* Define to 1 if you have emmintrin.h */ +/* #undef XERCES_HAVE_EMMINTRIN_H */ + +/* Define to have SSE2 instruction support detected at runtime using + __get_cpuid */ +/* #undef XERCES_HAVE_GETCPUID */ + +/* Define to 1 if you have intrin.h */ +/* #undef XERCES_HAVE_INTRIN_H */ + +/* Define to 1 if we have inttypes.h */ +#define XERCES_HAVE_INTTYPES_H 1 + +/* Define to have SSE2 instruction used at runtime */ +/* #undef XERCES_HAVE_SSE2_INTRINSIC */ + +/* Define to 1 if we have sys/types.h */ +#define XERCES_HAVE_SYS_TYPES_H 1 + +/* Define to have Xerces_autoconf_config.hpp include wchar.h */ +/* #undef XERCES_INCLUDE_WCHAR_H */ + +/* Define if there is support for L"widestring" */ +#define XERCES_LSTRSUPPORT 1 + +/* Define if the isstream library can be included as */ +#define XERCES_NEW_IOSTREAMS 1 + +/* Define to have XMemory.hpp avoid declaring a matching operator delete for + the placement operator new */ +/* #undef XERCES_NO_MATCHING_DELETE_OPERATOR */ + +/* Define if there is no native bool support in this environment */ +/* #undef XERCES_NO_NATIVE_BOOL */ + +/* Define to use backslash as an extra path delimiter character */ +/* #undef XERCES_PATH_DELIMITER_BACKSLASH */ + +/* Define as the platform's export attribute */ +#define XERCES_PLATFORM_EXPORT + +/* Define as the platform's import attribute */ +#define XERCES_PLATFORM_IMPORT + +/* An appropriate signed 16 bit integer type */ +#define XERCES_S16BIT_INT int16_t + +/* An appropriate signed 32 bit integer type */ +#define XERCES_S32BIT_INT int32_t + +/* An appropriate signed 64 bit integer type */ +#define XERCES_S64BIT_INT int64_t + +/* Define as the appropriate SIZE_MAX macro */ +#define XERCES_SIZE_MAX SIZE_MAX + +/* Define as the appropriate size_t type */ +#define XERCES_SIZE_T size_t + +/* Define as the appropriate SSIZE_MAX macro */ +#define XERCES_SSIZE_MAX SSIZE_MAX + +/* Define as the appropriate ssize_t type */ +#define XERCES_SSIZE_T ssize_t + +/* Define if building a static library */ +/* #undef XERCES_STATIC_LIBRARY */ + +/* Define if the std namespace is supported */ +#define XERCES_STD_NAMESPACE 1 + +/* An appropriate unsigned 16 bit integer type */ +#define XERCES_U16BIT_INT uint16_t + +/* An appropriate unsigned 32 bit integer type */ +#define XERCES_U32BIT_INT uint32_t + +/* An appropriate unsigned 64 bit integer type */ +#define XERCES_U64BIT_INT uint64_t + +/* Define to use the POSIX file mgr */ +#define XERCES_USE_FILEMGR_POSIX 1 + +/* Define to use the Windows file mgr */ +/* #undef XERCES_USE_FILEMGR_WINDOWS */ + +/* Define to use the iconv-based MsgLoader */ +/* #undef XERCES_USE_MSGLOADER_ICONV */ + +/* Define to use the ICU-based MsgLoader */ +/* #undef XERCES_USE_MSGLOADER_ICU */ + +/* Define to use the InMemory MsgLoader */ +#define XERCES_USE_MSGLOADER_INMEMORY 1 + +/* Define to use the NoThread mutex mgr */ +/* #undef XERCES_USE_MUTEXMGR_NOTHREAD */ + +/* Define to use the C++11 standard mutex mgr */ +#define XERCES_USE_MUTEXMGR_STD 1 + +/* Define to use the POSIX mutex mgr */ +/* #undef XERCES_USE_MUTEXMGR_POSIX */ + +/* Define to use the Windows mutex mgr */ +/* #undef XERCES_USE_MUTEXMGR_WINDOWS */ + +/* Define to use the Mac OS X CFURL NetAccessor */ +/* #undef XERCES_USE_NETACCESSOR_CFURL */ + +/* Define to use the CURL NetAccessor */ +/* #undef XERCES_USE_NETACCESSOR_CURL */ + +/* Define to use the Sockets-based NetAccessor */ +#define XERCES_USE_NETACCESSOR_SOCKET 1 + +/* Define to use the WinSock NetAccessor */ +/* #undef XERCES_USE_NETACCESSOR_WINSOCK */ + +/* Define to use the GNU iconv transcoder */ +/* #undef XERCES_USE_TRANSCODER_GNUICONV */ + +/* Define to use the iconv transcoder */ +/* #undef XERCES_USE_TRANSCODER_ICONV */ + +/* Define to use the ICU-based transcoder */ +#define XERCES_USE_TRANSCODER_ICU 1 + +/* Define to use the Mac OS UnicodeConverter-based transcoder */ +/* #undef XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER */ + +/* Define to use the Windows transcoder */ +/* #undef XERCES_USE_TRANSCODER_WINDOWS */ + +/* Define to the 16 bit type used to represent Xerces UTF-16 characters */ +#define XERCES_XMLCH_T char16_t + + diff --git a/xerces-c/gn/xerces-c/samples/BUILD.gn b/xerces-c/gn/xerces-c/samples/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..86996c7c54263fa665bdbd544eaf782ecdfabebe --- /dev/null +++ b/xerces-c/gn/xerces-c/samples/BUILD.gn @@ -0,0 +1,289 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +config("pub_config") { + cflags_cc = [ + "-frtti", + "-fexceptions", + "-Wno-header-hygiene", + "-DHAVE_CONFIG_H=1", + "-D_FILE_OFFSET_BITS=64", + "-D_THREAD_SAFE=1", + "-Wno-long-long", + "-Wno-variadic-macros", + "-Wno-misleading-indentation", + "-Wno-main", + "-Wno-unused-variable", + ] + + include_dirs = [ + ".", + "../src", + "src", + ] +} + +ohos_executable("StdInParse") { + sources= [ + "src/StdInParse/StdInParse.cpp", + "src/StdInParse/StdInParseHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("SEnumVal") { + sources= [ + "src/SEnumVal/SEnumVal.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("CreateDOMDocument") { + sources= [ + "src/CreateDOMDocument/CreateDOMDocument.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("SCMPrint") { + sources= [ + "src/SCMPrint/SCMPrint.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2" + ] + + part_name = "xerces" +} + +ohos_executable("XInclude") { + sources= [ + "src/XInclude/XInclude.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("DOMCount") { + sources= [ + "src/DOMCount/DOMCount.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("EnumVal") { + sources= [ + "src/EnumVal/EnumVal.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("PSVIWriter") { + sources= [ + "src/PSVIWriter/PSVIWriter.cpp", + "src/PSVIWriter/PSVIWriterHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("MemParse") { + sources= [ + "src/MemParse/MemParse.cpp", + "src/MemParse/MemParseHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("DOMPrint") { + sources= [ + "src/DOMPrint/DOMPrint.cpp", + "src/DOMPrint/DOMPrintErrorHandler.cpp", + "src/DOMPrint/DOMPrintFilter.cpp", + "src/DOMPrint/DOMTreeErrorReporter.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("Redirect") { + sources= [ + "src/Redirect/Redirect.cpp", + "src/Redirect/RedirectHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("PParse") { + sources= [ + "src/PParse/PParse.cpp", + "src/PParse/PParseHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("SAXCount") { + sources= [ + "src/SAXCount/SAXCount.cpp", + "src/SAXCount/SAXCountHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("SAX2Print") { + sources= [ + "src/SAX2Print/SAX2FilterHandlers.cpp", + "src/SAX2Print/SAX2Print.cpp", + "src/SAX2Print/SAX2PrintHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("SAX2Count") { + sources= [ + "src/SAX2Count/SAX2Count.cpp", + "src/SAX2Count/SAX2CountHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("SAXPrint") { + sources= [ + "src/SAXPrint/SAXPrint.cpp", + "src/SAXPrint/SAXPrintHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} diff --git a/xerces-c/gn/xerces-c/src/BUILD.gn b/xerces-c/gn/xerces-c/src/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..fc6816603cf72e1c26ecbdbdaca707e9c80c78a4 --- /dev/null +++ b/xerces-c/gn/xerces-c/src/BUILD.gn @@ -0,0 +1,368 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +config("pub_config") { + cflags_cc = [ + "-frtti", + "-fexceptions", + "-Wno-header-hygiene", + "-DHAVE_CONFIG_H=1", + "-DXERCES_BUILDING_LIBRARY=1", + "-D_FILE_OFFSET_BITS=64", + "-D_THREAD_SAFE=1", + "-Dxerces_c_EXPORTS", + "-Wno-long-long", + "-Woverlength-strings", + "-Woverloaded-virtual", + "-Wno-variadic-macros", + "-Wno-misleading-indentation", + "-Wno-memset-transposed-args", + "-Wno-unused-variable", + "-fstrict-aliasing", + "-fPIC", + ] + + cflags = [ + "-DHAVE_CONFIG_H=1", + "-DXERCES_BUILDING_LIBRARY=1", + "-D_FILE_OFFSET_BITS=64", + "-D_THREAD_SAFE=1", + "-Dxerces_c_EXPORTS", + "-fPIC", + ] + + include_dirs = [ + ".", + "..", + "//third_party/icu/icu4c/source/common", + ] +} + +ohos_shared_library("xerces-c-3.2") { + sources= [ + "xercesc/util/Base64.cpp", + "xercesc/util/BinFileInputStream.cpp", + "xercesc/util/BinInputStream.cpp", + "xercesc/util/BinMemInputStream.cpp", + "xercesc/util/BitSet.cpp", + "xercesc/util/DefaultPanicHandler.cpp", + "xercesc/util/EncodingValidator.cpp", + "xercesc/util/HeaderDummy.cpp", + "xercesc/util/HexBin.cpp", + "xercesc/util/JanitorExports.cpp", + "xercesc/util/KVStringPair.cpp", + "xercesc/util/Mutexes.cpp", + "xercesc/util/PanicHandler.cpp", + "xercesc/util/PlatformUtils.cpp", + "xercesc/util/PSVIUni.cpp", + "xercesc/util/QName.cpp", + "xercesc/util/regx/ASCIIRangeFactory.cpp", + "xercesc/util/regx/BlockRangeFactory.cpp", + "xercesc/util/regx/BMPattern.cpp", + "xercesc/util/regx/CharToken.cpp", + "xercesc/util/regx/ClosureToken.cpp", + "xercesc/util/regx/ConcatToken.cpp", + "xercesc/util/regx/Match.cpp", + "xercesc/util/regx/Op.cpp", + "xercesc/util/regx/OpFactory.cpp", + "xercesc/util/regx/ParenToken.cpp", + "xercesc/util/regx/ParserForXMLSchema.cpp", + "xercesc/util/regx/RangeFactory.cpp", + "xercesc/util/regx/RangeToken.cpp", + "xercesc/util/regx/RangeTokenMap.cpp", + "xercesc/util/regx/RegularExpression.cpp", + "xercesc/util/regx/RegxParser.cpp", + "xercesc/util/regx/RegxUtil.cpp", + "xercesc/util/regx/StringToken.cpp", + "xercesc/util/regx/Token.cpp", + "xercesc/util/regx/TokenFactory.cpp", + "xercesc/util/regx/UnicodeRangeFactory.cpp", + "xercesc/util/regx/UnionToken.cpp", + "xercesc/util/regx/XMLRangeFactory.cpp", + "xercesc/util/regx/XMLUniCharacter.cpp", + "xercesc/util/StringPool.cpp", + "xercesc/util/SynchronizedStringPool.cpp", + "xercesc/util/TransService.cpp", + "xercesc/util/XMemory.cpp", + "xercesc/util/XML256TableTranscoder.cpp", + "xercesc/util/XML88591Transcoder.cpp", + "xercesc/util/XMLAbstractDoubleFloat.cpp", + "xercesc/util/XMLASCIITranscoder.cpp", + "xercesc/util/XMLBigDecimal.cpp", + "xercesc/util/XMLBigInteger.cpp", + "xercesc/util/XMLChar.cpp", + "xercesc/util/XMLChTranscoder.cpp", + "xercesc/util/XMLDateTime.cpp", + "xercesc/util/XMLDouble.cpp", + "xercesc/util/XMLEBCDICTranscoder.cpp", + "xercesc/util/XMLException.cpp", + "xercesc/util/XMLFloat.cpp", + "xercesc/util/XMLIBM1047Transcoder.cpp", + "xercesc/util/XMLIBM1140Transcoder.cpp", + "xercesc/util/XMLInitializer.cpp", + "xercesc/util/XMLMsgLoader.cpp", + "xercesc/util/XMLNumber.cpp", + "xercesc/util/XMLString.cpp", + "xercesc/util/XMLStringTokenizer.cpp", + "xercesc/util/XMLUCS4Transcoder.cpp", + "xercesc/util/XMLUni.cpp", + "xercesc/util/XMLUri.cpp", + "xercesc/util/XMLURL.cpp", + "xercesc/util/XMLUTF16Transcoder.cpp", + "xercesc/util/XMLUTF8Transcoder.cpp", + "xercesc/util/XMLWin1252Transcoder.cpp", + "xercesc/dom/DOMException.cpp", + "xercesc/dom/DOMLSException.cpp", + "xercesc/dom/DOMRangeException.cpp", + "xercesc/dom/DOMXPathException.cpp", + "xercesc/dom/impl/DOMAttrImpl.cpp", + "xercesc/dom/impl/DOMAttrMapImpl.cpp", + "xercesc/dom/impl/DOMAttrNSImpl.cpp", + "xercesc/dom/impl/DOMCDATASectionImpl.cpp", + "xercesc/dom/impl/DOMCharacterDataImpl.cpp", + "xercesc/dom/impl/DOMChildNode.cpp", + "xercesc/dom/impl/DOMCommentImpl.cpp", + "xercesc/dom/impl/DOMConfigurationImpl.cpp", + "xercesc/dom/impl/DOMDeepNodeListImpl.cpp", + "xercesc/dom/impl/DOMDocumentFragmentImpl.cpp", + "xercesc/dom/impl/DOMDocumentImpl.cpp", + "xercesc/dom/impl/DOMDocumentTypeImpl.cpp", + "xercesc/dom/impl/DOMElementImpl.cpp", + "xercesc/dom/impl/DOMElementNSImpl.cpp", + "xercesc/dom/impl/DOMEntityImpl.cpp", + "xercesc/dom/impl/DOMEntityReferenceImpl.cpp", + "xercesc/dom/impl/DOMErrorImpl.cpp", + "xercesc/dom/impl/DOMImplementationImpl.cpp", + "xercesc/dom/impl/DOMImplementationListImpl.cpp", + "xercesc/dom/impl/DOMImplementationRegistry.cpp", + "xercesc/dom/impl/DOMLocatorImpl.cpp", + "xercesc/dom/impl/DOMNamedNodeMapImpl.cpp", + "xercesc/dom/impl/DOMNodeIDMap.cpp", + "xercesc/dom/impl/DOMNodeImpl.cpp", + "xercesc/dom/impl/DOMNodeIteratorImpl.cpp", + "xercesc/dom/impl/DOMNodeListImpl.cpp", + "xercesc/dom/impl/DOMNodeVector.cpp", + "xercesc/dom/impl/DOMNormalizer.cpp", + "xercesc/dom/impl/DOMNotationImpl.cpp", + "xercesc/dom/impl/DOMParentNode.cpp", + "xercesc/dom/impl/DOMProcessingInstructionImpl.cpp", + "xercesc/dom/impl/DOMRangeImpl.cpp", + "xercesc/dom/impl/DOMStringListImpl.cpp", + "xercesc/dom/impl/DOMStringPool.cpp", + "xercesc/dom/impl/DOMTextImpl.cpp", + "xercesc/dom/impl/DOMTreeWalkerImpl.cpp", + "xercesc/dom/impl/DOMTypeInfoImpl.cpp", + "xercesc/dom/impl/DOMLSSerializerImpl.cpp", + "xercesc/dom/impl/DOMLSInputImpl.cpp", + "xercesc/dom/impl/DOMLSOutputImpl.cpp", + "xercesc/dom/impl/DOMXPathExpressionImpl.cpp", + "xercesc/dom/impl/DOMXPathNSResolverImpl.cpp", + "xercesc/dom/impl/DOMXPathResultImpl.cpp", + "xercesc/dom/impl/XSDElementNSImpl.cpp", + "xercesc/framework/BinOutputStream.cpp", + "xercesc/framework/LocalFileFormatTarget.cpp", + "xercesc/framework/LocalFileInputSource.cpp", + "xercesc/framework/MemBufFormatTarget.cpp", + "xercesc/framework/MemBufInputSource.cpp", + "xercesc/framework/psvi/PSVIAttribute.cpp", + "xercesc/framework/psvi/PSVIAttributeList.cpp", + "xercesc/framework/psvi/PSVIElement.cpp", + "xercesc/framework/psvi/PSVIItem.cpp", + "xercesc/framework/psvi/XSAnnotation.cpp", + "xercesc/framework/psvi/XSAttributeDeclaration.cpp", + "xercesc/framework/psvi/XSAttributeGroupDefinition.cpp", + "xercesc/framework/psvi/XSAttributeUse.cpp", + "xercesc/framework/psvi/XSComplexTypeDefinition.cpp", + "xercesc/framework/psvi/XSElementDeclaration.cpp", + "xercesc/framework/psvi/XSFacet.cpp", + "xercesc/framework/psvi/XSIDCDefinition.cpp", + "xercesc/framework/psvi/XSModel.cpp", + "xercesc/framework/psvi/XSModelGroup.cpp", + "xercesc/framework/psvi/XSModelGroupDefinition.cpp", + "xercesc/framework/psvi/XSMultiValueFacet.cpp", + "xercesc/framework/psvi/XSNamespaceItem.cpp", + "xercesc/framework/psvi/XSNotationDeclaration.cpp", + "xercesc/framework/psvi/XSObject.cpp", + "xercesc/framework/psvi/XSParticle.cpp", + "xercesc/framework/psvi/XSSimpleTypeDefinition.cpp", + "xercesc/framework/psvi/XSTypeDefinition.cpp", + "xercesc/framework/psvi/XSValue.cpp", + "xercesc/framework/psvi/XSWildcard.cpp", + "xercesc/framework/StdInInputSource.cpp", + "xercesc/framework/StdOutFormatTarget.cpp", + "xercesc/framework/URLInputSource.cpp", + "xercesc/framework/Wrapper4DOMLSInput.cpp", + "xercesc/framework/Wrapper4InputSource.cpp", + "xercesc/framework/XMLAttDef.cpp", + "xercesc/framework/XMLAttDefList.cpp", + "xercesc/framework/XMLAttr.cpp", + "xercesc/framework/XMLBuffer.cpp", + "xercesc/framework/XMLBufferMgr.cpp", + "xercesc/framework/XMLContentModel.cpp", + "xercesc/framework/XMLDTDDescription.cpp", + "xercesc/framework/XMLElementDecl.cpp", + "xercesc/framework/XMLEntityDecl.cpp", + "xercesc/framework/XMLFormatter.cpp", + "xercesc/framework/XMLGrammarDescription.cpp", + "xercesc/framework/XMLGrammarPoolImpl.cpp", + "xercesc/framework/XMLNotationDecl.cpp", + "xercesc/framework/XMLRecognizer.cpp", + "xercesc/framework/XMLRefInfo.cpp", + "xercesc/framework/XMLSchemaDescription.cpp", + "xercesc/framework/XMLValidator.cpp", + "xercesc/internal/BinFileOutputStream.cpp", + "xercesc/internal/BinMemOutputStream.cpp", + "xercesc/internal/DGXMLScanner.cpp", + "xercesc/internal/ElemStack.cpp", + "xercesc/internal/IGXMLScanner.cpp", + "xercesc/internal/IGXMLScanner2.cpp", + "xercesc/internal/MemoryManagerImpl.cpp", + "xercesc/internal/ReaderMgr.cpp", + "xercesc/internal/SGXMLScanner.cpp", + "xercesc/internal/ValidationContextImpl.cpp", + "xercesc/internal/VecAttributesImpl.cpp", + "xercesc/internal/VecAttrListImpl.cpp", + "xercesc/internal/WFXMLScanner.cpp", + "xercesc/internal/XMLReader.cpp", + "xercesc/internal/XMLScanner.cpp", + "xercesc/internal/XMLScannerResolver.cpp", + "xercesc/internal/XProtoType.cpp", + "xercesc/internal/XSAXMLScanner.cpp", + "xercesc/internal/XSerializeEngine.cpp", + "xercesc/internal/XSObjectFactory.cpp", + "xercesc/internal/XTemplateSerializer.cpp", + "xercesc/parsers/AbstractDOMParser.cpp", + "xercesc/parsers/DOMLSParserImpl.cpp", + "xercesc/parsers/SAX2XMLFilterImpl.cpp", + "xercesc/parsers/SAX2XMLReaderImpl.cpp", + "xercesc/parsers/SAXParser.cpp", + "xercesc/parsers/XercesDOMParser.cpp", + "xercesc/sax/Dummy.cpp", + "xercesc/sax/InputSource.cpp", + "xercesc/sax/SAXException.cpp", + "xercesc/sax/SAXParseException.cpp", + "xercesc/sax2/sax2Dummy.cpp", + "xercesc/validators/common/AllContentModel.cpp", + "xercesc/validators/common/CMAny.cpp", + "xercesc/validators/common/CMBinaryOp.cpp", + "xercesc/validators/common/CMUnaryOp.cpp", + "xercesc/validators/common/ContentLeafNameTypeVector.cpp", + "xercesc/validators/common/ContentSpecNode.cpp", + "xercesc/validators/common/DFAContentModel.cpp", + "xercesc/validators/common/Grammar.cpp", + "xercesc/validators/common/GrammarResolver.cpp", + "xercesc/validators/common/MixedContentModel.cpp", + "xercesc/validators/common/SimpleContentModel.cpp", + "xercesc/validators/datatype/AbstractNumericFacetValidator.cpp", + "xercesc/validators/datatype/AbstractNumericValidator.cpp", + "xercesc/validators/datatype/AbstractStringValidator.cpp", + "xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp", + "xercesc/validators/datatype/AnyURIDatatypeValidator.cpp", + "xercesc/validators/datatype/Base64BinaryDatatypeValidator.cpp", + "xercesc/validators/datatype/BooleanDatatypeValidator.cpp", + "xercesc/validators/datatype/DatatypeValidator.cpp", + "xercesc/validators/datatype/DatatypeValidatorFactory.cpp", + "xercesc/validators/datatype/DateDatatypeValidator.cpp", + "xercesc/validators/datatype/DateTimeDatatypeValidator.cpp", + "xercesc/validators/datatype/DateTimeValidator.cpp", + "xercesc/validators/datatype/DayDatatypeValidator.cpp", + "xercesc/validators/datatype/DecimalDatatypeValidator.cpp", + "xercesc/validators/datatype/DoubleDatatypeValidator.cpp", + "xercesc/validators/datatype/DurationDatatypeValidator.cpp", + "xercesc/validators/datatype/ENTITYDatatypeValidator.cpp", + "xercesc/validators/datatype/FloatDatatypeValidator.cpp", + "xercesc/validators/datatype/HexBinaryDatatypeValidator.cpp", + "xercesc/validators/datatype/IDDatatypeValidator.cpp", + "xercesc/validators/datatype/IDREFDatatypeValidator.cpp", + "xercesc/validators/datatype/ListDatatypeValidator.cpp", + "xercesc/validators/datatype/MonthDatatypeValidator.cpp", + "xercesc/validators/datatype/MonthDayDatatypeValidator.cpp", + "xercesc/validators/datatype/NameDatatypeValidator.cpp", + "xercesc/validators/datatype/NCNameDatatypeValidator.cpp", + "xercesc/validators/datatype/NOTATIONDatatypeValidator.cpp", + "xercesc/validators/datatype/QNameDatatypeValidator.cpp", + "xercesc/validators/datatype/StringDatatypeValidator.cpp", + "xercesc/validators/datatype/TimeDatatypeValidator.cpp", + "xercesc/validators/datatype/UnionDatatypeValidator.cpp", + "xercesc/validators/datatype/XMLCanRepGroup.cpp", + "xercesc/validators/datatype/YearDatatypeValidator.cpp", + "xercesc/validators/datatype/YearMonthDatatypeValidator.cpp", + "xercesc/validators/DTD/DTDAttDef.cpp", + "xercesc/validators/DTD/DTDAttDefList.cpp", + "xercesc/validators/DTD/DTDElementDecl.cpp", + "xercesc/validators/DTD/DTDEntityDecl.cpp", + "xercesc/validators/DTD/DTDGrammar.cpp", + "xercesc/validators/DTD/DTDScanner.cpp", + "xercesc/validators/DTD/DTDValidator.cpp", + "xercesc/validators/DTD/XMLDTDDescriptionImpl.cpp", + "xercesc/validators/schema/ComplexTypeInfo.cpp", + "xercesc/validators/schema/GeneralAttributeCheck.cpp", + "xercesc/validators/schema/identity/FieldActivator.cpp", + "xercesc/validators/schema/identity/FieldValueMap.cpp", + "xercesc/validators/schema/identity/IC_Field.cpp", + "xercesc/validators/schema/identity/IC_Key.cpp", + "xercesc/validators/schema/identity/IC_KeyRef.cpp", + "xercesc/validators/schema/identity/IC_Selector.cpp", + "xercesc/validators/schema/identity/IC_Unique.cpp", + "xercesc/validators/schema/identity/IdentityConstraint.cpp", + "xercesc/validators/schema/identity/IdentityConstraintHandler.cpp", + "xercesc/validators/schema/identity/ValueStore.cpp", + "xercesc/validators/schema/identity/ValueStoreCache.cpp", + "xercesc/validators/schema/identity/XercesXPath.cpp", + "xercesc/validators/schema/identity/XPathMatcher.cpp", + "xercesc/validators/schema/identity/XPathMatcherStack.cpp", + "xercesc/validators/schema/identity/XPathSymbols.cpp", + "xercesc/validators/schema/NamespaceScope.cpp", + "xercesc/validators/schema/SchemaAttDef.cpp", + "xercesc/validators/schema/SchemaAttDefList.cpp", + "xercesc/validators/schema/SchemaElementDecl.cpp", + "xercesc/validators/schema/SchemaGrammar.cpp", + "xercesc/validators/schema/SchemaInfo.cpp", + "xercesc/validators/schema/SchemaSymbols.cpp", + "xercesc/validators/schema/SchemaValidator.cpp", + "xercesc/validators/schema/SubstitutionGroupComparator.cpp", + "xercesc/validators/schema/TraverseSchema.cpp", + "xercesc/validators/schema/XercesAttGroupInfo.cpp", + "xercesc/validators/schema/XercesElementWildcard.cpp", + "xercesc/validators/schema/XercesGroupInfo.cpp", + "xercesc/validators/schema/XMLSchemaDescriptionImpl.cpp", + "xercesc/validators/schema/XSDDOMParser.cpp", + "xercesc/validators/schema/XSDErrorReporter.cpp", + "xercesc/validators/schema/XSDLocator.cpp", + "xercesc/validators/schema/XUtil.cpp", + "xercesc/xinclude/XIncludeDOMDocumentProcessor.cpp", + "xercesc/xinclude/XIncludeLocation.cpp", + "xercesc/xinclude/XIncludeUtils.cpp", + "stricmp.c", + "strnicmp.c", + "xercesc/util/NetAccessors/Socket/SocketNetAccessor.cpp", + "xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp", + "xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp", + "xercesc/util/Transcoders/ICU/ICUTransService.cpp", + "xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp", + "xercesc/util/MutexManagers/StdMutexMgr.cpp", + "xercesc/util/FileManagers/PosixFileMgr.cpp", + ] + + configs = [ + ":pub_config" + ] + + deps = [ + "//third_party/icu/icu4c:shared_icuuc", + ] + + part_name = "xerces" +} diff --git a/xerces-c/gn/xerces-c/tests/BUILD.gn b/xerces-c/gn/xerces-c/tests/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..1d8ccdbed3611e9348a282320d1e870f11d2de00 --- /dev/null +++ b/xerces-c/gn/xerces-c/tests/BUILD.gn @@ -0,0 +1,266 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +config("pub_config") { + cflags_cc = [ + "-frtti", + "-fexceptions", + "-Wno-header-hygiene", + "-DHAVE_CONFIG_H=1", + "-D_FILE_OFFSET_BITS=64", + "-D_THREAD_SAFE=1", + "-Wno-implicitly-unsigned-literal", + "-Wno-variadic-macros", + "-fstrict-aliasing", + "-Wno-misleading-indentation", + "-Wno-main", + "-Wno-unused-variable", + ] + + include_dirs = [ + ".", + "src", + "../src", + "..", + ] +} + +ohos_executable("XSValueTest") { + sources= [ + "src/XSValueTest/XSValueTest.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("DOMTest") { + sources= [ + "src/DOM/DOMTest/DTest.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("ThreadTest") { + sources= [ + "src/ThreadTest/ThreadTest.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("Char16Test") { + sources= [ + "src/Char16Test/Char16Test.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("DOMMemTest") { + sources= [ + "src/DOM/DOMMemTest/DOMMemTest.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("DOMTraversalTest") { + sources= [ + "src/DOM/Traversal/Traversal.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("XSerializerTest") { + sources= [ + "src/XSerializerTest/XSerializerHandlers.cpp", + "src/XSerializerTest/XSerializerTest.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("RangeTest") { + sources= [ + "src/DOM/RangeTest/RangeTest.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("InitTermTest") { + sources= [ + "src/InitTermTest/InitTermTest.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("DOMTypeInfoTest") { + sources= [ + "src/DOM/TypeInfo/TypeInfo.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("XSTSHarness") { + sources= [ + "src/XSTSHarness/XSTSHarness.cpp", + "src/XSTSHarness/XSTSHarnessHandlers.cpp", + "src/XSTSHarness/XMLHarnessHandlers.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("EncodingTest") { + sources= [ + "src/EncodingTest/EncodingTest.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("Normalizer") { + sources= [ + "src/DOM/Normalizer/Normalizer.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("MemHandlerTest") { + sources= [ + "src/MemHandlerTest/MemoryMonitor.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +} + +ohos_executable("NetAccessorTest") { + sources= [ + "src/NetAccessorTest/NetAccessorTest.cpp", + ] + + configs = [ + ":pub_config" + ] + deps = [ + "../src:xerces-c-3.2", + ] + + part_name = "xerces" +}