Skip to content

Add Msys2 building appveor #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

environment:
matrix:
- config: Dev
- config: MSYS2
autocrlf: true
- config: Dev
autocrlf: false
autocrlf: true
- config: RelWithDebInfo
autocrlf: true
- config: Dev
autocrlf: false
- config: RelWithDebInfo
autocrlf: false

Expand All @@ -25,13 +27,26 @@ init:
- git config --global core.autocrlf %autocrlf%
- git config --get core.autocrlf

install:
- cd c:\projects
- git clone https://github.com/osmcode/osm-testdata
- if [%config%]==[MSYS2] (
C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade
&& C:\msys64\usr\bin\pacman -Rc --noconfirm mingw-w64-x86_64-gcc-libs
)

# clone directory
clone_folder: c:\projects\libosmium

platform: x64

build_script:
- build-appveyor.bat
- cd c:\projects\libosmium
- if [%config%]==[MSYS2] (
build-msys2.bat
) else (
build-appveyor.bat
)

# remove garbage VS messages
# http://help.appveyor.com/discussions/problems/4569-the-target-_convertpdbfiles-listed-in-a-beforetargets-attribute-at-c-does-not-exist-in-the-project-and-will-be-ignored
Expand Down
22 changes: 22 additions & 0 deletions build-msys2.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
echo "Adding MSYS2 to path..."
SET "PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%"
echo %PATH%

echo "Installing MSYS2 packages..."
bash -lc "pacman -S --needed --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-geos mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-cppcheck mingw-w64-x86_64-doxygen mingw-w64-x86_64-gdb mingw-w64-x86_64-sparsehash mingw-w64-x86_64-gdal mingw-w64-x86_64-ruby mingw-w64-x86_64-libspatialite mingw-w64-x86_64-spatialite-tools mingw-w64-x86_64-clang-tools-extra"
bash -lc "pacman -S --needed --noconfirm mingw-w64-x86_64-postgresql mingw-w64-x86_64-netcdf mingw-w64-x86_64-crypto++"
call C:\msys64\mingw64\bin\gem.cmd install json

echo "Setting PROJ_LIB variable for correct PROJ.4 working"
set PROJ_LIB=c:\msys64\mingw64\share\proj

echo "Generating makefiles"
mkdir build
cd build
cmake .. -G "MSYS Makefiles" -DBUILD_DATA_TESTS=ON -DBUILD_HEADERS=OFF

echo "Building"
make

echo "Testing"
ctest
4 changes: 3 additions & 1 deletion cmake/FindGem.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Author [email protected]
#
# Version 0.31 2017-09-15
# - find gem executable gem.cmd on Windows
# Version 0.3 2013-07-02
# - rely on `gem content` to find library and header
# - introduce GEM_OS_PKG to allow search via pkgconfig
Expand Down Expand Up @@ -28,7 +30,7 @@
# Check for how 'gem' should be called
include(FindPackageHandleStandardArgs)
find_program(GEM_EXECUTABLE
NAMES "gem${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}"
NAMES "gem.cmd" "gem${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}"
"gem${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}"
"gem-${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}"
"gem-${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}"
Expand Down