From bd6f9ee91834eccf6b70e1f4874f68b0b57354f7 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 13 Aug 2020 00:17:48 +0800 Subject: [PATCH] TD-1047 change some definitions in arm64 platform --- cmake/define.inc | 1 + cmake/install.inc | 14 +++----------- cmake/platform.inc | 1 - src/os/CMakeLists.txt | 12 ++++-------- src/os/inc/os.h | 2 +- src/os/src/{linux64 => linux}/CMakeLists.txt | 0 src/os/src/{linux64 => linux}/linuxEnv.c | 0 src/rpc/test/CMakeLists.txt | 2 +- src/sync/test/CMakeLists.txt | 2 +- src/wal/test/CMakeLists.txt | 2 +- tests/comparisonTest/tdengine/CMakeLists.txt | 2 +- 11 files changed, 13 insertions(+), 25 deletions(-) rename src/os/src/{linux64 => linux}/CMakeLists.txt (100%) rename src/os/src/{linux64 => linux}/linuxEnv.c (100%) diff --git a/cmake/define.inc b/cmake/define.inc index b1e8f097be..2e3c639ecb 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -47,6 +47,7 @@ IF (TD_LINUX_32) ENDIF () IF (TD_ARM_64) + ADD_DEFINITIONS(-D_M_X64) ADD_DEFINITIONS(-D_TD_ARM_64_) ADD_DEFINITIONS(-D_TD_ARM_) SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") diff --git a/cmake/install.inc b/cmake/install.inc index 432e925b05..997101c8d9 100755 --- a/cmake/install.inc +++ b/cmake/install.inc @@ -1,17 +1,9 @@ -IF (TD_LINUX_64) +IF (TD_LINUX) SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") 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) - EXIT () - ENDIF () - SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") - INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") - 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_WINDOWS_64) +ELSEIF (TD_WINDOWS) SET(CMAKE_INSTALL_PREFIX C:/TDengine) IF (NOT TD_GODLL) #INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/go DESTINATION connector) @@ -33,7 +25,7 @@ ELSEIF (TD_WINDOWS_64) INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libtaos.dll DESTINATION driver) INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libtaos.dll.a DESTINATION driver) ENDIF () -ELSEIF (TD_DARWIN_64) +ELSEIF (TD_DARWIN) SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")") INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})") diff --git a/cmake/platform.inc b/cmake/platform.inc index ffde56aab2..11ab8f301d 100755 --- a/cmake/platform.inc +++ b/cmake/platform.inc @@ -43,7 +43,6 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux") ELSEIF (${CMAKE_SIZEOF_VOID_P} MATCHES 4) SET(TD_LINUX_32 TRUE) MESSAGE(STATUS "The current platform is Linux 32-bit") - ELSE () MESSAGE(FATAL_ERROR "The current platform is Linux neither 32-bit nor 64-bit, not supported yet") EXIT () diff --git a/src/os/CMakeLists.txt b/src/os/CMakeLists.txt index b4ad4ad915..4e44d29a02 100644 --- a/src/os/CMakeLists.txt +++ b/src/os/CMakeLists.txt @@ -1,15 +1,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF (TD_LINUX_64) - ADD_SUBDIRECTORY(src/linux64) -ELSEIF (TD_LINUX_32) - ADD_SUBDIRECTORY(src/linux32) -ELSEIF (TD_DARWIN_64) +IF (TD_LINUX) + ADD_SUBDIRECTORY(src/linux) +ELSEIF (TD_DARWIN) ADD_SUBDIRECTORY(src/darwin) -ELSEIF (TD_WINDOWS_64) - ADD_SUBDIRECTORY(src/windows) -ELSEIF (TD_WINDOWS_32) +ELSEIF (TD_WINDOWS) ADD_SUBDIRECTORY(src/windows) ENDIF () diff --git a/src/os/inc/os.h b/src/os/inc/os.h index 2005072ad1..4953416bde 100644 --- a/src/os/inc/os.h +++ b/src/os/inc/os.h @@ -24,7 +24,7 @@ extern "C" { #include "osDarwin.h" #endif -#ifdef _TD_ARM_64 +#ifdef _TD_ARM_64_ #include "osArm64.h" #endif diff --git a/src/os/src/linux64/CMakeLists.txt b/src/os/src/linux/CMakeLists.txt similarity index 100% rename from src/os/src/linux64/CMakeLists.txt rename to src/os/src/linux/CMakeLists.txt diff --git a/src/os/src/linux64/linuxEnv.c b/src/os/src/linux/linuxEnv.c similarity index 100% rename from src/os/src/linux64/linuxEnv.c rename to src/os/src/linux/linuxEnv.c diff --git a/src/rpc/test/CMakeLists.txt b/src/rpc/test/CMakeLists.txt index 286c8e1680..383ce1b0f6 100644 --- a/src/rpc/test/CMakeLists.txt +++ b/src/rpc/test/CMakeLists.txt @@ -3,7 +3,7 @@ PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/rpc/inc) -IF (TD_LINUX_64) +IF (TD_LINUX) LIST(APPEND CLIENT_SRC ./rclient.c) ADD_EXECUTABLE(rclient ${CLIENT_SRC}) TARGET_LINK_LIBRARIES(rclient trpc) diff --git a/src/sync/test/CMakeLists.txt b/src/sync/test/CMakeLists.txt index a309539024..27614454f9 100644 --- a/src/sync/test/CMakeLists.txt +++ b/src/sync/test/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF (TD_LINUX_64) +IF (TD_LINUX) INCLUDE_DIRECTORIES(../inc) LIST(APPEND CLIENT_SRC ./syncClient.c) diff --git a/src/wal/test/CMakeLists.txt b/src/wal/test/CMakeLists.txt index 6fdb03710e..6c232ce4b9 100644 --- a/src/wal/test/CMakeLists.txt +++ b/src/wal/test/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF (TD_LINUX_64) +IF (TD_LINUX) INCLUDE_DIRECTORIES(../inc) LIST(APPEND WALTEST_SRC ./waltest.c) diff --git a/tests/comparisonTest/tdengine/CMakeLists.txt b/tests/comparisonTest/tdengine/CMakeLists.txt index 2555bdce91..990612b8c3 100644 --- a/tests/comparisonTest/tdengine/CMakeLists.txt +++ b/tests/comparisonTest/tdengine/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF (TD_LINUX_64) +IF (TD_LINUX) add_executable(tdengineTest tdengineTest.c) target_link_libraries(tdengineTest taos_static tutil common pthread) ENDIF() -- GitLab