Skip to content

Commit

Permalink
CMake: use check_c_source_compiles() for FSTATAT_PATH_ACCEPTS_NULL
Browse files Browse the repository at this point in the history
is a bit more convenient and avoids an extra file
  • Loading branch information
jbuening authored and ccadar committed Jun 5, 2023
1 parent 58fb505 commit 5eca7f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
23 changes: 17 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ option(KLEE_ENABLE_TIMESTAMP "Add timestamps to KLEE sources" OFF)
# Include useful CMake functions
################################################################################
include(GNUInstallDirs)
include(CheckCSourceCompiles)
include(CheckCXXSymbolExists)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckLibraryExists)
include(CheckPrototypeDefinition)
include(CMakePushCheckState)
include(CheckFunctionExists)
include(CheckLibraryExists)

################################################################################
# Find LLVM
Expand Down Expand Up @@ -394,10 +395,20 @@ else()
set(HAVE_SELINUX 0)
endif()

try_compile (FSTATAT_PATH_ACCEPTS_NULL
${CMAKE_BINARY_DIR}
${PROJECT_SOURCE_DIR}/cmake/fstatat.c
)
cmake_push_check_state()
check_c_source_compiles("
#include <fcntl.h>
#include <stddef.h>
#include <sys/stat.h>
int main(void) {
struct stat buf;
#pragma GCC diagnostic error \"-Wnonnull\"
fstatat(0, NULL, &buf, 0);
}
"
FSTATAT_PATH_ACCEPTS_NULL)
cmake_pop_check_state()

################################################################################
# KLEE runtime support
Expand Down
9 changes: 0 additions & 9 deletions cmake/fstatat.c

This file was deleted.

0 comments on commit 5eca7f3

Please sign in to comment.