Revert slirp dynamic/static check, and make it not use dllimport/export

when building statically
This commit is contained in:
Nadia Holmquist Pedersen 2024-05-15 19:37:14 +02:00
parent d21bc64cb3
commit cfc49eb286
2 changed files with 9 additions and 8 deletions

View File

@ -46,11 +46,8 @@ set(SOURCES
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/libslirp-version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/libslirp-version.h")
if (BUILD_STATIC)
add_library(slirp STATIC ${SOURCES})
else()
add_library(slirp ${SOURCES})
endif()
target_compile_definitions(slirp PRIVATE LIBSLIRP_STATIC_BUILD)
target_include_directories(slirp PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/glib")
target_include_directories(slirp PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")

View File

@ -12,12 +12,16 @@
#include <in6addr.h>
#include <basetsd.h>
typedef SSIZE_T slirp_ssize_t;
#ifndef LIBSLIRP_STATIC_BUILD
# ifdef BUILDING_LIBSLIRP
# define SLIRP_EXPORT __declspec(dllexport)
# else
# define SLIRP_EXPORT __declspec(dllimport)
# endif
#else
# define SLIRP_EXPORT
#endif
#else
#include <sys/types.h>
typedef ssize_t slirp_ssize_t;
#include <netinet/in.h>