From 5affebbd9c710940dd44003d0cee8073746dfd8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruenich@dune-project.org>
Date: Fri, 20 Mar 2015 09:02:38 +0100
Subject: [PATCH] [CMake] Don't search for malloc.h, stdint.h and memory.

We assume anyway that stdint.h and memrory are provided. The
according macros are never used. They were probably provided
to stay as compatible to Autotools as possible.
This fixes FS#1605.
---
 cmake/modules/DuneMacros.cmake   | 8 --------
 cmake/modules/FindMProtect.cmake | 1 +
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/cmake/modules/DuneMacros.cmake b/cmake/modules/DuneMacros.cmake
index 92d9fa06c..db641b59e 100644
--- a/cmake/modules/DuneMacros.cmake
+++ b/cmake/modules/DuneMacros.cmake
@@ -597,14 +597,6 @@ macro(dune_project)
 
   include(DuneCxaDemangle)
 
-  # search for headers
-  include(CheckIncludeFile)
-  include(CheckIncludeFileCXX)
-  check_include_file("malloc.h" HAVE_MALLOC_H)
-  check_include_file("stdint.h" HAVE_STDINT_H)
-  check_include_file_cxx("memory" HAVE_MEMORY)
-  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -DHAVE_MEMORY=${HAVE_MEMORY}")
-
   # set include path and link path for the current project.
   include_directories("${CMAKE_BINARY_DIR}")
   include_directories("${CMAKE_SOURCE_DIR}")
diff --git a/cmake/modules/FindMProtect.cmake b/cmake/modules/FindMProtect.cmake
index 955ae1abd..779c9a9a8 100644
--- a/cmake/modules/FindMProtect.cmake
+++ b/cmake/modules/FindMProtect.cmake
@@ -4,6 +4,7 @@
 # Sets the following variables
 # HAVE_SYS_MMAN_H
 # HAVE_MPROTECT
+include(CheckIncludeFile)
 check_include_file("sys/mman.h" HAVE_SYS_MMAN_H)
 include(CheckCSourceCompiles)
 check_c_source_compiles("
-- 
GitLab