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") 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})
add_library(slirp STATIC ${SOURCES}) target_compile_definitions(slirp PRIVATE LIBSLIRP_STATIC_BUILD)
else()
add_library(slirp ${SOURCES})
endif()
target_include_directories(slirp PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/glib") target_include_directories(slirp PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/glib")
target_include_directories(slirp PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src") target_include_directories(slirp PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")

View File

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