Merge pull request #115 from k0ekk0ek/travisci
Windows builds on Travis CI
This commit is contained in:
commit
1c7f903546
6 changed files with 105 additions and 79 deletions
95
.travis.yml
95
.travis.yml
|
@ -11,7 +11,6 @@ linux_gcc8: &linux_gcc8
|
||||||
apt:
|
apt:
|
||||||
update: true
|
update: true
|
||||||
sources: [ ubuntu-toolchain-r-test ]
|
sources: [ ubuntu-toolchain-r-test ]
|
||||||
#packages: [ gcc-8 g++-8 maven cmake ]
|
|
||||||
packages: [ gcc-8 g++-8 ]
|
packages: [ gcc-8 g++-8 ]
|
||||||
|
|
||||||
linux_clang: &linux_clang
|
linux_clang: &linux_clang
|
||||||
|
@ -21,8 +20,6 @@ linux_clang: &linux_clang
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
update: true
|
update: true
|
||||||
#sources: [ ubuntu-toolchain-r-test ]
|
|
||||||
#packages: [ maven clang ]
|
|
||||||
|
|
||||||
osx_xcode10_1: &osx_xcode10_1
|
osx_xcode10_1: &osx_xcode10_1
|
||||||
os: osx
|
os: osx
|
||||||
|
@ -33,6 +30,9 @@ osx_xcode10_1: &osx_xcode10_1
|
||||||
packages:
|
packages:
|
||||||
- pyenv-virtualenv
|
- pyenv-virtualenv
|
||||||
|
|
||||||
|
windows_vs2017: &windows_vs2017
|
||||||
|
os: windows
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- <<: *linux_gcc8
|
- <<: *linux_gcc8
|
||||||
|
@ -42,19 +42,56 @@ matrix:
|
||||||
- <<: *linux_clang
|
- <<: *linux_clang
|
||||||
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=address ]
|
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=address ]
|
||||||
- <<: *linux_clang
|
- <<: *linux_clang
|
||||||
env: [ BUILT_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=none ]
|
env: [ BUILD_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=none ]
|
||||||
- <<: *osx_xcode10_1
|
- <<: *osx_xcode10_1
|
||||||
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=address ]
|
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=address ]
|
||||||
- <<: *osx_xcode10_1
|
- <<: *osx_xcode10_1
|
||||||
env: [ BUILD_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=none ]
|
env: [ BUILD_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=none ]
|
||||||
|
- <<: *windows_vs2017
|
||||||
|
env: [ ARCH=x86, BUILD_TYPE=Debug, GENERATOR="Visual Studio 15 2017" ]
|
||||||
|
- <<: *windows_vs2017
|
||||||
|
env: [ ARCH=x86_64, BUILD_TYPE=Debug, GENERATOR="Visual Studio 15 2017" ]
|
||||||
|
- <<: *windows_vs2017
|
||||||
|
env: [ ARCH=x86_64, BUILD_TYPE=Release, GENERATOR="Visual Studio 15 2017" ]
|
||||||
|
|
||||||
|
# Conan will automatically determine the best compiler for a given platform
|
||||||
|
# based on educated guesses. The first check is based on the CC and CXX
|
||||||
|
# environment variables, the second (on Windows) is to check if Microsoft
|
||||||
|
# Visual Studio is installed. On Travis CC and CXX are set to gcc on Microsoft
|
||||||
|
# Windows targets as well, this has the undesired effect that MSVC is not
|
||||||
|
# detected, unsetting CC and CXX solves that problem.
|
||||||
before_install:
|
before_install:
|
||||||
- eval "export CC=${C_COMPILER}";
|
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
|
||||||
- eval "export CXX=${CXX_COMPILER}";
|
eval "unset CC";
|
||||||
|
eval "unset CXX";
|
||||||
|
else
|
||||||
|
eval "export CC=${C_COMPILER}";
|
||||||
|
eval "export CXX=${CXX_COMPILER}";
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Windows targets in Travis are still very much in beta and Python is not yet
|
||||||
|
# available and installation of Python through Chocolaty does not work well.
|
||||||
|
# The real fix is to wait until Python and pip are both available on the
|
||||||
|
# target. Until then download Conan from the official website and simply add
|
||||||
|
# the extracted folder to the path.
|
||||||
|
#
|
||||||
|
# Maven requires JAVA_HOME to be set (at least on Windows), but Windows targets
|
||||||
|
# do not come with Java installed. For now it is installed through Chocolatey
|
||||||
|
# as a dependency of Maven, hence JAVA_HOME is only available after the
|
||||||
|
# package is installed. The problem is that the shell cannot be restarted and
|
||||||
|
# the path is not fixed as it contains the version number. To workaround this
|
||||||
|
# issue, JAVA_HOME is read from the registry and exported by this script.
|
||||||
install:
|
install:
|
||||||
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
|
||||||
|
choco install innoextract maven;
|
||||||
|
wget -q https://dl.bintray.com/conan/installers/conan-win-64_1_10_0.exe;
|
||||||
|
innoextract conan-win-64_1_10_0.exe;
|
||||||
|
KEY='HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
|
||||||
|
VALUE='JAVA_HOME';
|
||||||
|
JAVA_HOME=$(REG QUERY "${KEY}" -v "${VALUE}" | sed -n 's/^.*JAVA_HOME \+[_A-Z]\+ \+//ip');
|
||||||
|
eval "export JAVA_HOME=\"${JAVA_HOME}\"";
|
||||||
|
eval "export PATH=\"$(pwd)/app/conan:${PATH}\"";
|
||||||
|
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||||
eval "$(pyenv init -)";
|
eval "$(pyenv init -)";
|
||||||
pyenv virtualenv conan;
|
pyenv virtualenv conan;
|
||||||
pyenv rehash;
|
pyenv rehash;
|
||||||
|
@ -63,21 +100,43 @@ install:
|
||||||
else
|
else
|
||||||
pip install conan --upgrade --user;
|
pip install conan --upgrade --user;
|
||||||
fi
|
fi
|
||||||
- conan user
|
- conan profile new default --detect
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
|
- conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
|
||||||
|
- conan profile get settings.arch default
|
||||||
|
- if [ -z "${ARCH}" ]; then
|
||||||
|
eval "export ARCH=\"$(conan profile get settings.arch default)\"";
|
||||||
|
fi
|
||||||
|
- if [ "${TRAVIS_OS_NAME}" = "windows" ]; then
|
||||||
|
GENERATOR_ARCH=$(if [ "${ARCH}" = "x86_64" ]; then echo " Win64"; fi);
|
||||||
|
eval "export GENERATOR=\"${GENERATOR}${GENERATOR_ARCH}\"";
|
||||||
|
eval "export USE_SANITIZER=none";
|
||||||
|
else
|
||||||
|
eval "export GENERATOR=\"Unix Makefiles\"";
|
||||||
|
fi
|
||||||
|
- export
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- conan install .. --build missing
|
- conan install -b missing -s arch=${ARCH} -s build_type=${BUILD_TYPE} ..
|
||||||
- cmake -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DUSE_SANITIZER=${USE_SANITIZER} -DCMAKE_INSTALL_PREFIX=${PWD}/install ../src
|
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||||
- cmake --build . --target install
|
-DCMAKE_INSTALL_PREFIX=$(pwd)/install
|
||||||
- mkdir install/share/CycloneDDS/examples/helloworld/build
|
-DUSE_SANITIZER=${USE_SANITIZER}
|
||||||
- if [ "$USE_SANITIZER" = "none" ]; then
|
-DBUILD_TESTING=on
|
||||||
(cd install/share/CycloneDDS/examples/helloworld/build && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. && cmake --build .) ;
|
-G "${GENERATOR}" ../src
|
||||||
else
|
- cmake --build . --config ${BUILD_TYPE} --target install
|
||||||
(cd install/share/CycloneDDS/examples/helloworld/build && cmake -DCMAKE_C_FLAGS=-fsanitize=address -DCMAKE_LINKER_FLAGS=-fsanitize=address -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. && cmake --build .) ;
|
- ctest -T test -C ${BUILD_TYPE}
|
||||||
|
- if [ "${USE_SANITIZER}" != "none" ]; then
|
||||||
|
CMAKE_LINKER_FLAGS="-DCMAKE_LINKER_FLAGS=-fsanitize=${USE_SANITIZER}";
|
||||||
|
CMAKE_C_FLAGS="-DCMAKE_C_FLAGS=-fsanitize=${USE_SANITIZER}";
|
||||||
fi
|
fi
|
||||||
- ctest -T test
|
- mkdir install/share/CycloneDDS/examples/helloworld/build
|
||||||
|
- cd install/share/CycloneDDS/examples/helloworld/build
|
||||||
|
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||||
|
${CMAKE_C_FLAGS}
|
||||||
|
${CMAKE_LINKER_FLAGS}
|
||||||
|
-G "${GENERATOR}" ..
|
||||||
|
- cmake --build . --config ${BUILD_TYPE}
|
||||||
|
|
||||||
|
|
|
@ -17,21 +17,19 @@ if(DEFINED ENV{M2_HOME})
|
||||||
list(APPEND _mvn_hints "$ENV{M2_HOME}/bin")
|
list(APPEND _mvn_hints "$ENV{M2_HOME}/bin")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Chocolatey installs packages under C:\ProgramData\chocolatey.
|
||||||
|
if(ENV{ProgramData} AND IS_DIRECTORY "$ENV{ProgramData}/chocolatey/bin")
|
||||||
|
list(APPEND _mvn_paths "$ENV{ProgramData}/chocolatey/bin")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Maven documentation mentions intalling maven under C:\Program Files on
|
# Maven documentation mentions intalling maven under C:\Program Files on
|
||||||
# Windows and under /opt on *NIX platforms
|
# Windows and under /opt on *NIX platforms.
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(_program_files_env "ProgramFiles")
|
foreach(_env "ProgramFiles" "ProgramFiles(x86)")
|
||||||
set(_program_files $ENV{${_program_files_env}})
|
if(ENV{${_env}} AND IS_DIRECTORY "$ENV{${_env}}")
|
||||||
set(_program_files_x86_env "ProgramFiles(x86)")
|
list(APPEND _dirs "$ENV{${_env}}")
|
||||||
set(_program_files_x86 $ENV{${_program_files_x86_env}})
|
endif()
|
||||||
|
endforeach()
|
||||||
if(_program_files)
|
|
||||||
list(APPEND _dirs "${_program_files}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(_program_files_x86)
|
|
||||||
list(APPEND _dirs "${_program_files_x86}")
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
list(APPEND _dirs "/opt")
|
list(APPEND _dirs "/opt")
|
||||||
endif()
|
endif()
|
||||||
|
@ -45,14 +43,20 @@ foreach(_dir ${_dirs})
|
||||||
endforeach()
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(_mvn_names "mvn.cmd" "mvn.exe")
|
||||||
|
else()
|
||||||
|
set(_mvn_names "mvn")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_program(Maven_EXECUTABLE
|
find_program(Maven_EXECUTABLE
|
||||||
NAMES mvn
|
NAMES ${_mvn_names}
|
||||||
HINTS ${_mvn_hints}
|
HINTS ${_mvn_hints}
|
||||||
PATHS ${_mvn_paths})
|
PATHS ${_mvn_paths})
|
||||||
|
|
||||||
if(Maven_EXECUTABLE)
|
if(Maven_EXECUTABLE)
|
||||||
execute_process(COMMAND ${Maven_EXECUTABLE} -version
|
execute_process(COMMAND ${Maven_EXECUTABLE} -version
|
||||||
RESULT_VARIABLE result
|
RESULT_VARIABLE res
|
||||||
OUTPUT_VARIABLE var
|
OUTPUT_VARIABLE var
|
||||||
ERROR_VARIABLE var
|
ERROR_VARIABLE var
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
@ -67,8 +71,8 @@ endif()
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(Maven
|
find_package_handle_standard_args(Maven
|
||||||
FOUND_VAR Maven_FOUND
|
FOUND_VAR Maven_FOUND
|
||||||
REQUIRED_VARS Maven_EXECUTABLE
|
VERSION_VAR Maven_VERSION
|
||||||
VERSION_VAR Maven_VERSION)
|
REQUIRED_VARS Maven_EXECUTABLE Maven_VERSION)
|
||||||
|
|
||||||
mark_as_advanced(Maven_FOUND Maven_EXECUTABLE Maven_VERSION)
|
mark_as_advanced(Maven_FOUND Maven_EXECUTABLE Maven_VERSION)
|
||||||
|
|
||||||
|
|
|
@ -9,14 +9,16 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
find_package(Java 1.8 REQUIRED)
|
||||||
|
|
||||||
if(NOT IDLC_JAR)
|
if(NOT IDLC_JAR)
|
||||||
set(IDLC_JAR "${CMAKE_CURRENT_LIST_DIR}/idlc-jar-with-dependencies.jar")
|
set(IDLC_JAR "${CMAKE_CURRENT_LIST_DIR}/idlc-jar-with-dependencies.jar")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(LINE_ENDINGS "UNIX")
|
set(LINE_ENDINGS "UNIX")
|
||||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
|
if(WIN32)
|
||||||
set(EXTENSION ".bat")
|
set(EXTENSION ".bat")
|
||||||
set(LINE_ENDINGS "WIN32")
|
set(LINE_ENDINGS "WIN32")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(IDLC_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE STRING "")
|
set(IDLC_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE STRING "")
|
||||||
|
@ -30,13 +32,6 @@ configure_file(
|
||||||
@ONLY
|
@ONLY
|
||||||
NEWLINE_STYLE ${LINE_ENDINGS})
|
NEWLINE_STYLE ${LINE_ENDINGS})
|
||||||
|
|
||||||
# FIXME: C++ IDL compiler depends idlpp. Leave it disabled for now.
|
|
||||||
#configure_file(
|
|
||||||
# "cmake/dds_idlcpp${EXTENSION}.in"
|
|
||||||
# "dds_idlcpp${EXTENSION}"
|
|
||||||
# @ONLY
|
|
||||||
# NEWLINE_STYLE ${LINE_ENDINGS})
|
|
||||||
|
|
||||||
if(NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows"))
|
if(NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows"))
|
||||||
execute_process(COMMAND chmod +x "${IDLC_DIR}/${IDLC}")
|
execute_process(COMMAND chmod +x "${IDLC_DIR}/${IDLC}")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -15,5 +15,5 @@ if "%CLASSPATH%"=="" (
|
||||||
set "CLASSPATH=@IDLC_JAR@;%CLASSPATH%"
|
set "CLASSPATH=@IDLC_JAR@;%CLASSPATH%"
|
||||||
)
|
)
|
||||||
|
|
||||||
java org.eclipse.cyclonedds.compilers.Idlc %*
|
"@Java_JAVA_EXECUTABLE@" org.eclipse.cyclonedds.compilers.Idlc %*
|
||||||
|
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
@echo off
|
|
||||||
REM Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
|
|
||||||
REM
|
|
||||||
REM This program and the accompanying materials are made available under the
|
|
||||||
REM terms of the Eclipse Public License v. 2.0 which is available at
|
|
||||||
REM http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
|
||||||
REM v. 1.0 which is available at
|
|
||||||
REM http://www.eclipse.org/org/documents/edl-v10.php.
|
|
||||||
REM
|
|
||||||
REM SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
|
||||||
|
|
||||||
if "%CLASSPATH%"=="" (
|
|
||||||
set "CLASSPATH=@IDLC_JAR@"
|
|
||||||
) else (
|
|
||||||
set "CLASSPATH=@IDLC_JAR@;%CLASSPATH%"
|
|
||||||
)
|
|
||||||
|
|
||||||
java org.eclipse.cyclonedds.compilers.Idlcpp %*
|
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
|
|
||||||
#
|
|
||||||
# This program and the accompanying materials are made available under the
|
|
||||||
# terms of the Eclipse Public License v. 2.0 which is available at
|
|
||||||
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
|
||||||
# v. 1.0 which is available at
|
|
||||||
# http://www.eclipse.org/org/documents/edl-v10.php.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
|
||||||
#
|
|
||||||
java -classpath "@IDLC_JAR@" org.eclipse.cyclonedds.compilers.Idlcpp "$@"
|
|
Loading…
Add table
Add a link
Reference in a new issue