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

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

@ -6,10 +6,11 @@ enable_language(RC)
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lshlwapi") set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lshlwapi")
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) 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-bad-function-cast>)
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-cast-function-type>) add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-cast-function-type>)
# unlike unix where you get a *single* compiler ID string in .comment # unlike unix where you get a *single* compiler ID string in .comment

@ -1,5 +1,6 @@
set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32) set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
set(TOOLCHAIN_SUFFIX posix)
add_definitions("-DWINNT_CROSS_COMPILE") add_definitions("-DWINNT_CROSS_COMPILE")
@ -14,12 +15,14 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# cross compilers to use # cross compilers to use
if($ENV{COMPILER} MATCHES "clang") if($ENV{COMPILER} MATCHES "clang")
set(USING_CLANG ON) set(USING_CLANG ON)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-clang) set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-clang)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-clang++) set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-clang++)
else() else()
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc) set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc-${TOOLCHAIN_SUFFIX})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++) set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++-${TOOLCHAIN_SUFFIX})
add_compile_options("-Wa,-mbig-obj")
set(FS_LIB stdc++fs)
endif() endif()
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres) 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 "/" #define PATH_SEP "/"
#endif #endif
#ifdef WIN32 #if defined(LOKINET_USE_CPPBACKPORT)
#include <filesystem>
namespace fs = std::filesystem;
#elif defined(LOKINET_USE_CPPBACKPORT)
#include <filesystem.h> #include <filesystem.h>
namespace fs = cpp17::filesystem; namespace fs = cpp17::filesystem;
#else #else

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

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

Loading…
Cancel
Save