From d3d5ff48f193c7b55baec91b6ebec9b1b336d878 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Fri, 10 May 2024 21:42:29 +0200 Subject: [PATCH] CMake: use stdint.h if available --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cee9bc72fd..e6fa760852 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,12 @@ if( APPLE ) set(make_env ${CMAKE_COMMAND} -E env SDKROOT=${CMAKE_OSX_SYSROOT}) endif() +include(CheckIncludeFile) +check_include_file(stdint.h HAS_STDINT) +if(${HAS_STDINT}) + list(APPEND ABC_STDINT_FLAGS "ABC_USE_STDINT_H=1") +endif() + # run make to extract compiler options, linker options and list of source files execute_process( COMMAND @@ -58,6 +64,7 @@ execute_process( make ${ABC_READLINE_FLAGS} ${ABC_USE_NAMESPACE_FLAGS} + ${ABC_STDINT_FLAGS} ARCHFLAGS_EXE=${CMAKE_CURRENT_BINARY_DIR}/abc_arch_flags_program.exe ABC_MAKE_NO_DEPS=1 CC=${CMAKE_C_COMPILER}