From ee112120ffe39f3260a57e5776e573fd095e163f Mon Sep 17 00:00:00 2001 From: lihui Date: Mon, 11 Nov 2019 14:18:31 +0800 Subject: [PATCH] [TBASE-816] --- CMakeLists.txt | 18 +++++++++++------- src/client/CMakeLists.txt | 2 +- src/kit/shell/CMakeLists.txt | 2 +- src/kit/taosdemo/CMakeLists.txt | 2 +- src/kit/taosdump/CMakeLists.txt | 2 +- src/modules/http/CMakeLists.txt | 2 +- src/modules/monitor/CMakeLists.txt | 2 +- src/os/linux/CMakeLists.txt | 2 +- src/rpc/CMakeLists.txt | 2 +- src/sdb/CMakeLists.txt | 2 +- src/system/detail/CMakeLists.txt | 2 +- src/system/lite/CMakeLists.txt | 2 +- src/util/CMakeLists.txt | 2 +- src/util/src/tcrc32c.c | 2 +- 14 files changed, 24 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff5da13254..9a3a406cc3 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,12 +38,16 @@ IF (NOT DEFINED TD_CLUSTER) # Set macro definitions according to os platform SET(TD_LINUX_64 FALSE) SET(TD_LINUX_32 FALSE) - SET(_TD_ARM_ FALSE) - SET(_TD_ARM_64 FALSE) - SET(_TD_ARM_32 FALSE) + SET(TD_ARM FALSE) + SET(TD_ARM_64 FALSE) + SET(TD_ARM_32 FALSE) SET(TD_MIPS_64 FALSE) SET(TD_DARWIN_64 FALSE) SET(TD_WINDOWS_64 FALSE) + + IF (TD_ARM) + ADD_DEFINITIONS(-D_TD_ARM_) + ENDIF () IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") IF (${CMAKE_SIZEOF_VOID_P} MATCHES 8) @@ -52,7 +56,7 @@ IF (NOT DEFINED TD_CLUSTER) ADD_DEFINITIONS(-D_M_X64) MESSAGE(STATUS "The current platform is Linux 64-bit") ELSEIF (${CMAKE_SIZEOF_VOID_P} MATCHES 4) - IF (_TD_ARM_) + IF (TD_ARM) SET(TD_LINUX_32 TRUE) SET(TD_OS_DIR ${TD_COMMUNITY_DIR}/src/os/linux) #ADD_DEFINITIONS(-D_M_IX86) @@ -112,7 +116,7 @@ IF (NOT DEFINED TD_CLUSTER) IF (TD_LINUX_64) SET(DEBUG_FLAGS "-O0 -DDEBUG") SET(RELEASE_FLAGS "-O0") - IF (NOT _TD_ARM_) + IF (NOT TD_ARM) IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") ELSE () @@ -124,7 +128,7 @@ IF (NOT DEFINED TD_CLUSTER) ADD_DEFINITIONS(-DLINUX) ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT) ELSEIF (TD_LINUX_32) - IF (NOT _TD_ARM_) + IF (NOT TD_ARM) EXIT () ENDIF () SET(DEBUG_FLAGS "-O0 -DDEBUG") @@ -194,7 +198,7 @@ IF (NOT DEFINED TD_CLUSTER) INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR})") ELSEIF (TD_LINUX_32) - IF (NOT _TD_ARM_) + IF (NOT TD_ARM) EXIT () ENDIF () SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index de03125438..d3baf84d67 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) AUX_SOURCE_DIRECTORY(./src SRC) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/linux) # set the static lib name diff --git a/src/kit/shell/CMakeLists.txt b/src/kit/shell/CMakeLists.txt index 96dcec64c8..7442367e91 100644 --- a/src/kit/shell/CMakeLists.txt +++ b/src/kit/shell/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(inc) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) AUX_SOURCE_DIRECTORY(./src SRC) LIST(REMOVE_ITEM SRC ./src/shellWindows.c) ADD_EXECUTABLE(shell ${SRC}) diff --git a/src/kit/taosdemo/CMakeLists.txt b/src/kit/taosdemo/CMakeLists.txt index 5384fce62d..599875fa60 100644 --- a/src/kit/taosdemo/CMakeLists.txt +++ b/src/kit/taosdemo/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(inc) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) AUX_SOURCE_DIRECTORY(. SRC) ADD_EXECUTABLE(taosdemo ${SRC}) TARGET_LINK_LIBRARIES(taosdemo taos_static) diff --git a/src/kit/taosdump/CMakeLists.txt b/src/kit/taosdump/CMakeLists.txt index 49940add9a..76b40d1c2d 100644 --- a/src/kit/taosdump/CMakeLists.txt +++ b/src/kit/taosdump/CMakeLists.txt @@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(inc) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) AUX_SOURCE_DIRECTORY(. SRC) ADD_EXECUTABLE(taosdump ${SRC}) TARGET_LINK_LIBRARIES(taosdump taos_static) diff --git a/src/modules/http/CMakeLists.txt b/src/modules/http/CMakeLists.txt index 4805271d66..d8dccb526a 100644 --- a/src/modules/http/CMakeLists.txt +++ b/src/modules/http/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/zlib-1.2.11/inc) diff --git a/src/modules/monitor/CMakeLists.txt b/src/modules/monitor/CMakeLists.txt index baa5e6218c..44ac8aae0b 100644 --- a/src/modules/monitor/CMakeLists.txt +++ b/src/modules/monitor/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) diff --git a/src/os/linux/CMakeLists.txt b/src/os/linux/CMakeLists.txt index 14e7e06b23..a702cac759 100644 --- a/src/os/linux/CMakeLists.txt +++ b/src/os/linux/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(inc) AUX_SOURCE_DIRECTORY(src SRC) diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index febb3eb83f..8d54d5fda5 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(inc) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) AUX_SOURCE_DIRECTORY(./src SRC) ELSEIF (TD_DARWIN_64) LIST(APPEND SRC ./src/thaship.c) diff --git a/src/sdb/CMakeLists.txt b/src/sdb/CMakeLists.txt index 08cdb4baef..6b29eefde6 100644 --- a/src/sdb/CMakeLists.txt +++ b/src/sdb/CMakeLists.txt @@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) INCLUDE_DIRECTORIES(inc) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) AUX_SOURCE_DIRECTORY(src SRC) ADD_LIBRARY(sdb ${SRC}) TARGET_LINK_LIBRARIES(sdb trpc) diff --git a/src/system/detail/CMakeLists.txt b/src/system/detail/CMakeLists.txt index 16468e7984..95cce3dfe6 100644 --- a/src/system/detail/CMakeLists.txt +++ b/src/system/detail/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/http/inc) diff --git a/src/system/lite/CMakeLists.txt b/src/system/lite/CMakeLists.txt index e9257b2388..a22ed60563 100644 --- a/src/system/lite/CMakeLists.txt +++ b/src/system/lite/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/http/inc) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index b36ae3a4b5..e73428353e 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc) -IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_)) +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 os m rt) diff --git a/src/util/src/tcrc32c.c b/src/util/src/tcrc32c.c index 88841bcbc9..705ca5872a 100644 --- a/src/util/src/tcrc32c.c +++ b/src/util/src/tcrc32c.c @@ -1353,7 +1353,7 @@ uint32_t crc32c_hw(uint32_t crc, crc_stream buf, size_t len) { #endif // #ifndef _TD_ARM_ void taosResolveCRC() { -#ifndef _TD_ARM_32 +#ifndef _TD_ARM_ int sse42; SSE42(sse42); crc32c = sse42 ? crc32c_hw : crc32c_sf; -- GitLab