]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix defining HAVE_SYS_SDT_H with CMake
authorIlya Leoshkevich iii@linux.ibm.com <iii@linux.ibm.com>
Tue, 16 Mar 2021 13:26:53 +0000 (14:26 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 16 Mar 2021 15:20:32 +0000 (16:20 +0100)
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

CMakeLists.txt

index b57e1e66ec751bd9fe05bbc5c7fc529ac1fc6c5c..6cfd64f9ed712b85c4f138841153c86a1e8a703c 100644 (file)
@@ -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)
 
 #