From e8eb8a8c2cdb80bdc8f760e16b1d523583597d61 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Fri, 10 Sep 2021 16:57:54 +0200 Subject: [PATCH] drivers: ethernet: remove dedicated drivers__ethernet__native_posix lib Fixes: #38403 The two eth_native_posix.c and eth_native_posix_adapt.c are now added to the common drivers__ethernet Zephyr library. Instead of creating a dedicated library for just two files those files are now added to the common ethernet library, see also #8826. Instead, the dedicated compile definitions required for those files are specified using COMPILE_DEFINITIONS on the source files. This also avoids the following warning as the ethernet library is no longer empty. > No SOURCES given to Zephyr library: drivers__ethernet > > Excluding target from build. Signed-off-by: Torsten Rasmussen --- drivers/ethernet/CMakeLists.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/ethernet/CMakeLists.txt b/drivers/ethernet/CMakeLists.txt index c50e75516780fc..0db2724bfd893a 100644 --- a/drivers/ethernet/CMakeLists.txt +++ b/drivers/ethernet/CMakeLists.txt @@ -26,16 +26,12 @@ zephyr_library_sources_ifdef(CONFIG_ETH_SAM_GMAC eth_sam_gmac.c) zephyr_library_sources_ifdef(CONFIG_DSA_KSZ8XXX dsa_ksz8xxx.c) if(CONFIG_ETH_NATIVE_POSIX) - zephyr_library_named(drivers__ethernet__native_posix) - zephyr_library_compile_definitions( - NO_POSIX_CHEATS - _BSD_SOURCE - _DEFAULT_SOURCE - ) - zephyr_library_sources( - eth_native_posix.c - eth_native_posix_adapt.c - ) + set(native_posix_source_files eth_native_posix.c eth_native_posix_adapt.c) + set_source_files_properties(${native_posix_source_files} + PROPERTIES COMPILE_DEFINITIONS + "NO_POSIX_CHEATS;_BSD_SOURCE;_DEFAULT_SOURCE" + ) + zephyr_library_sources(${native_posix_source_files}) endif() add_subdirectory(phy)