ClickHouse/contrib/libhdfs3-cmake/CMake/Options.cmake

45 lines
1.5 KiB
CMake
Raw Normal View History

2021-10-11 03:58:08 +00:00
OPTION(ENABLE_SSE "enable SSE4.2 builtin function" ON)
2018-11-19 08:17:09 +00:00
INCLUDE (CheckFunctionExists)
CHECK_FUNCTION_EXISTS(dladdr HAVE_DLADDR)
CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing")
2019-01-23 15:24:14 +00:00
IF(ENABLE_SSE STREQUAL ON AND NOT ARCH_PPC64LE AND NOT ARCH_AARCH64 AND NOT ARCH_ARM)
2018-11-19 08:17:09 +00:00
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2")
2019-01-23 15:24:14 +00:00
ENDIF(ENABLE_SSE STREQUAL ON AND NOT ARCH_PPC64LE AND NOT ARCH_AARCH64 AND NOT ARCH_ARM)
2018-11-19 08:17:09 +00:00
IF(NOT TEST_HDFS_PREFIX)
SET(TEST_HDFS_PREFIX "./" CACHE STRING "default directory prefix used for test." FORCE)
ENDIF(NOT TEST_HDFS_PREFIX)
ADD_DEFINITIONS(-DTEST_HDFS_PREFIX="${TEST_HDFS_PREFIX}")
ADD_DEFINITIONS(-D__STDC_FORMAT_MACROS)
ADD_DEFINITIONS(-D_GNU_SOURCE)
ADD_DEFINITIONS(-D_GLIBCXX_USE_NANOSLEEP)
2018-11-19 08:17:09 +00:00
TRY_COMPILE(STRERROR_R_RETURN_INT
2021-10-11 03:58:08 +00:00
${CMAKE_CURRENT_BINARY_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeTestCompileStrerror.c"
2018-11-19 08:17:09 +00:00
CMAKE_FLAGS "-DCMAKE_CXX_LINK_EXECUTABLE='echo not linking now...'"
2021-10-11 03:58:08 +00:00
OUTPUT_VARIABLE OUTPUT)
2018-11-19 08:17:09 +00:00
MESSAGE(STATUS "Checking whether strerror_r returns an int")
IF(STRERROR_R_RETURN_INT)
2021-10-11 03:58:08 +00:00
MESSAGE(STATUS "Checking whether strerror_r returns an int -- yes")
2018-11-19 08:17:09 +00:00
ELSE(STRERROR_R_RETURN_INT)
2021-10-11 03:58:08 +00:00
MESSAGE(STATUS "Checking whether strerror_r returns an int -- no")
2018-11-19 08:17:09 +00:00
ENDIF(STRERROR_R_RETURN_INT)
2021-10-11 03:58:08 +00:00
set(HAVE_STEADY_CLOCK 1)
set(HAVE_NESTED_EXCEPTION 1)
2018-11-19 08:17:09 +00:00
SET(HAVE_BOOST_CHRONO 0)
SET(HAVE_BOOST_ATOMIC 0)
2018-11-19 08:17:09 +00:00
SET(HAVE_STD_CHRONO 1)
SET(HAVE_STD_ATOMIC 1)