Skip to content

Commit

Permalink
use mingw64 instead of mingw32
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemeowx2 committed Sep 8, 2018
1 parent b60f6d9 commit c94146a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ if (WIN32)
winpcap
PREFIX ${CMAKE_BINARY_DIR}/winpcap
URL "https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip"
URL_MD5 "bae2236af062b0900ad1416b2c4878b9"
CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_DIR "" INSTALL_COMMAND ""
# LOG_DOWNLOAD ON
)
ExternalProject_Get_Property(winpcap SOURCE_DIR)
set(PCAP_ROOT_DIR ${SOURCE_DIR})
set(PCAP_INCLUDE_DIR ${SOURCE_DIR}/Include)
set(PCAP_LIBRARY ${SOURCE_DIR}/Lib/wpcap.lib)
set(PCAP_LIBRARY ${SOURCE_DIR}/Lib/x64/wpcap.lib)
message("PCAP_ROOT_DIR = ${PCAP_ROOT_DIR} INCLUDE = ${PCAP_INCLUDE_DIR}")
else()
include(cmake/FindPCAP.cmake)
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,12 @@ Use [MSYS2](http://www.msys2.org/) to compile.

```sh
pacman -Sy
pacman -S mingw-w64-i686-gcc \
mingw-w64-i686-cmake \
mingw-w64-i686-make \
mingw-w64-i686-libevent \
cmake
pacman -S mingw-w64-x86_64-gcc \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-make
```

Open `MSYS2 MinGW 32-bit`.
Open `MSYS2 MinGW 64-bit`.

```sh
mkdir build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")

set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX i686-w64-mingw32)
set(TOOLCHAIN_PREFIX i686-w64-mingw64)

# cross compilers to use for C and C++
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
Expand Down
10 changes: 5 additions & 5 deletions docker/Dockerfile.win
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && sed

RUN apt update
RUN apt install -y cmake make
RUN apt install -y mingw32 unzip
COPY ./cmake/toolchain-mingw32.cmake /
RUN apt install -y mingw-w64 unzip
COPY ./cmake/toolchain-mingw64.cmake /
RUN curl -L -o /tmp/libevent-2.1.8-stable.tar.gz https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
RUN tar xvf /tmp/libevent-2.1.8-stable.tar.gz -C /tmp
ENV HOST=i686-w64-mingw32
ENV TARGET=i686-w64-mingw32
ENV PREFIX=/usr/i686-w64-mingw32/
ENV HOST=i686-w64-mingw64
ENV TARGET=i686-w64-mingw64
ENV PREFIX=/usr/i686-w64-mingw64/
RUN cd /tmp/libevent-2.1.8-stable \
&& ./configure --host=$HOST --target=$TARGET --prefix=$PREFIX --disable-openssl --enable-shared=no \
&& make -j \
Expand Down

0 comments on commit c94146a

Please sign in to comment.