[1/2] build: build eal library with MSVC
Checks
Commit Message
* MSVC now has limited handling of GCC __extension__ keyword when
compiling C so only expand __extension__ empty on MSVC when
building with C++.
* When building with MSVC enable the statement expressions compiler
extension.
* When building with MSVC enable building of eal library.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
config/meson.build | 7 ++++++-
lib/eal/include/rte_common.h | 2 ++
lib/meson.build | 1 +
3 files changed, 9 insertions(+), 1 deletion(-)
@@ -39,13 +39,18 @@ if is_ms_compiler
# temporarily disable msvc specific warnings
# - 4244 compiler detected conversion of integer to smaller type
# - 4267 compiler detected conversion of size_t to smaller type
- add_project_arguments('/wd4244', '/wd4267', language: 'c')
+ # - 4146 unary minus applied to unsigned type
+ add_project_arguments('/wd4244', '/wd4267', '/wd4146', language: 'c')
# enable non-locking atomic operations
add_project_arguments('/experimental:c11atomics', language: 'c')
# enable typeof operator
add_project_arguments('/d1experimental:typeof', language: 'c')
+
+ # enable statement expressions extension
+ add_project_arguments('/experimental:statementExpressions', language: 'c')
+
endif
# set the major version, which might be used by drivers and libraries
@@ -38,8 +38,10 @@
#endif
#ifdef RTE_TOOLCHAIN_MSVC
+#ifdef __cplusplus
#define __extension__
#endif
+#endif
/*
* RTE_TOOLCHAIN_GCC is defined if the target is built with GCC,
@@ -73,6 +73,7 @@ if is_ms_compiler
'log',
'kvargs',
'telemetry',
+ 'eal',
]
endif