Skip to content

Commit f7d0ae5

Browse files
tejlmandcfriedt
authored andcommitted
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 <[email protected]>
1 parent a084ec5 commit f7d0ae5

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

drivers/ethernet/CMakeLists.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,12 @@ zephyr_library_sources_ifdef(CONFIG_ETH_SAM_GMAC eth_sam_gmac.c)
2626
zephyr_library_sources_ifdef(CONFIG_DSA_KSZ8XXX dsa_ksz8xxx.c)
2727

2828
if(CONFIG_ETH_NATIVE_POSIX)
29-
zephyr_library_named(drivers__ethernet__native_posix)
30-
zephyr_library_compile_definitions(
31-
NO_POSIX_CHEATS
32-
_BSD_SOURCE
33-
_DEFAULT_SOURCE
34-
)
35-
zephyr_library_sources(
36-
eth_native_posix.c
37-
eth_native_posix_adapt.c
38-
)
29+
set(native_posix_source_files eth_native_posix.c eth_native_posix_adapt.c)
30+
set_source_files_properties(${native_posix_source_files}
31+
PROPERTIES COMPILE_DEFINITIONS
32+
"NO_POSIX_CHEATS;_BSD_SOURCE;_DEFAULT_SOURCE"
33+
)
34+
zephyr_library_sources(${native_posix_source_files})
3935
endif()
4036

4137
add_subdirectory(phy)

0 commit comments

Comments
 (0)