diff --git a/.travis.yml b/.travis.yml index ebcbd7a3..8e29a64a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: c os: - linux -# - osx + - osx compiler: -# - gcc -# - clang + - gcc + - clang - x86_64-w64-mingw32-gcc env: - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release @@ -19,6 +19,9 @@ matrix: compiler: x86_64-w64-mingw32-gcc - compiler: clang env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release + - os: linux + compiler: clang + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release - compiler: gcc env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 - compiler: x86_64-w64-mingw32-gcc diff --git a/tools/ctest_scripts/toolchain-mingw32.cmake b/tools/ctest_scripts/toolchain-mingw32.cmake new file mode 100644 index 00000000..1728f9ea --- /dev/null +++ b/tools/ctest_scripts/toolchain-mingw32.cmake @@ -0,0 +1,26 @@ +# http://www.cmake.org/Wiki/CmakeMingw +# +# Copyright (c) 2006-2014 Mathieu Malaterre +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +# the name of the target operating system +set(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) + +# here is the target environment located +set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32) + +# adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index 371235a4..fafc54ee 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -48,7 +48,11 @@ endif() if("$ENV{CC}" MATCHES ".*mingw.*") # We are trying to use mingw - set(CTEST_CONFIGURE_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${CTEST_SCRIPT_DIRECTORY}/toolchain-mingw64.cmake") + if ("$ENV{OPJ_CI_ARCH}" MATCHES "^i[3-6]86$") + set(CTEST_CONFIGURE_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${CTEST_SCRIPT_DIRECTORY}/toolchain-mingw32.cmake") + else() + set(CTEST_CONFIGURE_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${CTEST_SCRIPT_DIRECTORY}/toolchain-mingw64.cmake") + endif() endif() if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1") @@ -126,4 +130,4 @@ endif() if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1") ctest_submit() endif() -#ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" ) +ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" )