From f68a1e526c4fbd0630b827db668d65d436ec6963 Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Wed, 10 Jan 2024 18:25:31 +0200 Subject: [PATCH] Enable Fat runtime on x86 by default to help migration from hyperscan --- CMakeLists.txt | 5 ++++- cmake/osdetection.cmake | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d256e7ed..0cf3c0f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,6 @@ INCLUDE (CheckLibraryExists) INCLUDE (CheckSymbolExists) include (CMakeDependentOption) include (GNUInstallDirs) -include (${CMAKE_MODULE_PATH}/platform.cmake) include (${CMAKE_MODULE_PATH}/boost.cmake) include (${CMAKE_MODULE_PATH}/ragel.cmake) @@ -123,6 +122,10 @@ if (RELEASE_BUILD) add_definitions(-DNDEBUG) endif() +# Architecture detection + +include (${CMAKE_MODULE_PATH}/platform.cmake) + # Detect OS and if Fat Runtime is available include (${CMAKE_MODULE_PATH}/osdetection.cmake) diff --git a/cmake/osdetection.cmake b/cmake/osdetection.cmake index 343e16b5..59f2b342 100644 --- a/cmake/osdetection.cmake +++ b/cmake/osdetection.cmake @@ -6,7 +6,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(FREEBSD true) endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") -option(FAT_RUNTIME "Build a library that supports multiple microarchitectures" OFF) +if (ARCH_IA32 OR ARCH_X86_64) + option(FAT_RUNTIME "Build a library that supports multiple microarchitectures" ON) +else() + option(FAT_RUNTIME "Build a library that supports multiple microarchitectures" OFF) +endif() + if (FAT_RUNTIME) message("Checking Fat Runtime Requirements...") if (NOT LINUX)