[v2,0/2] build and install only one library type on Windows

Message ID 1710484222-17310-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
Headers
Series build and install only one library type on Windows |

Message

Tyler Retzlaff March 15, 2024, 6:30 a.m. UTC
  MSVC is the only compiler that can produce usable shared libraries for
DPDK on Windows because of the use of exported TLS variables.

Disable building of shared libraries with LLVM and MinGW so that
remaining __declspec macros needed for the functional libraries built by
MSVC can be used without triggering errors in LLVM and MinGW builds.

For Windows only install the default_library type to avoid confusion.
Windows builds cannot build both shared and static in a single pass so
install only the functional variant

MSVC does not guarantee any kind of compatibility for static libraries so
they should not be packaged and instead they should be rebuilt along with
the application using the same version of the compiler & linker.  Because
of this we have chosen to build only one library type at a time instead of
compiling twice to produce both types in a single pass.

v2:
  * add patch to chkings to use static dependencies when building static
    cross build for windows target with mingw.
  * add missing msvc specific ldflags needed for shared builds.
  * define RTE_BUILD_SHARED_LIB for shared msvc builds.
  * fix is_shared_enabled conditional to check default_library=shared
    when building with msvc.
  * simplify linker flags when building for windows, we only need to
    provide flags for shared builds when building with msvc.
  * stop generating .def file for llvm and mingw builds, since no shared
    builds are performed the .def files would be unused.

Tyler Retzlaff (2):
  build: build only one library type on Windows
  buildtools: when building static library use static deps

 app/meson.build                       |  6 +++
 buildtools/chkincs/meson.build        | 18 +++++---
 config/meson.build                    | 27 ++++++++++++
 drivers/meson.build                   | 72 +++++++++++++++----------------
 drivers/net/octeontx/base/meson.build |  2 +-
 examples/meson.build                  |  6 +++
 lib/meson.build                       | 79 +++++++++++++++--------------------
 7 files changed, 121 insertions(+), 89 deletions(-)