Skip to content

Commit

Permalink
AppVeyor: Build for MinGW 32/64.
Browse files Browse the repository at this point in the history
  • Loading branch information
meshell committed Jan 11, 2017
1 parent 3db24d4 commit 96c2659
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 31 deletions.
38 changes: 32 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,37 @@ os: Visual Studio 2015

environment:
RUBY_VERSION: 200
BOOST_ROOT: C:\Libraries\boost_1_59_0
BOOST_INCLUDEDIR: C:\Libraries\boost_1_59_0\boost
matrix:
- platform: x86
- build: mingw
platform: x86
MINGW_ARCH: i686
MSYSTEM: MINGW32
MINGW_ROOT: C:\msys64\mingw32
BOOST_ROOT: C:\msys64\mingw32
BOOST_LIBRARYDIR: C:\msys64\mingw32\lib
BOOST_INCLUDEDIR: C:\msys64\mingw32\include\boost
CMAKE_GENERATOR: 'MSYS Makefiles'
- build: mingw
platform: x64
MINGW_ARCH: x86_64
MSYSTEM: MINGW64
MINGW_ROOT: C:\msys64\mingw64
BOOST_ROOT: C:\msys64\mingw64
BOOST_LIBRARYDIR: C:\msys64\mingw64\lib
BOOST_INCLUDEDIR: C:\msys64\mingw64\include\boost
CMAKE_GENERATOR: 'MSYS Makefiles'
- build: msvc
platform: x86
BOOST_ROOT: C:\Libraries\boost_1_59_0
BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib32-msvc-14.0
- platform: x64
BOOST_INCLUDEDIR: C:\Libraries\boost_1_59_0\boost
CMAKE_GENERATOR: 'NMake Makefiles'
- build: msvc
platform: x64
BOOST_ROOT: C:\Libraries\boost_1_59_0
BOOST_INCLUDEDIR: C:\Libraries\boost_1_59_0\boost
BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib64-msvc-14.0
CMAKE_GENERATOR: 'NMake Makefiles'

install:
- git submodule init
Expand All @@ -18,11 +42,13 @@ install:
- gem install bundle
- bundle install
- bundle env
- if "%build%"=="mingw" set PATH=%MINGW_ROOT%\bin;C:\msys64\usr\bin\;%PATH%
- if "%build%"=="mingw" bash -lc "pacman --needed --noconfirm -S mingw-w64-%MINGW_ARCH%-boost

build_script:
- cmd: call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%
- cmd: if "%build%"=="msvc" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%
- cmd: cmake -E make_directory build
- cmd: cmake -E chdir build cmake -G "NMake Makefiles" -DCUKE_ENABLE_EXAMPLES=on -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_INCLUDEDIR="%BOOST_INCLUDEDIR%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" ..
- cmd: cmake -E chdir build cmake -G "%CMAKE_GENERATOR%" -DCUKE_ENABLE_EXAMPLES=ON -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_INCLUDEDIR="%BOOST_INCLUDEDIR%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" ..
- cmd: cmake --build build

test_script:
Expand Down
48 changes: 25 additions & 23 deletions cmake/modules/FindGMock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,6 @@ if(NOT (${GMOCK_LIBRARY_EXISTS} AND ${GTEST_LIBRARY_EXISTS}))

include(ExternalProject)

if(MSVC)
set(Suffix ".lib")
else()
set(Suffix ".a")
endif()

if(GTEST_USE_STATIC_LIBS)
set(GTEST_CMAKE_ARGS -Dgtest_force_shared_crt:BOOL=ON -DBUILD_SHARED_LIBS=OFF)
set(GTEST_LIBRARY_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
Expand All @@ -284,7 +278,9 @@ if(NOT (${GMOCK_LIBRARY_EXISTS} AND ${GTEST_LIBRARY_EXISTS}))
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
CMAKE_ARGS ${GTEST_CMAKE_ARGS}
CMAKE_ARGS
-Dgtest_disable_pthreads=${MINGW}
${GTEST_CMAKE_ARGS}
)
externalproject_add(
gmock
Expand All @@ -295,7 +291,9 @@ if(NOT (${GMOCK_LIBRARY_EXISTS} AND ${GTEST_LIBRARY_EXISTS}))
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
CMAKE_ARGS ${GTEST_CMAKE_ARGS}
CMAKE_ARGS
-Dgtest_disable_pthreads=${MINGW}
${GTEST_CMAKE_ARGS}
DEPENDS gtest
)

Expand All @@ -308,16 +306,16 @@ if(NOT (${GMOCK_LIBRARY_EXISTS} AND ${GTEST_LIBRARY_EXISTS}))
externalproject_get_property(gtest source_dir binary_dir)
set(GTEST_INCLUDE_DIR "${source_dir}/include")
mark_as_advanced(GTEST_INCLUDE_DIR)
set(GTEST_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest${Suffix}")
set(GTEST_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
mark_as_advanced(GTEST_LIBRARY)
set(GTEST_MAIN_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest_main${Suffix}")
set(GTEST_MAIN_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
mark_as_advanced(GTEST_MAIN_LIBRARY)
externalproject_get_property(gmock source_dir binary_dir)
set(GMOCK_INCLUDE_DIR "${source_dir}/include")
mark_as_advanced(GMOCK_INCLUDE_DIR)
set(GMOCK_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock${Suffix}")
set(GMOCK_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}")
mark_as_advanced(GMOCK_LIBRARY)
set(GMOCK_MAIN_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock_main${Suffix}")
set(GMOCK_MAIN_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
mark_as_advanced(GMOCK_MAIN_LIBRARY)
else() #1.8.0
externalproject_add(
Expand All @@ -329,7 +327,9 @@ if(NOT (${GMOCK_LIBRARY_EXISTS} AND ${GTEST_LIBRARY_EXISTS}))
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
CMAKE_ARGS ${GTEST_CMAKE_ARGS}
CMAKE_ARGS
-Dgtest_disable_pthreads=${MINGW}
${GTEST_CMAKE_ARGS}
)

add_dependencies(GTest::GTest gmock)
Expand All @@ -339,11 +339,11 @@ if(NOT (${GMOCK_LIBRARY_EXISTS} AND ${GTEST_LIBRARY_EXISTS}))

externalproject_get_property(gmock source_dir binary_dir)
set(GTEST_INCLUDE_DIR "${source_dir}/googletest/include")
set(GTEST_LIBRARY "${binary_dir}/googlemock/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest${Suffix}")
set(GTEST_MAIN_LIBRARY "${binary_dir}/googlemock/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest_main${Suffix}")
set(GTEST_LIBRARY "${binary_dir}/googlemock/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(GTEST_MAIN_LIBRARY "${binary_dir}/googlemock/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(GMOCK_INCLUDE_DIR "${source_dir}/googlemock/include")
set(GMOCK_LIBRARY "${binary_dir}/googlemock/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock${Suffix}")
set(GMOCK_MAIN_LIBRARY "${binary_dir}/googlemock/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock_main${Suffix}")
set(GMOCK_LIBRARY "${binary_dir}/googlemock/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(GMOCK_MAIN_LIBRARY "${binary_dir}/googlemock/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
mark_as_advanced(GMOCK_LIBRARY)
mark_as_advanced(GMOCK_INCLUDE_DIR)
mark_as_advanced(GTEST_MAIN_LIBRARY)
Expand All @@ -358,10 +358,12 @@ if(NOT (${GMOCK_LIBRARY_EXISTS} AND ${GTEST_LIBRARY_EXISTS}))
SOURCE_DIR ${GMOCK_SRC_DIR}
PREFIX ${GMOCK_ROOT}
INSTALL_COMMAND ""
LOG_DOWNLOAD OFF
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
CMAKE_ARGS ${GTEST_CMAKE_ARGS}
CMAKE_ARGS
-Dgtest_disable_pthreads=${MINGW}
${GTEST_CMAKE_ARGS}
)

add_dependencies(GTest::GTest gmock)
Expand All @@ -372,15 +374,15 @@ if(NOT (${GMOCK_LIBRARY_EXISTS} AND ${GTEST_LIBRARY_EXISTS}))
externalproject_get_property(gmock source_dir binary_dir)
set(GTEST_INCLUDE_DIR "${source_dir}/gtest/include")
mark_as_advanced(GTEST_INCLUDE_DIR)
set(GTEST_LIBRARY "${binary_dir}/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest${Suffix}")
set(GTEST_LIBRARY "${binary_dir}/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
mark_as_advanced(GTEST_LIBRARY)
set(GTEST_MAIN_LIBRARY "${binary_dir}/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest_main${Suffix}")
set(GTEST_MAIN_LIBRARY "${binary_dir}/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
mark_as_advanced(GTEST_MAIN_LIBRARY)
set(GMOCK_INCLUDE_DIR "${source_dir}/include")
mark_as_advanced(GMOCK_INCLUDE_DIR)
set(GMOCK_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock${Suffix}")
set(GMOCK_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}")
mark_as_advanced(GMOCK_LIBRARY)
set(GMOCK_MAIN_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock_main${Suffix}")
set(GMOCK_MAIN_LIBRARY "${binary_dir}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
mark_as_advanced(GMOCK_MAIN_LIBRARY)
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion examples/Calc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ endif()
if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(BoostCalculatorSteps features/step_definitions/BoostCalculatorSteps)
target_link_libraries(BoostCalculatorSteps Calc ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${CUKE_LIBRARIES})
target_link_libraries(BoostCalculatorSteps Calc ${CUKE_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
endif()
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if(GMOCK_FOUND)
cuke_add_test(integration/HookRegistrationTest)
cuke_add_test(integration/StepRegistrationTest)
cuke_add_test(integration/TaggedHookRegistrationTest)
if(NOT MSVC)
if(NOT WIN32)
cuke_add_test(integration/WireServerTest)
endif()
cuke_add_test(integration/WireProtocolTest)
Expand Down

0 comments on commit 96c2659

Please sign in to comment.