# check for libraries used in multiple places in DPDK
has_libnuma = 0
-numa_dep = cc.find_library('numa', required: false)
-if numa_dep.found() and cc.has_header('numaif.h')
- dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
- has_libnuma = 1
- add_project_link_arguments('-lnuma', language: 'c')
- dpdk_extra_ldflags += '-lnuma'
+find_libnuma = true
+if meson.is_cross_build() and not meson.get_cross_property('numa', true)
+ # don't look for libnuma if explicitly disabled in cross build
+ find_libnuma = false
+endif
+if find_libnuma
+ numa_dep = cc.find_library('numa', required: false)
+ if numa_dep.found() and cc.has_header('numaif.h')
+ dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
+ has_libnuma = 1
+ add_project_link_arguments('-lnuma', language: 'c')
+ dpdk_extra_ldflags += '-lnuma'
+ endif
endif
has_libfdt = 0
subdir(arch_subdir)
dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
+# apply cross-specific options
+if meson.is_cross_build()
+ # configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+ cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+ if cross_max_lcores != 0
+ message('Setting RTE_MAX_LCORE from cross file')
+ dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+ endif
+ cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+ if cross_max_numa_nodes != 0
+ message('Setting RTE_MAX_NUMA_NODES from cross file')
+ dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+ endif
+endif
+
# set the install path for the drivers
dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: 'c')
endif
+ # Disable secure CRT deprecated warnings for clang
+ if cc.get_id() == 'clang'
+ add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: 'c')
+ endif
+
add_project_link_arguments('-lws2_32', language: 'c')
# Contrary to docs, VirtualAlloc2() is exported by mincore.lib