Skip to content

Commit

Permalink
Revert slirp dynamic/static check, and make it not use dllimport/export
Browse files Browse the repository at this point in the history
when building statically
  • Loading branch information
nadiaholmquist committed May 15, 2024
1 parent d21bc64 commit cfc49eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/frontend/libslirp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
add_library(slirp STATIC ${SOURCES})
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")
Expand Down
10 changes: 7 additions & 3 deletions src/frontend/libslirp/src/libslirp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
#include <in6addr.h>
#include <basetsd.h>
typedef SSIZE_T slirp_ssize_t;
#ifdef BUILDING_LIBSLIRP
# define SLIRP_EXPORT __declspec(dllexport)
#ifndef LIBSLIRP_STATIC_BUILD
# ifdef BUILDING_LIBSLIRP
# define SLIRP_EXPORT __declspec(dllexport)
# else
# define SLIRP_EXPORT __declspec(dllimport)
# endif
#else
# define SLIRP_EXPORT __declspec(dllimport)
# define SLIRP_EXPORT
#endif
#else
#include <sys/types.h>
Expand Down

0 comments on commit cfc49eb

Please sign in to comment.