From be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 04:57:58 +0200 Subject: Adding upstream version 1.44.3. Signed-off-by: Daniel Baumann --- .../luajit-cmake/Modules/DetectArchitecture.cmake | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 fluent-bit/lib/luajit-cmake/Modules/DetectArchitecture.cmake (limited to 'fluent-bit/lib/luajit-cmake/Modules/DetectArchitecture.cmake') diff --git a/fluent-bit/lib/luajit-cmake/Modules/DetectArchitecture.cmake b/fluent-bit/lib/luajit-cmake/Modules/DetectArchitecture.cmake new file mode 100755 index 00000000..a35c5238 --- /dev/null +++ b/fluent-bit/lib/luajit-cmake/Modules/DetectArchitecture.cmake @@ -0,0 +1,37 @@ + +##===- DetectArchitecture.cmake -------------------------------------------===## +# +# Performs a try_compile to determine the architecture of the target. +# +##===----------------------------------------------------------------------===## +get_filename_component(__check_architecture_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) + +macro(detect_architecture variable) + try_compile(HAVE_${variable} + ${CMAKE_BINARY_DIR} + ${__check_architecture_size_dir}/DetectArchitecture.c + OUTPUT_VARIABLE OUTPUT + COPY_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DetectArchitecture.bin) + + if(HAVE_${variable}) + file(STRINGS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/DetectArchitecture.bin + DETECT_ARCH_STRING LIMIT_COUNT 1 REGEX "ARCHITECTURE IS") + if(DETECT_ARCH_STRING) + string(REGEX MATCH "[^ ]*$" DETECT_ARCH_MATCH ${DETECT_ARCH_STRING}) + if(DETECT_ARCH_MATCH) + message(STATUS "Check target system architecture: ${DETECT_ARCH_MATCH}") + set(${variable} ${DETECT_ARCH_MATCH}) + else() + message(SEND_ERROR "Could not detect target system architecture!") + endif() + else() + message(SEND_ERROR "Could not detect target system architecture!") + endif() + else() + message(STATUS "Determine the system architecture - failed") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining the system architecture failed with the following output:\n${OUTPUT}") + set(${variable}) + endif() + +endmacro(detect_architecture) -- cgit v1.2.3