From: T K Chandra Hasan Date: Wed, 17 Dec 2025 08:35:21 +0000 (+0530) Subject: cmake: While building fio headers, reference to macro BITS_PER_LONG defined by the... X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F66599%2Fhead;p=ceph.git cmake: While building fio headers, reference to macro BITS_PER_LONG defined by the fio's build is not being used in our CMake based system for plugins. Fixes: https://tracker.ceph.com/issues/74182 Signed-off-by: T K Chandra Hasan --- diff --git a/cmake/modules/BuildFIO.cmake b/cmake/modules/BuildFIO.cmake index 49fcfb31d973..453d8ca2fba4 100644 --- a/cmake/modules/BuildFIO.cmake +++ b/cmake/modules/BuildFIO.cmake @@ -15,6 +15,17 @@ function(build_fio) include(FindMake) find_make("MAKE_EXECUTABLE" "make_cmd") + include(CheckTypeSize) + check_type_size("void*" SIZEOF_VOID_P) + + if(SIZEOF_VOID_P EQUAL 8) + set(WORD_SIZE 64) + elseif(SIZEOF_VOID_P EQUAL 4) + set(WORD_SIZE 32) + else() + message(FATAL_ERROR "Unknown wordsize") + endif() + set(source_dir ${CMAKE_BINARY_DIR}/src/fio) file(MAKE_DIRECTORY ${source_dir}) ExternalProject_Add(fio_ext @@ -39,5 +50,6 @@ function(build_fio) set_target_properties(fio PROPERTIES CXX_EXTENSIONS ON INTERFACE_INCLUDE_DIRECTORIES ${source_dir} - INTERFACE_COMPILE_OPTIONS "-include;${source_dir}/config-host.h;$<$:-std=gnu99>") + INTERFACE_COMPILE_OPTIONS "-include;${source_dir}/config-host.h;$<$:-std=gnu99>" + INTERFACE_COMPILE_DEFINITIONS "BITS_PER_LONG=${WORD_SIZE}") endfunction()