try to make some windows

pull/726/head
Michael 5 years ago
parent 518b94b91d
commit df498c7bf8
No known key found for this signature in database
GPG Key ID: 2D51757B47E2434C

@ -12,42 +12,46 @@ matrix:
dist: xenial
env: DOCKER_FILE=docker/router.Dockerfile
services: docker
# - os: linux
# dist: xenial
# compiler: gcc
# env: BUILD_TYPE=Release
# - os: linux
# dist: xenial
# compiler: clang
# env: BUILD_TYPE=Debug
# - os: linux
# dist: xenial
# compiler: clang
# env: BUILD_TYPE=Release
# - os: osx
# osx_image: xcode10.2
# compiler: gcc
# env: BUILD_TYPE=Debug
# - os: osx
# osx_image: xcode10.2
# compiler: gcc
# env: BUILD_TYPE=Release
# - os: osx
# osx_image: xcode10.2
# env: BUILD_TYPE=Debug PATH="/usr/local/opt/ccache/libexec:$PATH"
# - os: osx
# osx_image: xcode10.2
# env: BUILD_TYPE=Release PATH="/usr/local/opt/ccache/libexec:$PATH"
# - os: osx
# osx_image: xcode11
# env: BUILD_TYPE=Release PATH="/usr/local/opt/ccache/libexec:$PATH"
# - os: osx
# osx_image: xcode10.2
# env: BUILD_TYPE=Release PATH="/usr/local/opt/ccache/libexec:$PATH" CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++
# - os: windows
# env: BUILD_TYPE=Debug
# - os: windows
# env: BUILD_TYPE=Release
- os: linux
dist: xenial
compiler: gcc
env: MAKE_TARGET=windows BUILD_TYPE=Release
- os: linux
dist: xenial
compiler: gcc
env: BUILD_TYPE=Release
- os: linux
dist: xenial
compiler: clang
env: BUILD_TYPE=Debug
- os: linux
dist: xenial
compiler: clang
env: BUILD_TYPE=Release
- os: osx
osx_image: xcode10.2
compiler: gcc
env: BUILD_TYPE=Debug
- os: osx
osx_image: xcode10.2
compiler: gcc
env: BUILD_TYPE=Release
- os: osx
osx_image: xcode10.2
env: BUILD_TYPE=Debug PATH="/usr/local/opt/ccache/libexec:$PATH"
- os: osx
osx_image: xcode10.2
env: BUILD_TYPE=Release PATH="/usr/local/opt/ccache/libexec:$PATH"
- os: osx
osx_image: xcode11
env: BUILD_TYPE=Release PATH="/usr/local/opt/ccache/libexec:$PATH"
- os: osx
osx_image: xcode10.2
env: BUILD_TYPE=Release PATH="/usr/local/opt/ccache/libexec:$PATH" CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++
- os: windows
env: BUILD_TYPE=Debug
- os: windows
env: BUILD_TYPE=Release
env:
global:
@ -62,9 +66,13 @@ addons:
- cmake
- curl
- docker-ce
- g++-mingw-w64
- g++-mingw-w64-x86-64
- gcc-mingw-w64-base
- git
- libcap-dev
- libuv1-dev
- mingw-w64 mingw-w64-common
- ninja-build
homebrew:
packages:
@ -89,7 +97,7 @@ script:
elif [[ ! -z $DOCKER_FILE ]]; then
docker build -f $DOCKER_FILE .;
else
make test;
make ${MAKE_TARGET:-test};
fi
after_script:

@ -83,7 +83,7 @@ CMAKE_GEN ?= Unix Makefiles
ifdef NINJA
MAKE = $(NINJA) -k0
MAKE = $(NINJA)
CMAKE_GEN = Ninja
endif

@ -6,10 +6,11 @@ enable_language(RC)
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lshlwapi")
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_compile_options(/EHca /arch:AVX2 /MD)
add_definitions(-D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING)
if(NOT MSVC_VERSION)
if(MSVC_VERSION)
add_compile_options(/EHca /arch:AVX2 /MD)
add_definitions(-D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING)
else()
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-bad-function-cast>)
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-cast-function-type>)
# unlike unix where you get a *single* compiler ID string in .comment

@ -1,5 +1,6 @@
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
set(TOOLCHAIN_SUFFIX posix)
add_definitions("-DWINNT_CROSS_COMPILE")
@ -14,12 +15,14 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# cross compilers to use
if($ENV{COMPILER} MATCHES "clang")
set(USING_CLANG ON)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-clang)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-clang++)
set(USING_CLANG ON)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-clang)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-clang++)
else()
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc-${TOOLCHAIN_SUFFIX})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++-${TOOLCHAIN_SUFFIX})
add_compile_options("-Wa,-mbig-obj")
set(FS_LIB stdc++fs)
endif()
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

@ -0,0 +1,10 @@
FROM debian:stable
RUN apt update && \
apt install -y build-essential cmake git libcap-dev curl ninja-build libuv1-dev g++-mingw-w64 gcc-mingw-w64-base g++-mingw-w64-x86-64 mingw-w64 mingw-w64-common
WORKDIR /src/
COPY . /src/
RUN make windows NINJA=ninja

@ -8,10 +8,7 @@
#define PATH_SEP "/"
#endif
#ifdef WIN32
#include <filesystem>
namespace fs = std::filesystem;
#elif defined(LOKINET_USE_CPPBACKPORT)
#if defined(LOKINET_USE_CPPBACKPORT)
#include <filesystem.h>
namespace fs = cpp17::filesystem;
#else

@ -5,7 +5,7 @@
#include <absl/synchronization/mutex.h>
#include <absl/time/time.h>
#ifdef WIN32
#if defined(WIN32) && !defined(__GNUC__)
#include <process.h>
using pid_t = int;
#else

@ -19,7 +19,7 @@
#include "absl/base/config.h"
#ifdef _WIN32
#include <Windows.h>
#include <windows.h>
#else
#include <pthread.h>
#endif
@ -131,12 +131,12 @@ class Waiter {
std::atomic<int> wakeup_count_;
#else
#error Unknown ABSL_WAITER_MODE
#error Unknown ABSL_WAITER_MODE
#endif
};
} // namespace synchronization_internal
} // inline namespace lts_2018_12_18
} // namespace lts_2018_12_18
} // namespace absl
#endif // ABSL_SYNCHRONIZATION_INTERNAL_WAITER_H_

Loading…
Cancel
Save