]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: While building fio headers, reference to macro BITS_PER_LONG defined by the... 66599/head
authorT K Chandra Hasan <t.k.chandra.hasan@ibm.com>
Wed, 17 Dec 2025 08:35:21 +0000 (14:05 +0530)
committerT K Chandra Hasan <t.k.chandra.hasan@ibm.com>
Wed, 17 Dec 2025 08:36:05 +0000 (14:06 +0530)
Fixes: https://tracker.ceph.com/issues/74182
Signed-off-by: T K Chandra Hasan <t.k.chandra.hasan@ibm.com>
cmake/modules/BuildFIO.cmake

index 49fcfb31d973e1266e1f7f4f9ff7f3bd997e67c7..453d8ca2fba42a4f48f26f105456262404509bf5 100644 (file)
@@ -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;$<$<COMPILE_LANGUAGE:C>:-std=gnu99>")
+    INTERFACE_COMPILE_OPTIONS "-include;${source_dir}/config-host.h;$<$<COMPILE_LANGUAGE:C>:-std=gnu99>"
+    INTERFACE_COMPILE_DEFINITIONS "BITS_PER_LONG=${WORD_SIZE}")
 endfunction()