From: Kefu Chai Date: Tue, 31 Oct 2017 09:39:02 +0000 (+0800) Subject: cmake: should check the availability of aligned_alloc() by running the test X-Git-Tag: v13.0.1~355^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18645%2Fhead;p=ceph.git cmake: should check the availability of aligned_alloc() by running the test this mimics the failure of rocksdb without a working aligned_alloc()/free(). Signed-off-by: Kefu Chai --- diff --git a/cmake/modules/BuildRocksDB.cmake b/cmake/modules/BuildRocksDB.cmake index da6e18d04e08..d62f7458058e 100644 --- a/cmake/modules/BuildRocksDB.cmake +++ b/cmake/modules/BuildRocksDB.cmake @@ -1,4 +1,4 @@ -include(CheckCXXSourceCompiles) +include(CheckCXXSourceRuns) function(do_build_rocksdb) set(ROCKSDB_CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON) @@ -42,13 +42,13 @@ endfunction() function(check_aligned_alloc) set(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) - set(CMAKE_REQUIRED_FLAGS "-std=c++11 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -nostdlib") + set(CMAKE_REQUIRED_FLAGS "-std=c++11 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") if(LINUX) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE") endif() set(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) set(CMAKE_REQUIRED_LIBRARIES ${GPERFTOOLS_TCMALLOC_LIBRARY}) - CHECK_CXX_SOURCE_COMPILES(" + CHECK_CXX_SOURCE_RUNS(" #include int main()