Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mz丶苗
TDengine
提交
d39a3320
T
TDengine
项目概览
Mz丶苗
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d39a3320
编写于
7月 28, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-992] adjust cmake files
上级
2dafe91d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
122 addition
and
93 deletion
+122
-93
CMakeLists.txt
CMakeLists.txt
+1
-1
cmake/define.inc
cmake/define.inc
+104
-0
cmake/platform.inc
cmake/platform.inc
+14
-88
src/os/src/detail/osWchar.c
src/os/src/detail/osWchar.c
+1
-0
src/util/CMakeLists.txt
src/util/CMakeLists.txt
+2
-4
未找到文件。
CMakeLists.txt
浏览文件 @
d39a3320
...
...
@@ -16,8 +16,8 @@ MESSAGE(STATUS "Community directory: " ${TD_COMMUNITY_DIR})
INCLUDE
(
cmake/input.inc
)
INCLUDE
(
cmake/platform.inc
)
INCLUDE
(
cmake/env.inc
)
INCLUDE
(
cmake/define.inc
)
INCLUDE
(
cmake/env.inc
)
INCLUDE
(
cmake/install.inc
)
ADD_SUBDIRECTORY
(
deps
)
...
...
cmake/define.inc
浏览文件 @
d39a3320
...
...
@@ -28,3 +28,107 @@ ENDIF ()
IF
(
TD_RANDOM_NETWORK_FAIL
)
ADD_DEFINITIONS
(
-
DTAOS_RANDOM_NETWORK_FAIL
)
ENDIF
()
IF
(
TD_ARM
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
IF
(
TD_ARM_64
)
ADD_DEFINITIONS
(
-
D_TD_ARM_64_
)
ENDIF
()
IF
(
TD_ARM_32
)
ADD_DEFINITIONS
(
-
D_TD_ARM_32_
)
ENDIF
()
ENDIF
()
IF
(
TD_MIPS
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_
)
IF
(
TD_MIPS_64
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_64_
)
ENDIF
()
IF
(
TD_MIPS_32
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_32_
)
ENDIF
()
ENDIF
()
IF
(
TD_LINUX_64
)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_TD_LINUX_64
)
IF
(
NOT
TD_ARM
)
IF
(
$
{
CMAKE_CXX_COMPILER_ID
}
MATCHES
"Clang"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -g3 -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ELSE
()
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -malign-double -g3 -gdwarf-2 -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
ELSE
()
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
FIND_PATH
(
ICONV_INCLUDE_EXIST
iconv
.
h
/
usr
/
include
/
/
usr
/
local
/
include
/
)
IF
(
ICONV_INCLUDE_EXIST
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ENDIF
()
ENDIF
()
IF
(
TD_LINUX_32
)
ADD_DEFINITIONS
(
-
D_TD_LINUX_32
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -munaligned-access -fpack-struct=8 -latomic -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
IF
(
NOT
TD_ARM
)
EXIT
()
ENDIF
()
ENDIF
()
IF
(
TD_LINUX
)
ADD_DEFINITIONS
(
-
DLINUX
)
ADD_DEFINITIONS
(
-
D_TD_LINUX
)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
SET
(
DEBUG_FLAGS
"-O0 -DDEBUG"
)
SET
(
RELEASE_FLAGS
"-O0"
)
IF
(
$
{
COVER
}
MATCHES
"true"
)
MESSAGE
(
STATUS
"Test coverage mode, add extra flags"
)
SET
(
GCC_COVERAGE_COMPILE_FLAGS
"-fprofile-arcs -ftest-coverage"
)
SET
(
GCC_COVERAGE_LINK_FLAGS
"-lgcov --coverage"
)
SET
(
COMMON_FLAGS
"${COMMON_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}"
)
ENDIF
()
ENDIF
()
IF
(
TD_APLHINE
)
SET
(
COMMON_FLAGS
"${COMMON_FLAGS} -largp"
)
link_libraries
(
/
usr
/
lib
/
libargp
.
a
)
ADD_DEFINITIONS
(
-
D_ALPINE
)
ENDIF
()
IF
(
TD_DARWIN_64
)
ADD_DEFINITIONS
(
-
D_TD_DARWIN_64
)
ADD_DEFINITIONS
(
-
DDARWIN
)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -g -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
DEBUG_FLAGS
"-O0 -DDEBUG"
)
SET
(
RELEASE_FLAGS
"-O0"
)
ENDIF
()
IF
(
TD_WINDOWS
)
ADD_DEFINITIONS
(
-
DWINDOWS
)
ADD_DEFINITIONS
(
-
D__CLEANUP_C
)
ADD_DEFINITIONS
(
-
DPTW32_STATIC_LIB
)
ADD_DEFINITIONS
(
-
DPTW32_BUILD
)
ADD_DEFINITIONS
(
-
D_MBCS
-
D_CRT_SECURE_NO_DEPRECATE
-
D_CRT_NONSTDC_NO_DEPRECATE
)
SET
(
CMAKE_GENERATOR
"NMake Makefiles"
CACHE
INTERNAL
""
FORCE
)
IF
(
NOT
TD_GODLL
)
SET
(
COMMON_FLAGS
"/nologo /WX /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-"
)
SET
(
DEBUG_FLAGS
"/Zi /W3 /GL"
)
SET
(
RELEASE_FLAGS
"/W0 /GL"
)
ENDIF
()
ENDIF
()
IF
(
TD_WINDOWS_64
)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_TD_WINDOWS_64
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ENDIF
()
IF
(
TD_WINDOWS_32
)
ADD_DEFINITIONS
(
-
D_TD_WINDOWS_32
)
ENDIF
()
cmake/platform.inc
浏览文件 @
d39a3320
...
...
@@ -14,6 +14,7 @@ PROJECT(TDengine)
#
# Set macro definitions according to os platform
SET
(
TD_LINUX
FALSE
)
SET
(
TD_LINUX_64
FALSE
)
SET
(
TD_LINUX_32
FALSE
)
SET
(
TD_ARM
FALSE
)
...
...
@@ -22,8 +23,11 @@ SET(TD_ARM_32 FALSE)
SET
(
TD_MIPS
FALSE
)
SET
(
TD_MIPS_64
FALSE
)
SET
(
TD_MIPS_32
FALSE
)
SET
(
TD_
DARWIN_64
FALSE
)
SET
(
TD_
WINDOWS
FALSE
)
SET
(
TD_WINDOWS_64
FALSE
)
SET
(
TD_WINDOWS_32
FALSE
)
SET
(
TD_DARWIN_64
FALSE
)
SET
(
TD_APLHINE
FALSE
)
# if generate ARM version:
# cmake -DCPUTYPE=aarch32 .. or cmake -DCPUTYPE=aarch64
...
...
@@ -31,27 +35,21 @@ IF (${CPUTYPE} MATCHES "aarch32")
SET
(
TD_ARM
TRUE
)
SET
(
TD_ARM_32
TRUE
)
SET
(
TD_PAGMODE_LITE
TRUE
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
D_TD_ARM_32_
)
MESSAGE
(
STATUS
"input cpuType: aarch32"
)
ELSEIF
(
$
{
CPUTYPE
}
MATCHES
"aarch64"
)
SET
(
TD_ARM
TRUE
)
SET
(
TD_ARM_64
TRUE
)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
D_TD_ARM_64_
)
MESSAGE
(
STATUS
"input cpuType: aarch64"
)
MESSAGE
(
STATUS
"input cpuType: aarch64"
)
ELSEIF
(
$
{
CPUTYPE
}
MATCHES
"mips64"
)
SET
(
TD_MIPS
TRUE
)
SET
(
TD_MIPS_64
TRUE
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_64_
)
MESSAGE
(
STATUS
"input cpuType: mips64"
)
ELSEIF
(
$
{
CPUTYPE
}
MATCHES
"x64"
)
MESSAGE
(
STATUS
"input cpuType: x64"
)
ELSEIF
(
$
{
CPUTYPE
}
MATCHES
"x86"
)
MESSAGE
(
STATUS
"input cpuType: x86"
)
ELSE
()
MESSAGE
(
STATUS
"input cpuType
:
"
$
{
CPUTYPE
})
MESSAGE
(
STATUS
"input cpuType
unknown
"
$
{
CPUTYPE
})
ENDIF
()
#
...
...
@@ -62,16 +60,13 @@ execute_process(COMMAND ${TD_COMMUNITY_DIR}/packaging/tools/get_os.sh "" OUTPUT_
MESSAGE
(
STATUS
"The current os is "
$
{
TD_OS_INFO
})
IF
(
$
{
CMAKE_SYSTEM_NAME
}
MATCHES
"Linux"
)
SET
(
TD_LINUX
TRUE
)
IF
(
$
{
CMAKE_SIZEOF_VOID_P
}
MATCHES
8
)
SET
(
TD_LINUX_64
TRUE
)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_TD_LINUX_64
)
MESSAGE
(
STATUS
"The current platform is Linux 64-bit"
)
ELSEIF
(
$
{
CMAKE_SIZEOF_VOID_P
}
MATCHES
4
)
SET
(
TD_LINUX_32
TRUE
)
ADD_DEFINITIONS
(
-
D_TD_LINUX_32
)
IF
(
TD_ARM
)
#ADD_DEFINITIONS(-D_M_IX86)
MESSAGE
(
STATUS
"The current platform is Linux 32-bit"
)
ELSE
()
MESSAGE
(
FATAL_ERROR
"The current platform is Linux 32-bit, but no ARM not supported yet"
)
...
...
@@ -81,24 +76,26 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
MESSAGE
(
FATAL_ERROR
"The current platform is Linux neither 32-bit nor 64-bit, not supported yet"
)
EXIT
()
ENDIF
()
IF
(
$
{
TD_OS_INFO
}
MATCHES
"Alpine"
)
SET
(
TD_APLHINE
TRUE
)
MESSAGE
(
STATUS
"The current OS is Alpine, append extra flags"
)
ENDIF
()
ELSEIF
(
$
{
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
IF
(
$
{
CMAKE_SIZEOF_VOID_P
}
MATCHES
8
)
SET
(
TD_DARWIN_64
TRUE
)
ADD_DEFINITIONS
(
-
D_TD_DARWIN_64
)
MESSAGE
(
STATUS
"The current platform is Darwin 64-bit"
)
ELSE
()
MESSAGE
(
FATAL_ERROR
"The current platform is Darwin 32-bit, not supported yet"
)
EXIT
()
ENDIF
()
ELSEIF
(
$
{
CMAKE_SYSTEM_NAME
}
MATCHES
"Windows"
)
SET
(
TD_WINDOWS
TRUE
)
IF
(
$
{
CMAKE_SIZEOF_VOID_P
}
MATCHES
8
)
SET
(
TD_WINDOWS_64
TRUE
)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_TD_WINDOWS_64
)
MESSAGE
(
STATUS
"The current platform is Windows 64-bit"
)
ELSE
()
SET
(
TD_WINDOWS_32
TRUE
)
ADD_DEFINITIONS
(
-
D_TD_WINDOWS_32
)
MESSAGE
(
FATAL_ERROR
"The current platform is Windows 32-bit, not supported yet"
)
EXIT
()
ENDIF
()
...
...
@@ -106,74 +103,3 @@ ELSE()
MESSAGE
(
FATAL_ERROR
"The current platform is not Linux/Darwin/Windows, stop compile"
)
EXIT
()
ENDIF
()
IF
(
TD_LINUX_64
)
SET
(
DEBUG_FLAGS
"-O0 -DDEBUG"
)
SET
(
RELEASE_FLAGS
"-O0"
)
IF
(
NOT
TD_ARM
)
IF
(
$
{
CMAKE_CXX_COMPILER_ID
}
MATCHES
"Clang"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -g3 -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ELSE
()
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -malign-double -g3 -gdwarf-2 -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
ELSE
()
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
ADD_DEFINITIONS
(
-
DLINUX
)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
IF
(
$
{
TD_OS_INFO
}
MATCHES
"Alpine"
)
MESSAGE
(
STATUS
"The current OS is Alpine, append extra flags"
)
SET
(
COMMON_FLAGS
"${COMMON_FLAGS} -largp"
)
link_libraries
(
/
usr
/
lib
/
libargp
.
a
)
ADD_DEFINITIONS
(
-
D_ALPINE
)
ENDIF
()
IF
(
$
{
COVER
}
MATCHES
"true"
)
MESSAGE
(
STATUS
"Test coverage mode, add extra flags"
)
SET
(
GCC_COVERAGE_COMPILE_FLAGS
"-fprofile-arcs -ftest-coverage"
)
SET
(
GCC_COVERAGE_LINK_FLAGS
"-lgcov --coverage"
)
SET
(
COMMON_FLAGS
"${COMMON_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}"
)
ENDIF
()
ELSEIF
(
TD_LINUX_32
)
IF
(
NOT
TD_ARM
)
EXIT
()
ENDIF
()
SET
(
DEBUG_FLAGS
"-O0 -DDEBUG"
)
SET
(
RELEASE_FLAGS
"-O0"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -munaligned-access -fpack-struct=8 -latomic -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ADD_DEFINITIONS
(
-
DLINUX
)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
IF
(
$
{
TD_OS_INFO
}
MATCHES
"Alpine"
)
MESSAGE
(
STATUS
"The current OS is Alpine, add extra flags"
)
SET
(
COMMON_FLAGS
"${COMMON_FLAGS} -largp"
)
link_library
(
/
usr
/
lib
/
libargp
.
a
)
ADD_DEFINITIONS
(
-
D_ALPINE
)
ENDIF
()
IF
(
$
{
COVER
}
MATCHES
"true"
)
MESSAGE
(
STATUS
"Test coverage mode, add extra flags"
)
SET
(
GCC_COVERAGE_COMPILE_FLAGS
"-fprofile-arcs -ftest-coverage"
)
SET
(
GCC_COVERAGE_LINK_FLAGS
"-lgcov --coverage"
)
SET
(
COMMON_FLAGS
"${COMMON_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}"
)
ENDIF
()
ELSEIF
(
TD_WINDOWS_64
)
SET
(
CMAKE_GENERATOR
"NMake Makefiles"
CACHE
INTERNAL
""
FORCE
)
IF
(
NOT
TD_GODLL
)
SET
(
COMMON_FLAGS
"/nologo /WX /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-"
)
SET
(
DEBUG_FLAGS
"/Zi /W3 /GL"
)
SET
(
RELEASE_FLAGS
"/W0 /GL"
)
ENDIF
()
ADD_DEFINITIONS
(
-
DWINDOWS
)
ADD_DEFINITIONS
(
-
D__CLEANUP_C
)
ADD_DEFINITIONS
(
-
DPTW32_STATIC_LIB
)
ADD_DEFINITIONS
(
-
DPTW32_BUILD
)
ADD_DEFINITIONS
(
-
D_MBCS
-
D_CRT_SECURE_NO_DEPRECATE
-
D_CRT_NONSTDC_NO_DEPRECATE
)
ELSEIF
(
TD_DARWIN_64
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -g -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
DEBUG_FLAGS
"-O0 -DDEBUG"
)
SET
(
RELEASE_FLAGS
"-O0"
)
ADD_DEFINITIONS
(
-
DDARWIN
)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
ELSE
()
MESSAGE
(
FATAL_ERROR
"The current platform is not support yet, stop compile"
)
EXIT
()
ENDIF
()
src/os/src/detail/osWchar.c
浏览文件 @
d39a3320
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "os.h"
#include "tglobal.h"
#include "taosdef.h"
#ifndef TAOS_OS_FUNC_WCHAR
...
...
src/util/CMakeLists.txt
浏览文件 @
d39a3320
...
...
@@ -12,9 +12,10 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
AUX_SOURCE_DIRECTORY
(
src SRC
)
ADD_LIBRARY
(
tutil
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
tutil pthread osdetail m rt lz4
)
ADD_SUBDIRECTORY
(
tests
)
FIND_PATH
(
ICONV_INCLUDE_EXIST iconv.h /usr/include/ /usr/local/include/
)
IF
(
ICONV_INCLUDE_EXIST
)
ADD_DEFINITIONS
(
-DUSE_LIBICONV
)
FIND_PATH
(
ICONV_LIBRARY_A_EXIST libiconv.a /usr/lib/ /usr/local/lib/ /lib64
)
FIND_PATH
(
ICONV_LIBRARY_SO_EXIST libiconv.so /usr/lib/ /usr/local/lib/ /lib64
)
IF
(
ICONV_LIBRARY_A_EXIST OR ICONV_LIBRARY_SO_EXIST
)
...
...
@@ -28,9 +29,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
MESSAGE
(
STATUS
"Failed to find iconv, use default encoding method"
)
ENDIF
()
ADD_SUBDIRECTORY
(
tests
)
ELSEIF
(
TD_WINDOWS_64
)
ADD_DEFINITIONS
(
-DUSE_LIBICONV
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/pthread
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/iconv
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/regex
)
...
...
@@ -70,7 +69,6 @@ ELSEIF (TD_WINDOWS_64)
ADD_LIBRARY
(
tutil
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
tutil iconv regex pthread osdetail winmm IPHLPAPI ws2_32 lz4
)
ELSEIF
(
TD_DARWIN_64
)
ADD_DEFINITIONS
(
-DUSE_LIBICONV
)
AUX_SOURCE_DIRECTORY
(
src SRC
)
ADD_LIBRARY
(
tutil
${
SRC
}
)
TARGET_LINK_LIBRARIES
(
tutil iconv pthread osdetail lz4
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录