From 651dada4d51c52312771e53bde51bed401945000 Mon Sep 17 00:00:00 2001 From: huangminzhong Date: Thu, 1 Sep 2022 01:50:09 -0700 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4xerces-c=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=BA=93gn=E5=8C=96=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangminzhong --- xerces-c/README.OpenSource | 11 + xerces-c/README_zh.md | 4 + xerces-c/gn/README_zh.md | 81 +++++ xerces-c/gn/xerces-c/config.h.in | 506 ++++++++++++++++++++++++++ xerces-c/gn/xerces-c/samples/BUILD.gn | 289 +++++++++++++++ xerces-c/gn/xerces-c/src/BUILD.gn | 368 +++++++++++++++++++ xerces-c/gn/xerces-c/tests/BUILD.gn | 266 ++++++++++++++ 7 files changed, 1525 insertions(+) create mode 100755 xerces-c/README.OpenSource create mode 100755 xerces-c/README_zh.md create mode 100755 xerces-c/gn/README_zh.md create mode 100755 xerces-c/gn/xerces-c/config.h.in create mode 100755 xerces-c/gn/xerces-c/samples/BUILD.gn create mode 100755 xerces-c/gn/xerces-c/src/BUILD.gn create mode 100755 xerces-c/gn/xerces-c/tests/BUILD.gn diff --git a/xerces-c/README.OpenSource b/xerces-c/README.OpenSource new file mode 100755 index 00000000..3475db93 --- /dev/null +++ b/xerces-c/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name": "xerces-c", + "License": "Apache License V2.0", + "License File": "LICENSE", + "Version Number": "v3.2.3", + "Owner": "huangminzhong2@huawei.com", + "Upstream URL": "https://github.com/apache/xerces-c.git", + "Description": "Apache Xerces-C validating XML parser" + } +] diff --git a/xerces-c/README_zh.md b/xerces-c/README_zh.md new file mode 100755 index 00000000..9d844488 --- /dev/null +++ b/xerces-c/README_zh.md @@ -0,0 +1,4 @@ +### 三方库xerces-c适配标准系统 + +- [gn构建](gn) +- [cmake构建](cmake) \ No newline at end of file diff --git a/xerces-c/gn/README_zh.md b/xerces-c/gn/README_zh.md new file mode 100755 index 00000000..a0a6c066 --- /dev/null +++ b/xerces-c/gn/README_zh.md @@ -0,0 +1,81 @@ +# 三方库xerces-c适配脚本的使用 + +## 简介 + +目前三方库xerces-c已适配了OpenHarmony标准系统,本文介绍如何使用这些适配脚本,帮助开发者在Openharmony上快速适配和使用三方库xerces-c + + + +## 使用场景 + +适用于需要在OpenHarmony源码下构建的工程,在工程中需要使用到三方库xerces-c接口能力时,可使用本目录下的适配脚本,将三方库引入自己的工程 + + + +## 三方库版本及Liense + +- xerces-c: + + 版本: tags/v3.2.3,[下载地址](https://github.com/apache/xerces-c) + + liense: Apache License V2.0 + + + +## 本仓库版本 + +- tpc_c_cplusplus:master,[下载地址](https://gitee.com/openharmony-sig/tpc_c_cplusplus) + + + +## 工程环境 + +- OpenHarmony源码版本:tags/OpenHarmony-v3.2-Beta2 +- ubuntu 20.04 + + + +## 下载三方库源码 + +- 下载三方库xerces-c + + ``` + #在OpenHarmony源码根目录下的third_party目录下获取源库 + git clone https://github.com/apache/xerces-c.git -b v3.2.3 + ``` + +- 下载本仓库适配脚本 + + ``` + #在OpenHarmony源码根目录下的third_party目录下下载设配脚本仓库 + git clone https://gitee.com/openharmony-sig/tpc_c_cplusplus.git + ``` + + + +## 适配步骤 + +``` +#将库的配置文件拷贝到三方库中,注意config.h文件中,如果系统是32位,SIZEOF_LONG的值修改为4,如果系统是64为,值修改为8 +cp tpc_c_cplusplus/xerces-c/gn/xerces-c/config.h.in xerces-c/config.h + +#将构建脚本拷贝到三方库目录下 +cp tpc_c_cplusplus/xerces-c/gn/xerces-c/src/BUILD.gn xerces-c/src +cp tpc_c_cplusplus/xerces-c/gn/xerces-c/tests/BUILD.gn xerces-c/tests +cp tpc_c_cplusplus/xerces-c/gn/xerces-c/samples/BUILD.gn xerces-c/samples +``` + + + +## 引入三方库 + +- [将三方库加入GN工程](../../common/gn_build.md) + + + +## 编译工程 + +- [工程加入OpenHarmony构建体系](../../common/gn_compile.md) + + + diff --git a/xerces-c/gn/xerces-c/config.h.in b/xerces-c/gn/xerces-c/config.h.in new file mode 100755 index 00000000..aa261252 --- /dev/null +++ b/xerces-c/gn/xerces-c/config.h.in @@ -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 00000000..86996c7c --- /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 00000000..fc681660 --- /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 00000000..1d8ccdbe --- /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" +} -- Gitee