@cryptotaxi247 / netdata-1 / commits / 0e7cde465

Assorted build-related changes. (#16906)

* Rename endian.h to byte_order.h The underlying issue is that non-relative header search paths would pick up our own endian.h. This should be fixed in a follow-up PR. * Do not include top-level source dir * Move h2o dep from libnetdata to netdata binary. * Update #endif comment.

vkalintiris committed Feb 26, 2024 at 15:48 UTC 0e7cde465cc456dd5a35ce7aba5b2e00631bca62
3 files changed +7 -9
CMakeLists.txt
+3 -5
@@ -598,7 +598,7 @@ set(LIBNETDATA_FILES
598 src/libnetdata/os.c
599 src/libnetdata/os.h
600 src/libnetdata/simple_hashtable.h
601 - src/libnetdata/endian.h
601 + src/libnetdata/byteorder.h
602 src/libnetdata/onewayalloc/onewayalloc.c
603 src/libnetdata/onewayalloc/onewayalloc.h
604 src/libnetdata/popen/popen.c
@@ -1464,7 +1464,7 @@ detect_systemd()
1464
1465 add_library(libnetdata STATIC ${LIBNETDATA_FILES})
1466
1467 -target_include_directories(libnetdata BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src)
1467 +target_include_directories(libnetdata BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR}/src)
1468
1469 # pthread (FIXME: use find_package for this)
1470
@@ -1592,9 +1592,6 @@ target_include_directories(libnetdata BEFORE PUBLIC ${OPENSSL_INCLUDE_DIRS})
1592 target_compile_options(libnetdata PUBLIC ${OPENSSL_CFLAGS_OTHER})
1593 target_link_libraries(libnetdata PUBLIC ${OPENSSL_LDFLAGS})
1594
1595 -# h2o
1596 -target_link_libraries(libnetdata PUBLIC "$<$<BOOL:${ENABLE_H2O}>:h2o>")
1597 -
1595 # mnl
1596 pkg_check_modules(MNL libmnl)
1597 if(MNL_FOUND)
@@ -2056,6 +2053,7 @@ target_link_libraries(netdata PRIVATE
2053 "$<$<BOOL:${MACOS}>:${IOKIT};${FOUNDATION}>"
2054 "$<$<BOOL:${ENABLE_SENTRY}>:sentry>"
2055 "$<$<BOOL:${ENABLE_WEBRTC}>:LibDataChannel::LibDataChannelStatic>"
2056 + "$<$<BOOL:${ENABLE_H2O}>:h2o>"
2057 )
2058
2059 #
src/libnetdata/byteorder.h renamed
+3 -3
@@ -1,5 +1,5 @@
1 -#ifndef LIBNETDATA_ENDIAN_H
2 -#define LIBNETDATA_ENDIAN_H
1 +#ifndef LIBNETDATA_BYTE_ORDER_H
2 +#define LIBNETDATA_BYTE_ORDER_H
3
4 /** compatibility header for endian.h
5 * This is a simple compatibility shim to convert
@@ -29,4 +29,4 @@
29 #define be64toh(x) OSSwapBigToHostInt64(x)
30 #define le64toh(x) OSSwapLittleToHostInt64(x)
31
32 -#endif /* LIBNETDATA_ENDIAN_H */
32 +#endif /* LIBNETDATA_BYTE_ORDER_H */
src/libnetdata/os.h
+1 -1
@@ -37,7 +37,7 @@ int getsysctl(const char *name, int *mib, size_t miblen, void *ptr, size_t *len)
37 #if __APPLE__
38
39 #include <sys/sysctl.h>
40 -#include "endian.h"
40 +#include "byteorder.h"
41
42 #define GETSYSCTL_BY_NAME(name, var) getsysctl_by_name(name, &(var), sizeof(var))
43 int getsysctl_by_name(const char *name, void *ptr, size_t len);