Luiz Vitor Martinez Cardoso
Luiz Vitor Martinez Cardoso
@mrdeep1 I tried to add `check_function_exists(if_nametoindex HAVE_IF_NAMETOINDEX)` to CMakeLists.txt and rebuild, but the errors persist: ``` -- Configuring done CMake Warning (dev) at CMakeLists.txt:26 (add_library): Policy CMP0115 is not set:...
If **net.c**: ``` // #ifdef HAVE_IF_NAMETOINDEX mreq6.ipv6mr_interface = if_nametoindex(ifr.ifr_name); if (mreq6.ipv6mr_interface == 0) { coap_log(LOG_WARNING, "coap_join_mcast_group_intf: " "cannot get interface index for '%s'\n", ifname); } // #else /* !HAVE_IF_NAMETOINDEX */...
@mrdeep1 ## CMakeLists.txt ``` . . . check_function_exists(getrandom HAVE_GETRANDOM) check_function_exists(if_nametoindex HAVE_IF_NAMETOINDEX) # check for symbols if(WIN32) set(HAVE_STRUCT_CMSGHDR 1) else() . . . ``` ``` . . . if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif()...
This thing is not working: ``` check_function_exists(if_nametoindex HAVE_IF_NAMETOINDEX) ``` If: ``` #ifdef HAVE_IF_NAMETOINDEX mreq6.ipv6mr_interface = if_nametoindex(ifr.ifr_name); if (mreq6.ipv6mr_interface == 0) { coap_log(LOG_WARNING, "coap_join_mcast_group_intf: " "cannot get interface index for '%s'\n",...
@mrdeep1 The strange thing is that the following also doesn't work: # CMakeLists.txt ``` # check_function_exists(if_nametoindex HAVE_IF_NAMETOINDEX) set(HAVE_IF_NAMETOINDEX 1) ```
https://cmake.org/cmake/help/latest/module/CheckFunctionExists.html ``` check_function_exists() only verifies linking, it does not verify that the function is declared in system headers. ```  Maybe none of the...
@mrdeep1 ``` (base) lvmc@Luizs-MacBook-Pro build % cmake --version cmake version 3.20.5 ``` ## CMakeError.log ``` Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ Build flags: Id flags:...
It seems CMake is able to find `if_nametoindex`, but somehow `HAVE_IF_NAMETOINDEX` isn't being set or isn't visible at `net.c` ``` . . . -- Looking for strrchr -- Looking for...
@mrdeep1 That was a good catch, now it's working! ## CMakeLists.txt ``` check_function_exists(if_nametoindex HAVE_IF_NAMETOINDEX) ``` ``` if(APPLE) add_definitions(-D__APPLE_USE_RFC_3542=1) endif() ``` ## cmake_coap_config.h.in ``` /* Define to 1 if you have...
@mrdeep1 Tried to remove your suggestion: ``` ${CMAKE_CURRENT_LIST_DIR}/include/coap${LIBCOAP_API_VERSION}/coap.h.in ``` But the warning is still there: ``` -- Configuring done CMake Warning (dev) at CMakeLists.txt:26 (add_library): Policy CMP0115 is not set:...