fix win32 build

pull/15/head
despair86 6 years ago
parent 8845f3ecc5
commit 4afa358c49

@ -456,7 +456,7 @@ include_directories(include)
include_directories(vendor/cppbackport-master/lib)
include_directories(${sodium_INCLUDE_DIR})
if (WIN32)
if (MSVC)
include_directories(contrib/msc/include)
endif()
@ -477,13 +477,13 @@ add_subdirectory(${GTEST_DIR})
include_directories(${GTEST_DIR}/include ${GTEST_DIR})
add_executable(${TEST_EXE} ${TEST_SRC})
if (WIN32)
if (MSVC)
target_link_libraries(${TEST_EXE} ${STATIC_LINK_LIBS} gtest_main ${STATIC_LIB} ws2_32 iphlpapi)
elseif (MINGW)
target_link_libraries(${TEST_EXE} ${STATIC_LINK_LIBS} gtest_main ${STATIC_LIB} stdc++fs iphlpapi ws2_32)
else()
target_link_libraries(${TEST_EXE} ${STATIC_LINK_LIBS} gtest_main ${STATIC_LIB})
endif(WIN32)
endif(MSVC)
if(WITH_STATIC)
add_library(${STATIC_LIB} STATIC ${LIB_SRC})

@ -19,8 +19,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>

@ -33,7 +33,11 @@ namespace llarp
typedef std::function< void(const fs::path &, PathVisitor) > PathIter;
static PathIter IterDir = [](const fs::path &path, PathVisitor visit) {
DIR *d = opendir(path.string().c_str());
#ifndef WIN32
DIR *d = opendir(path.c_str());
#else
DIR *d = opendir(path.u8string().c_str());
#endif
if(d == nullptr)
return;
struct dirent *ent = nullptr;

@ -3,6 +3,9 @@
#include <llarp/ip.hpp>
#include "llarp/buffer.hpp"
#include "mem.hpp"
#ifndef _WIN32
#include <netinet/in.h>
#endif
#include <llarp/endian.h>
#include <map>

Loading…
Cancel
Save