summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authormayeut <mayeut@users.noreply.github.com>2015-09-12 15:48:23 +0200
committermayeut <mayeut@users.noreply.github.com>2015-09-12 15:48:23 +0200
commit52c36b495597b8d07d39d070dd521ca4118113bd (patch)
treebb0a86f7047430792333ace87dd0b6774a82095a /tools
parentb7069ce2b2ade8a1af44dade35db81d7a08cf0fc (diff)
Add 32 bit build
Diffstat (limited to 'tools')
-rw-r--r--tools/ctest_scripts/travis-ci.cmake14
-rwxr-xr-xtools/travis-ci/install.sh7
-rwxr-xr-xtools/travis-ci/run.sh20
3 files changed, 31 insertions, 10 deletions
diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake
index 826b0aa3..7c1c25ff 100644
--- a/tools/ctest_scripts/travis-ci.cmake
+++ b/tools/ctest_scripts/travis-ci.cmake
@@ -28,6 +28,18 @@ else()
set( CTEST_BUILD_NAME "$ENV{OPJ_BUILDNAME}")
endif()
+if (NOT "$ENV{OPJ_CI_ARCH}" STREQUAL "")
+ if (APPLE)
+ set(CCFLAGS_ARCH "-arch $ENV{OPJ_CI_ARCH}")
+ else()
+ if ("$ENV{OPJ_CI_ARCH}" MATCHES "^i[3-6]86$")
+ set(CCFLAGS_ARCH "-m32 -march=$ENV{OPJ_CI_ARCH}")
+ elseif ("$ENV{OPJ_CI_ARCH}" STREQUAL "x86_64")
+ set(CCFLAGS_ARCH "-m64")
+ endif()
+ endif()
+endif()
+
# To execute part of the encoding test suite, kakadu binaries are needed to decode encoded image and compare
# it to the baseline. Kakadu binaries are freely available for non-commercial purposes
# at http://www.kakadusoftware.com.
@@ -49,7 +61,7 @@ set( CACHE_CONTENTS "
CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}
# Warning level
-CMAKE_C_FLAGS:STRING= -Wall -Wextra -Wconversion -Wno-unused-parameter -Wdeclaration-after-statement
+CMAKE_C_FLAGS:STRING= ${CCFLAGS_ARCH} -Wall -Wextra -Wconversion -Wno-unused-parameter -Wdeclaration-after-statement
# Use to activate the test suite
BUILD_TESTING:BOOL=TRUE
diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh
index 202be751..ceb77b8a 100755
--- a/tools/travis-ci/install.sh
+++ b/tools/travis-ci/install.sh
@@ -17,14 +17,11 @@ function exit_handler ()
exit "${exit_code}"
}
trap exit_handler EXIT
-trap exit ERR
-
-# travis-ci doesn't dump cmake version in system info, let's print it
-cmake --version
+trap exit ERR
# We don't need anything for coverity scan builds
-if [ "${COVERITY_SCAN_BRANCH:-}" != 1 ]; then
+if [ "${COVERITY_SCAN_BRANCH:-}" != "1" ] && [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then
OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd)
diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh
index 75c01dc9..7fdaec72 100755
--- a/tools/travis-ci/run.sh
+++ b/tools/travis-ci/run.sh
@@ -55,10 +55,19 @@ elif [ "${TRAVIS_OS_NAME}" == "linux" ]; then
elif [ "${CC}" == "clang" ]; then
OPJ_CC_VERSION=clang$(${CC} --version | grep version | sed 's/.*version \([^0-9.]*[0-9.]*\).*/\1/')
else
- echo "Compiler not supported: ${CC}"
+ echo "Compiler not supported: ${CC}"; exit 1
fi
else
- echo "OS not supported: ${TRAVIS_OS_NAME}"
+ echo "OS not supported: ${TRAVIS_OS_NAME}"; exit 1
+fi
+
+if [ "${OPJ_CI_ARCH:-}" == "" ]; then
+ echo "Guessing build architecture"
+ MACHINE_ARCH=$(uname -m)
+ if [ "${MACHINE_ARCH}" == "x86_64" ]; then
+ export OPJ_CI_ARCH=x86_64
+ fi
+ echo "${OPJ_CI_ARCH}"
fi
if [ "${TRAVIS_BRANCH:-}" == "" ]; then
@@ -66,13 +75,13 @@ if [ "${TRAVIS_BRANCH:-}" == "" ]; then
TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to master
fi
-OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-x86_64-${TRAVIS_BRANCH}
+OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-${OPJ_CI_ARCH}-${TRAVIS_BRANCH}
if [ "${TRAVIS_PULL_REQUEST:-}" != "false" ] && [ "${TRAVIS_PULL_REQUEST:-}" != "" ]; then
OPJ_BUILDNAME=${OPJ_BUILDNAME}-pr${TRAVIS_PULL_REQUEST}
fi
OPJ_BUILDNAME=${OPJ_BUILDNAME}-${OPJ_BUILD_CONFIGURATION}-3rdP
-if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ -d kdu ]; then
+if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ] && [ -d kdu ]; then
echo "
Testing will use Kakadu trial binaries. Here's the copyright notice from kakadu:
Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney.
@@ -84,6 +93,9 @@ fi
set -x
# This will print configuration
+# travis-ci doesn't dump cmake version in system info, let's print it
+cmake --version
+
export OPJ_SITE=${OPJ_SITE}
export OPJ_BUILDNAME=${OPJ_BUILDNAME}
export OPJ_SOURCE_DIR=${OPJ_SOURCE_DIR}