From: Ilya Leoshkevich iii@linux.ibm.com Date: Tue, 16 Mar 2021 13:26:53 +0000 (+0100) Subject: Fix defining HAVE_SYS_SDT_H with CMake X-Git-Tag: 2.0.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb791930b26b3c275b99e0db5fd7f0db35179cc4;p=thirdparty%2Fzlib-ng.git Fix defining HAVE_SYS_SDT_H with CMake DFLTCC probe points are never activated when compiling with CMake. This is because check_include_file() only sets an internal CMake variable, but not a C define [1]. Fix as the link suggests - by adding an explicit add_definitions. [1] https://cmake.org/pipermail/cmake/2015-June/060830.html --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b57e1e66e..6cfd64f9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -314,13 +314,16 @@ if(WITH_NATIVE_INSTRUCTIONS AND DEFINED NATIVEFLAG) endif() # -# Check for stndard/system includes +# Check for standard/system includes # check_include_file(sys/types.h HAVE_SYS_TYPES_H) check_include_file(stdarg.h HAVE_STDARG_H) check_include_file(stdint.h HAVE_STDINT_H) check_include_file(stddef.h HAVE_STDDEF_H) check_include_file(sys/sdt.h HAVE_SYS_SDT_H) +if(HAVE_SYS_SDT_H) + add_definitions(-DHAVE_SYS_SDT_H) +endif() check_include_file(unistd.h HAVE_UNISTD_H) #