enable specify compiler from build.sh for fuzz compile test

This commit is contained in:
wenxingsen
2023-05-18 02:46:57 +00:00
committed by ob-robot
parent d01cd9f310
commit a8cb21a8bf

View File

@ -23,6 +23,9 @@ ob_define(OB_CMAKE_RULES_CHECK ON)
ob_define(OB_STATIC_LINK_LGPL_DEPS ON) ob_define(OB_STATIC_LINK_LGPL_DEPS ON)
ob_define(HOTFUNC_PATH "${CMAKE_SOURCE_DIR}/hotfuncs.txt") ob_define(HOTFUNC_PATH "${CMAKE_SOURCE_DIR}/hotfuncs.txt")
ob_define(OB_BUILD_CCLS OFF) ob_define(OB_BUILD_CCLS OFF)
# get compiler from build.sh
ob_define(OB_CC "")
ob_define(OB_CXX "")
# 'ENABLE_PERF_MODE' use for offline system insight performance test # 'ENABLE_PERF_MODE' use for offline system insight performance test
# PERF_MODE macro controls many special code path in system # PERF_MODE macro controls many special code path in system
@ -72,12 +75,23 @@ set(OB_OBJCOPY_BIN "${DEVTOOLS_DIR}/bin/objcopy")
ob_define(OB_RELRO_FLAG "-Wl,-z,relro,-z,now") ob_define(OB_RELRO_FLAG "-Wl,-z,relro,-z,now")
if (OB_USE_CLANG) if (OB_USE_CLANG)
find_program(OB_CC clang
"${DEVTOOLS_DIR}/bin" if (OB_CC)
NO_DEFAULT_PATH) message(STATUS "Using OB_CC compiler: ${OB_CC}")
find_program(OB_CXX clang++ else()
"${DEVTOOLS_DIR}/bin" find_program(OB_CC clang
NO_DEFAULT_PATH) "${DEVTOOLS_DIR}/bin"
NO_DEFAULT_PATH)
endif()
if (OB_CXX)
message(STATUS "Using OB_CXX compiler: ${OB_CXX}")
else()
find_program(OB_CXX clang++
"${DEVTOOLS_DIR}/bin"
NO_DEFAULT_PATH)
endif()
find_file(GCC9 devtools find_file(GCC9 devtools
PATHS ${CMAKE_SOURCE_DIR}/deps/3rd/usr/local/oceanbase PATHS ${CMAKE_SOURCE_DIR}/deps/3rd/usr/local/oceanbase
NO_DEFAULT_PATH) NO_DEFAULT_PATH)