CI: Use make install to collect release files

This commit is contained in:
Stefan Profanter 2018-12-14 15:25:39 +01:00
parent d715db1057
commit e8499689e2
No known key found for this signature in database
GPG Key ID: 52787A8E77301854
8 changed files with 113 additions and 117 deletions

View File

@ -781,9 +781,9 @@ ua_generate_nodeset(
DEPENDS_TARGET "open62541-generator-types"
)
# stack protector needs to be disabled for the huge ns0 file, otherwise it may take many minutes to compile the file.
# stack protector and optimization needs to be disabled for the huge ns0 file, otherwise it may take many minutes to compile the file.
if(NOT MSVC)
set_source_files_properties(${PROJECT_BINARY_DIR}/src_generated/ua_namespace0.c PROPERTIES COMPILE_FLAGS -fno-stack-protector)
set_source_files_properties(${PROJECT_BINARY_DIR}/src_generated/ua_namespace0.c PROPERTIES COMPILE_FLAGS "-fno-stack-protector -O0")
endif()
#####################

View File

@ -7,8 +7,8 @@ clone_depth: 20
skip_branch_with_pr: true
# Fast finish (stop other builds if one fails) to speed up appveyor builds
matrix:
fast_finish: true
# matrix:
# fast_finish: true
environment:
global:
@ -18,43 +18,24 @@ environment:
- CC_NAME: MinGW Makefiles
CC_SHORTNAME: mingw
GENERATOR: MinGW Makefiles
# We need to redirect stderr to stdout otherwise powershell will fail if there is an output during amalgamation.
# Only use one thread, otherwise appveyor runs out of memory
MAKE: mingw32-make -j1 2>&1
FORCE_CXX: OFF
OUT_DIR_LIB: bin
OUT_DIR_EXAMPLES: bin\examples
- CC_NAME: Visual Studio 9 2008
CC_SHORTNAME: vs2008
GENERATOR: Visual Studio 9 2008
MAKE: msbuild /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
FORCE_CXX: ON
OUT_DIR_LIB: bin\Debug
OUT_DIR_EXAMPLES: bin\examples\Debug
- CC_NAME: Visual Studio 12 2013
CC_SHORTNAME: vs2013
GENERATOR: Visual Studio 12 2013
MAKE: msbuild /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
FORCE_CXX: OFF
OUT_DIR_LIB: bin\Debug
OUT_DIR_EXAMPLES: bin\examples\Debug
- CC_NAME: Visual Studio 15 2017
CC_SHORTNAME: vs2017
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
GENERATOR: Visual Studio 15 2017
MAKE: msbuild /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
FORCE_CXX: OFF
OUT_DIR_LIB: bin\Debug
OUT_DIR_EXAMPLES: bin\examples\Debug
- CC_NAME: Clang
CC_SHORTNAME: clang-mingw
GENERATOR: MinGW Makefiles
# We need to redirect stderr to stdout otherwise powershell will fail if there is an output during amalgamation.
# Only use one thread, otherwise appveyor runs out of memory
MAKE: mingw32-make -j1 2>&1
FORCE_CXX: OFF
OUT_DIR_LIB: bin
OUT_DIR_EXAMPLES: bin\examples
cache:
- C:\ProgramData\chocolatey\bin -> tools/appveyor/install.ps1
@ -79,5 +60,6 @@ build_script:
- ps: '& "./tools/appveyor/build.ps1"'
after_build:
# Only push artifact if make install is defined
- appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-static.zip
- appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-dynamic.zip

View File

@ -14,6 +14,10 @@ set(examples_headers
#############################
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/examples)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/examples)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/examples)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/bin/examples)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/bin/examples)
macro(add_example EXAMPLE_NAME EXAMPLE_SOURCE)
add_executable(${EXAMPLE_NAME} ${STATIC_OBJECTS} ${EXAMPLE_SOURCE} ${ARGN} ${examples_headers})
@ -65,12 +69,32 @@ endif()
add_example(server_ctt server_ctt.c)
if (WIN32)
install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/server_ctt.exe
DESTINATION bin
RENAME ua_server_ctt.exe)
else()
install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/server_ctt
DESTINATION bin
RENAME ua_server_ctt)
endif()
##################
# Example Client #
##################
add_example(client client.c)
if (WIN32)
install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/client.exe
DESTINATION bin
RENAME ua_client.exe)
else()
install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/client
DESTINATION bin
RENAME ua_client)
endif()
add_example(client_async client_async.c)
add_example(client_connect_loop client_connect_loop.c)

View File

@ -5,6 +5,7 @@
#include <ua_server.h>
#include <ua_config_default.h>
#include <ua_log_stdout.h>
#include <ua_network_pubsub_udp.h>
#include <signal.h>

View File

@ -27,6 +27,7 @@
#include <ua_server.h>
#include <ua_config_default.h>
#include <ua_log_stdout.h>
#include <ua_network_pubsub_udp.h>
#include <signal.h>

View File

@ -28,8 +28,6 @@ try {
New-Item -Force -ItemType directory -Path "C:\Tools\vcpkg\installed\x86-windows-static"
}
$make_cmd = "& $env:MAKE"
# Collect files for .zip packing
New-Item -ItemType directory -Path pack
Copy-Item LICENSE pack
@ -37,12 +35,13 @@ try {
Copy-Item README.md pack
Write-Host -ForegroundColor Green "`n###################################################################"
Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME #####`n"
Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with amalgamation #####`n"
New-Item -ItemType directory -Path "build"
cd build
& cmake $vcpkg_toolchain $vcpkg_triplet -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX `
-DUA_ENABLE_ENCRYPTION:BOOL=$build_encryption -G"$env:GENERATOR" ..
Invoke-Expression $make_cmd
& cmake $vcpkg_toolchain $vcpkg_triplet -DUA_BUILD_EXAMPLES:BOOL=OFF -DUA_ENABLE_AMALGAMATION:BOOL=ON `
-DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX `
-DUA_ENABLE_ENCRYPTION:BOOL=$build_encryption -DCMAKE_BUILD_TYPE=RelWithDebInfo -G"$env:GENERATOR" ..
& cmake --build . --config RelWithDebInfo
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
exit $LASTEXITCODE
@ -54,8 +53,10 @@ try {
Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with full NS0 #####`n"
New-Item -ItemType directory -Path "build"
cd build
& cmake -DUA_ENABLE_SUBSCRIPTIONS_EVENTS:BOOL=ON -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_NAMESPACE_ZERO:STRING=FULL -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -G"$env:GENERATOR" ..
Invoke-Expression $make_cmd
& cmake -DUA_ENABLE_SUBSCRIPTIONS_EVENTS:BOOL=ON -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_NAMESPACE_ZERO:STRING=FULL `
-DUA_ENABLE_PUBSUB:BOOL=ON -DUA_ENABLE_PUBSUB_INFORMATIONMODEL:BOOL=ON -DUA_ENABLE_PUBSUB_DELTAFRAMES:BOOL=ON `
-DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -DCMAKE_BUILD_TYPE=RelWithDebInfo -G"$env:GENERATOR" ..
& cmake --build . --config RelWithDebInfo
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
exit $LASTEXITCODE
@ -64,71 +65,49 @@ try {
Remove-Item -Path build -Recurse -Force
Write-Host -ForegroundColor Green "`n###################################################################"
Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with PubSub #####`n"
Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME without amalgamation #####`n"
New-Item -ItemType directory -Path "build"
cd build
& cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_PUBSUB:BOOL=ON -DUA_ENABLE_PUBSUB_INFORMATIONMODEL:BOOL=ON `
-DUA_ENABLE_PUBSUB_DELTAFRAMES:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -G"$env:GENERATOR" ..
Invoke-Expression $make_cmd
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
& cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=OFF `
-DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-G"$env:GENERATOR" `
-DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER-$env:CC_SHORTNAME-static" ..
& cmake --build . --target install --config RelWithDebInfo
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0)
{
Write-Host -ForegroundColor Red "`n`n*** Make install failed. Exiting ... ***"
exit $LASTEXITCODE
}
cd ..
& 7z a -tzip open62541-$env:CC_SHORTNAME-static.zip "$env:APPVEYOR_BUILD_FOLDER\pack\*" "$env:APPVEYOR_BUILD_FOLDER-$env:CC_SHORTNAME-static\*"
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0)
{
Write-Host -ForegroundColor Red "`n`n*** Zipping failed. Exiting ... ***"
exit $LASTEXITCODE
}
Remove-Item -Path build -Recurse -Force
Write-Host -ForegroundColor Green "`n###################################################################"
Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with amalgamation #####`n"
Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME (.dll) #####`n"
New-Item -ItemType directory -Path "build"
cd build
& cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON `
-DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -DBUILD_SHARED_LIBS:BOOL=OFF -G"$env:GENERATOR" ..
Invoke-Expression $make_cmd
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
& cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=OFF `
-DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-G"$env:GENERATOR" `
-DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER-$env:CC_SHORTNAME-dynamic" ..
& cmake --build . --target install --config RelWithDebInfo
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0)
{
Write-Host -ForegroundColor Red "`n`n*** Make install failed. Exiting ... ***"
exit $LASTEXITCODE
}
cd ..
New-Item -ItemType directory -Path pack_tmp
Move-Item -Path "build\open62541.c" -Destination pack_tmp\
Move-Item -Path "build\open62541.h" -Destination pack_tmp\
Move-Item -Path "build\$env:OUT_DIR_EXAMPLES\server_ctt.exe" -Destination pack_tmp\
Move-Item -Path "build\$env:OUT_DIR_EXAMPLES\client.exe" -Destination pack_tmp\
if ($env:CC_SHORTNAME -eq "mingw" -or $env:CC_SHORTNAME -eq "clang-mingw") {
Move-Item -Path "build\$env:OUT_DIR_LIB\libopen62541.a" -Destination pack_tmp\
} else {
Move-Item -Path "build\$env:OUT_DIR_LIB\open62541.lib" -Destination pack_tmp\
}
& 7z a -tzip open62541-$env:CC_SHORTNAME-static.zip "$env:APPVEYOR_BUILD_FOLDER\pack\*" "$env:APPVEYOR_BUILD_FOLDER\pack_tmp\*"
Remove-Item -Path pack_tmp -Recurse -Force
Remove-Item -Path build -Recurse -Force
Write-Host -ForegroundColor Green "`n###################################################################"
Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with amalgamation and .dll #####`n"
New-Item -ItemType directory -Path "build"
cd build
& cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON `
-DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -DBUILD_SHARED_LIBS:BOOL=ON -G"$env:GENERATOR" ..
Invoke-Expression $make_cmd
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
& 7z a -tzip open62541-$env:CC_SHORTNAME-dynamic.zip "$env:APPVEYOR_BUILD_FOLDER\pack\*" "$env:APPVEYOR_BUILD_FOLDER-$env:CC_SHORTNAME-static\*"
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0)
{
Write-Host -ForegroundColor Red "`n`n*** Zipping failed. Exiting ... ***"
exit $LASTEXITCODE
}
cd ..
New-Item -ItemType directory -Path pack_tmp
Move-Item -Path "build\open62541.c" -Destination pack_tmp\
Move-Item -Path "build\open62541.h" -Destination pack_tmp\
Move-Item -Path "build\$env:OUT_DIR_EXAMPLES\server_ctt.exe" -Destination pack_tmp\
Move-Item -Path "build\$env:OUT_DIR_EXAMPLES\client.exe" -Destination pack_tmp\
if ($env:CC_SHORTNAME -eq "mingw" -or $env:CC_SHORTNAME -eq "clang-mingw") {
Move-Item -Path "build\$env:OUT_DIR_LIB\libopen62541.dll" -Destination pack_tmp\
Move-Item -Path "build\$env:OUT_DIR_LIB\libopen62541.dll.a" -Destination pack_tmp\
} else {
Move-Item -Path "build\$env:OUT_DIR_LIB\open62541.dll" -Destination pack_tmp\
Move-Item -Path "build\$env:OUT_DIR_LIB\open62541.pdb" -Destination pack_tmp\
}
& 7z a -tzip open62541-$env:CC_SHORTNAME-dynamic.zip "$env:APPVEYOR_BUILD_FOLDER\pack\*" "$env:APPVEYOR_BUILD_FOLDER\pack_tmp\*"
Remove-Item -Path pack_tmp -Recurse -Force
Remove-Item -Path build -Recurse -Force
# Only execute unit tests on vs2017 to save compilation time
@ -137,11 +116,12 @@ try {
Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with unit tests #####`n"
New-Item -ItemType directory -Path "build"
cd build
& cmake $vcpkg_toolchain $vcpkg_triplet -DCMAKE_BUILD_TYPE=Debug -DUA_BUILD_EXAMPLES=OFF -DUA_ENABLE_DISCOVERY=ON `
-DUA_ENABLE_DISCOVERY_MULTICAST=ON -DUA_ENABLE_ENCRYPTION:BOOL=$build_encryption -DUA_BUILD_UNIT_TESTS=ON `
-DUA_ENABLE_PUBSUB:BOOL=ON -DUA_ENABLE_PUBSUB_INFORMATIONMODEL:BOOL=ON -DUA_ENABLE_PUBSUB_DELTAFRAMES:BOOL=ON `
-DUA_ENABLE_UNIT_TESTS_MEMCHECK=ON -DCHECK_PREFIX=c:\check -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX -G"$env:CC_NAME" ..
Invoke-Expression $make_cmd
& cmake $vcpkg_toolchain $vcpkg_triplet -DUA_BUILD_EXAMPLES=OFF -DUA_ENABLE_DISCOVERY=ON `
-DUA_ENABLE_DISCOVERY_MULTICAST=ON -DUA_ENABLE_ENCRYPTION:BOOL=$build_encryption -DUA_BUILD_UNIT_TESTS=ON `
-DUA_ENABLE_PUBSUB:BOOL=ON -DUA_ENABLE_PUBSUB_INFORMATIONMODEL:BOOL=ON -DUA_ENABLE_PUBSUB_DELTAFRAMES:BOOL=ON `
-DUA_ENABLE_UNIT_TESTS_MEMCHECK=ON -DCHECK_PREFIX=c:\check -DUA_COMPILE_AS_CXX:BOOL=$env:FORCE_CXX `
-DCMAKE_BUILD_TYPE=Debug -G"$env:CC_NAME" ..
& cmake --build . --config Debug
if ($LASTEXITCODE -and $LASTEXITCODE -ne 0) {
Write-Host -ForegroundColor Red "`n`n*** Make failed. Exiting ... ***"
exit $LASTEXITCODE

View File

@ -130,64 +130,73 @@ else
if ! [ -z ${MINGW+x} ]; then
echo -e "\r\n== Cross compile release build for MinGW 32 bit ==" && echo -en 'travis_fold:start:script.build.cross_mingw32\\r'
mkdir -p build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw32.cmake -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw32.cmake -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-win32 -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
make -j
if [ $? -ne 0 ] ; then exit 1 ; fi
cp ../LICENSE ../AUTHORS ../README.md .
zip -r open62541-win32.zip ../../doc_latex/open62541.pdf LICENSE AUTHORS README.md ./bin/examples/server_ctt.exe ./bin/examples/client.exe ./bin/libopen62541.* open62541.h open62541.c
cp open62541-win32.zip ..
cd .. && rm build -rf
make install
if [ $? -ne 0 ] ; then exit 1 ; fi
cd ..
zip -r open62541-win32.zip ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-win32/*
rm build -rf
echo -en 'travis_fold:end:script.build.cross_mingw32\\r'
echo -e "\r\n== Cross compile release build for MinGW 64 bit ==" && echo -en 'travis_fold:start:script.build.cross_mingw64\\r'
mkdir -p build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw64.cmake -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-mingw64.cmake -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-win64 -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
make -j
if [ $? -ne 0 ] ; then exit 1 ; fi
cp ../LICENSE ../AUTHORS ../README.md .
zip -r open62541-win64.zip ../../doc_latex/open62541.pdf LICENSE AUTHORS README.md ./bin/examples/server_ctt.exe ./bin/examples/client.exe ./bin/libopen62541.* open62541.h open62541.c
cp open62541-win64.zip ..
cd .. && rm build -rf
make install
if [ $? -ne 0 ] ; then exit 1 ; fi
cd ..
zip -r open62541-win64.zip ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-win64/*
rm build -rf
echo -en 'travis_fold:end:script.build.cross_mingw64\\r'
echo -e "\r\n== Cross compile release build for 32-bit linux ==" && echo -en 'travis_fold:start:script.build.cross_linux\\r'
mkdir -p build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-gcc-m32.cmake -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-gcc-m32.cmake -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-linux32 -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
make -j
if [ $? -ne 0 ] ; then exit 1 ; fi
tar -pczf open62541-linux32.tar.gz ../../doc_latex/open62541.pdf ../LICENSE ../AUTHORS ../README.md bin/examples/server_ctt bin/examples/client bin/libopen62541.* open62541.h open62541.c
cp open62541-linux32.tar.gz ..
cd .. && rm build -rf
make install
if [ $? -ne 0 ] ; then exit 1 ; fi
cd ..
tar -pczf open62541-linux32.tar.gz ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-linux32/*
rm build -rf
echo -en 'travis_fold:end:script.build.cross_linux\\r'
echo -e "\r\n== Cross compile release build for RaspberryPi ==" && echo -en 'travis_fold:start:script.build.cross_raspi\\r'
mkdir -p build && cd build
git clone https://github.com/raspberrypi/tools
export PATH=$PATH:./tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-rpi64.cmake -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=Release -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
cmake -DCMAKE_TOOLCHAIN_FILE=../tools/cmake/Toolchain-rpi64.cmake -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-raspberrypi -DUA_ENABLE_AMALGAMATION=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
make -j
if [ $? -ne 0 ] ; then exit 1 ; fi
tar -pczf open62541-raspberrypi.tar.gz ../../doc_latex/open62541.pdf ../LICENSE ../AUTHORS ../README.md bin/examples/server_ctt bin/examples/client bin/libopen62541.* open62541.h open62541.c
cp open62541-raspberrypi.tar.gz ..
cd .. && rm build -rf
make install
if [ $? -ne 0 ] ; then exit 1 ; fi
cd ..
tar -pczf open62541-raspberrypi.tar.gz ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-raspberrypi/*
rm build -rf
echo -en 'travis_fold:end:script.build.cross_raspi\\r'
fi
echo -e "\r\n== Compile release build for 64-bit linux ==" && echo -en 'travis_fold:start:script.build.linux_64\\r'
mkdir -p build && cd build
cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=OFF -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-linux64 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_ENABLE_AMALGAMATION=OFF -DUA_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=ON ..
make -j
if [ $? -ne 0 ] ; then exit 1 ; fi
tar -pczf open62541-linux64.tar.gz ../../doc_latex/open62541.pdf ../LICENSE ../AUTHORS ../README.md bin/examples/server_ctt bin/examples/client bin/libopen62541.* open62541.h open62541.c
cp open62541-linux64.tar.gz ..
cp open62541.h ../.. # copy single file-release
cp open62541.c ../.. # copy single file-release
cd .. && rm build -rf
make install
if [ $? -ne 0 ] ; then exit 1 ; fi
cd ..
tar -pczf open62541-linux64.tar.gz ../doc_latex/open62541.pdf LICENSE AUTHORS README.md open62541-linux64/*
rm build -rf
echo -en 'travis_fold:end:script.build.linux_64\\r'
echo -e "\r\n== Building the C++ example ==" && echo -en 'travis_fold:start:script.build.example\\r'
mkdir -p build && cd build
cp ../../open62541.* .
cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/$PYTHON -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-linux64 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON ..
make -j
cp open62541.h ../.. # copy single file-release
cp open62541.c ../.. # copy single file-release
gcc -std=c99 -c open62541.c
g++ ../examples/server.cpp -I./ open62541.o -lrt -o cpp-server
if [ $? -ne 0 ] ; then exit 1 ; fi

View File

@ -24,13 +24,12 @@ echo -en 'travis_fold:end:script.build.ns0\\r'
echo "Compile release build for OS X" && echo -en 'travis_fold:start:script.build.osx\\r'
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=ON -DUA_BUILD_EXAMPLES=ON ..
cmake -DCMAKE_BUILD_TYPE=Release -DUA_ENABLE_AMALGAMATION=OFF -DUA_BUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/open62541-osx ..
make -j
tar -pczf open62541-osx.tar.gz ../LICENSE ../AUTHORS ../README.md ./bin/examples/server_ctt ./bin/examples/client ./bin/libopen62541.a open62541.h open62541.c
cp open62541-osx.tar.gz ..
cp open62541.h .. #copy single file-release
cp open62541.c .. #copy single file-release
cd .. && rm -rf build
make install
cd ..
tar -pczf open62541-osx.tar.gz LICENSE AUTHORS README.md ${TRAVIS_BUILD_DIR}/open62541-osx/*
rm -rf build
echo -en 'travis_fold:end:script.build.osx\\r'
echo "Compile multithreaded version" && echo -en 'travis_fold:start:script.build.multithread\\r'