Skip to content

Commit

Permalink
Merge #313: cmake: Simplify introspection module
Browse files Browse the repository at this point in the history
17ca052 fixup! cmake: Add introspection module (Hennadii Stepanov)
d660c51 fixup! cmake: Add introspection module (Hennadii Stepanov)

Pull request description:

  Suggested in bitcoin#30454 (comment).

ACKs for top commit:
  fanquake:
    ACK 17ca052 - I haven't looked for any other instances.

Tree-SHA512: 40b767624fe525cc8691a9ebdcdabc67702984baf5aec2852d3d131918a69224bb708011b2b3101b3377bad32b226324bb7f42667e6d01fe94acb5e21cabe40f
  • Loading branch information
hebasto committed Aug 7, 2024
2 parents 41c8aac + 17ca052 commit ad2140d
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions cmake/introspection.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ check_include_file_cxx(sys/vmmeter.h HAVE_SYS_VMMETER_H)
check_include_file_cxx(vm/vm_param.h HAVE_VM_VM_PARAM_H)

check_cxx_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC)

check_include_file_cxx(unistd.h HAVE_UNISTD_H)
if(HAVE_UNISTD_H)
check_cxx_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
check_cxx_symbol_exists(fork "unistd.h" HAVE_DECL_FORK)
check_cxx_symbol_exists(pipe2 "unistd.h" HAVE_DECL_PIPE2)
check_cxx_symbol_exists(setsid "unistd.h" HAVE_DECL_SETSID)
endif()
check_cxx_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
check_cxx_symbol_exists(fork "unistd.h" HAVE_DECL_FORK)
check_cxx_symbol_exists(pipe2 "unistd.h" HAVE_DECL_PIPE2)
check_cxx_symbol_exists(setsid "unistd.h" HAVE_DECL_SETSID)

check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)
check_include_file_cxx(ifaddrs.h HAVE_IFADDRS_H)
Expand All @@ -38,20 +34,17 @@ if(HAVE_STD_SYSTEM OR HAVE__WSYSTEM)
set(HAVE_SYSTEM 1)
endif()

check_include_file_cxx(string.h HAVE_STRING_H)
if(HAVE_STRING_H)
check_cxx_source_compiles("
#include <string.h>
check_cxx_source_compiles("
#include <string.h>
int main()
{
char buf[100];
char* p{strerror_r(0, buf, sizeof buf)};
(void)p;
}
" STRERROR_R_CHAR_P
)
endif()
int main()
{
char buf[100];
char* p{strerror_r(0, buf, sizeof buf)};
(void)p;
}
" STRERROR_R_CHAR_P
)

# Check for malloc_info (for memory statistics information in getmemoryinfo).
check_cxx_symbol_exists(malloc_info "malloc.h" HAVE_MALLOC_INFO)
Expand Down

0 comments on commit ad2140d

Please sign in to comment.