From ad211d2c75e7a02cae54fee071345e0822ed2850 Mon Sep 17 00:00:00 2001 From: Masahiro Sakai Date: Wed, 29 Aug 2018 18:22:27 +0900 Subject: [PATCH 1/2] enable LINK_STATIC_LIBPROTOBUF on MINGW --- cmake/SetupProtobuf.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/SetupProtobuf.cmake b/cmake/SetupProtobuf.cmake index b33f863..5ddaf6e 100644 --- a/cmake/SetupProtobuf.cmake +++ b/cmake/SetupProtobuf.cmake @@ -5,7 +5,7 @@ if(LINK_STATIC_LIBPROTOBUF) # because `libprotobuf.a` produced by the package manager is not PIC. So we need to # build it by ourselves. - if(UNIX) + if(UNIX OR MINGW) set(PROTOBUF_VERSION_STATIC "3.6.1") set(PROTOBUF_DIR ${CMAKE_CURRENT_BINARY_DIR}/protobuf-${PROTOBUF_VERSION_STATIC}) set(PROTOBUF_URL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION_STATIC}/protobuf-cpp-${PROTOBUF_VERSION_STATIC}.tar.gz") From 3a76eca9df6d3f6bcd5246fc79f60d8a3b669f5a Mon Sep 17 00:00:00 2001 From: Masahiro Sakai Date: Thu, 30 Aug 2018 10:22:46 +0900 Subject: [PATCH 2/2] appveyor: add a job for building libmenoh that statically link dependent libraries --- appveyor.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f8000cb..a999bcb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,6 +10,8 @@ image: environment: matrix: - TARGET: mingw + - TARGET: mingw + STATIC: 1 - TARGET: msvc install: @@ -57,7 +59,14 @@ build_script: - cd build - if [%TARGET%]==[msvc] set PATH=%PATH%;c:\protobuf-3.6.0-msvc\bin;c:\protobuf-3.6.0-msvc\include;c:\protobuf-3.6.0-msvc\lib;c:\projects\menoh\mkl-dnn-0.15-win64\bin;c:\projects\menoh\mkl-dnn-0.15-win64\include;c:\projects\menoh\mkl-dnn-0.15-win64\lib - if [%TARGET%]==[mingw] ( - cmake -G "MSYS Makefiles" -DENABLE_TEST=ON -DCMAKE_INSTALL_PREFIX=/mingw64 .. && + if [%STATIC%]==[1] ( + set STATIC_OPTION="-DLINK_STATIC_LIBPROTOBUF=ON -DLINK_STATIC_LIBSTDCXX=ON -DLINK_STATIC_LIBGCC=ON" + ) else ( + set STATIC_OPTION="" + ) + ) +- if [%TARGET%]==[mingw] ( + cmake -G "MSYS Makefiles" -DENABLE_TEST=ON -DLINK_STATIC_LIBPROTOBUF=ON -DCMAKE_INSTALL_PREFIX=/mingw64 .. && make ) else ( cmake -G "Visual Studio 14 Win64" -DENABLE_TEST=OFF -DENABLE_BENCHMARK=OFF -DENABLE_EXAMPLE=OFF -DENABLE_TOOL=OFF -DCMAKE_INSTALL_PREFIX=c:\menoh-%MENOH_REV%-msvc .. &&