2019-08-03 21:53:24 +08:00
|
|
|
#pragma once
|
2019-06-16 20:49:20 +08:00
|
|
|
#ifndef HIKYUU_CONFIG_H_
|
|
|
|
#define HIKYUU_CONFIG_H_
|
|
|
|
|
2021-01-30 16:16:51 +08:00
|
|
|
#ifdef __APPLE__
|
|
|
|
#include <TargetConditionals.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* CPU 架构宏定义
|
|
|
|
*/
|
|
|
|
#if defined(__arm__)
|
|
|
|
#define HKU_ARCH_ARM 1
|
|
|
|
#define HKU_ARCH_ARM64 0
|
|
|
|
#define HKU_ARCH_X86 0
|
|
|
|
#define HKU_ARCH_X64 0
|
|
|
|
#elif defined(__aarch64__)
|
|
|
|
#define HKU_ARCH_ARM 0
|
|
|
|
#define HKU_ARCH_ARM64 1
|
|
|
|
#define HKU_ARCH_X86 0
|
|
|
|
#define HKU_ARCH_X64 0
|
|
|
|
#elif defined(__x86_64__) || defined(_WIN64)
|
|
|
|
#define HKU_ARCH_ARM 0
|
|
|
|
#define HKU_ARCH_ARM64 0
|
|
|
|
#define HKU_ARCH_X86 0
|
|
|
|
#define HKU_ARCH_X64 1
|
|
|
|
#elif defined(__i386__) || defined(_WIN32)
|
|
|
|
#define HKU_ARCH_ARM 0
|
|
|
|
#define HKU_ARCH_ARM64 0
|
|
|
|
#define HKU_ARCH_X86 1
|
|
|
|
#define HKU_ARCH_X64 0
|
|
|
|
#else
|
|
|
|
#define HKU_ARCH_ARM 0
|
|
|
|
#define HKU_ARCH_ARM64 0
|
|
|
|
#define HKU_ARCH_X86 0
|
|
|
|
#define HKU_ARCH_X64 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 操作系统宏定义
|
|
|
|
*/
|
|
|
|
#if defined(_WIN32) || defined(_WIN64)
|
|
|
|
#define HKU_OS_WINOWS 1
|
|
|
|
#define HKU_OS_LINUX 0
|
|
|
|
#define HKU_OS_ANDROID 0
|
|
|
|
#define HKU_OS_OSX 0
|
|
|
|
#define HKU_OS_IOS 0
|
|
|
|
#elif defined(__ANDROID__)
|
|
|
|
#define HKU_OS_WINOWS 0
|
|
|
|
#define HKU_OS_LINUX 0
|
|
|
|
#define HKU_OS_ANDROID 1
|
|
|
|
#define HKU_OS_OSX 0
|
|
|
|
#define HKU_OS_IOS 0
|
|
|
|
#elif defined(__linux__)
|
|
|
|
#define HKU_OS_WINOWS 0
|
|
|
|
#define HKU_OS_LINUX 1
|
|
|
|
#define HKU_OS_ANDROID 0
|
|
|
|
#define HKU_OS_OSX 0
|
|
|
|
#define HKU_OS_IOS 0
|
|
|
|
#elif TARGET_OS_OSX
|
|
|
|
#define HKU_OS_WINOWS 0
|
|
|
|
#define HKU_OS_LINUX 0
|
|
|
|
#define HKU_OS_ANDROID 0
|
|
|
|
#define HKU_OS_OSX 1
|
|
|
|
#define HKU_OS_IOS 0
|
|
|
|
#elif TARGET_OS_IOS || TARGET_OS_IPHONE
|
|
|
|
#define HKU_OS_WINOWS 0
|
|
|
|
#define HKU_OS_LINUX 0
|
|
|
|
#define HKU_OS_ANDROID 0
|
|
|
|
#define HKU_OS_OSX 0
|
|
|
|
#define HKU_OS_IOS 1
|
|
|
|
#else
|
|
|
|
#define HKU_OS_WINOWS 0
|
|
|
|
#define HKU_OS_LINUX 0
|
|
|
|
#define HKU_OS_ANDROID 0
|
|
|
|
#define HKU_OS_OSX 0
|
|
|
|
#define HKU_OS_IOS 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// IOS 模拟器
|
|
|
|
#if HKU_OS_IOS && TARGET_OS_SIMULATOR
|
|
|
|
#define HKU_OS_IOS_SIMULATOR 1
|
|
|
|
#else
|
|
|
|
#define HKU_OS_IOS_SIMULATOR 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// ARM NEON 优化
|
|
|
|
#if HKU_OS_ANDROID && HKU_ARCH_ARM64
|
|
|
|
#define HKU_ENBALE_NEON 0
|
|
|
|
#else
|
|
|
|
#define HKU_ENBALE_NEON 0
|
|
|
|
#endif
|
|
|
|
|
2020-04-10 01:54:49 +08:00
|
|
|
// clang-format off
|
|
|
|
|
2019-06-16 20:49:20 +08:00
|
|
|
// support serialization
|
|
|
|
#define HKU_SUPPORT_SERIALIZATION ${SUPPORT_SERIALIZATION}
|
|
|
|
|
|
|
|
#if HKU_SUPPORT_SERIALIZATION
|
|
|
|
#define HKU_SUPPORT_TEXT_ARCHIVE ${SUPPORT_TEXT_ARCHIVE}
|
|
|
|
#define HKU_SUPPORT_XML_ARCHIVE ${SUPPORT_XML_ARCHIVE} //must 1 for python
|
|
|
|
#define HKU_SUPPORT_BINARY_ARCHIVE ${SUPPORT_BINARY_ARCHIVE} //must 1 for python
|
|
|
|
#endif /* HKU_SUPPORT_SERIALIZATION*/
|
|
|
|
|
|
|
|
// 检查下标越界
|
|
|
|
#define CHECK_ACCESS_BOUND ${CHECK_ACCESS_BOUND}
|
|
|
|
|
2020-04-10 01:54:49 +08:00
|
|
|
// 默认激活的日志级别
|
|
|
|
#define LOG_ACTIVE_LEVEL ${LOG_ACTIVE_LEVEL}
|
|
|
|
|
|
|
|
// 是否使用 spdlog
|
|
|
|
#define USE_SPDLOG_LOGGER ${USE_SPDLOG_LOGGER}
|
|
|
|
|
2019-06-16 20:49:20 +08:00
|
|
|
// 使用异步 logger
|
2020-04-10 01:54:49 +08:00
|
|
|
#define HKU_USE_SPDLOG_ASYNC_LOGGER ${USE_SPDLOG_ASYNC_LOGGER}
|
|
|
|
|
|
|
|
// spdlog默认日志级别
|
|
|
|
#define SPDLOG_ACTIVE_LEVEL ${LOG_ACTIVE_LEVEL}
|
2019-06-16 20:49:20 +08:00
|
|
|
|
2019-12-15 01:25:00 +08:00
|
|
|
// 关闭 HKU_ASSERT
|
|
|
|
#define HKU_DISABLE_ASSERT ${HKU_DISABLE_ASSERT}
|
|
|
|
|
2020-04-10 01:54:49 +08:00
|
|
|
// clang-format on
|
|
|
|
|
2019-06-16 20:49:20 +08:00
|
|
|
#endif /* HIKYUU_CONFIG_H_ */
|