Skip to content
Snippets Groups Projects
Commit 94fee14d authored by rafaelatc3sl's avatar rafaelatc3sl
Browse files

Issue #13: Fix build Unix from CI


Signed-off-by: default avatarrafaelatc3sl <rpd17@c3sl>
parent 0de69e8b
No related branches found
No related tags found
2 merge requests!112Versão 1.0.1,!110Issue #13: Fix build Unix from CI
Pipeline #19658 passed
cache:
paths:
- build/Boost/src/Boost
stages:
- lint
- build
......@@ -29,7 +33,7 @@ compileUnix:
libudev-dev
- git submodule init
- git submodule update --init --recursive
- mkdir build
- mkdir -p build
- cd build
- cmake -DCURL_STATICLIB=ON ..
- make
......@@ -38,25 +42,25 @@ compileUnix:
- ./generate_agent.sh -idp=1234 -ws=www.C3Sl.ufpr.br -pch=mumm -pcp=6666 -pcu=ninguem -pcpasswd=123mudar -prj=simmc
- chmod +x agent-1234.run
compileWin:
stage: build
artifacts:
paths:
- agent-1234.exe
tags:
- windows
script:
- set PATH=%PATH%;C:\Program Files\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
- call vcvarsall.bat x86
- git submodule init
- git submodule update --init --recursive
- rd /s /q build
- call mkdir build
- cd build
- cmake .. -G "NMake Makefiles"
- nmake
- cd ..
- iscc generate_agent.iss /Didp=1234 /Dws=www.C3Sl.ufpr.br /Dpch=mumm /Dpcp=6666 /Dpcu=ninguem /Dpcpasswd=123mudar /Dprj=simmc /Dversion=1.0.0
# compileWin:
# stage: build
# artifacts:
# paths:
# - agent-1234.exe
# tags:
# - windows
# script:
# - set PATH=%PATH%;C:\Program Files\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
# - call vcvarsall.bat x86
# - git submodule init
# - git submodule update --init --recursive
# - rd /s /q build
# - call mkdir build
# - cd build
# - cmake .. -G "NMake Makefiles"
# - nmake
# - cd ..
# - iscc generate_agent.iss /Didp=1234 /Dws=www.C3Sl.ufpr.br /Dpch=mumm /Dpcp=6666 /Dpcu=ninguem /Dpcpasswd=123mudar /Dprj=simmc /Dversion=1.0.0
testDebian:
stage: test
......@@ -109,21 +113,21 @@ testOpensuse:
dependencies:
- compileUnix
testWin7:
stage: test
tags:
- windows
script:
- if exist C:\agentC3SL rmdir C:\agentC3SL /s /q
- agent-1234.exe /SILENT /VERYSILENT
- if not exist C:\agentC3SL exit 1;
- copy C:\jq-win32.exe .\test
- cd .\test
- C:\agentC3SL\bin\agent-v0.0.exe --once --print > test.json
- testWin.bat
- C:\agentC3SL\uninstall_agent.exe /SILENT /VERYSILENT
- dir /b /a "C:\agentC3SL\*" | >nul findstr "^" && (echo Agent has been uninstalled) || (exit 1);
dependencies:
- compileWin
# testWin7:
# stage: test
# tags:
# - windows
# script:
# - if exist C:\agentC3SL rmdir C:\agentC3SL /s /q
# - agent-1234.exe /SILENT /VERYSILENT
# - if not exist C:\agentC3SL exit 1;
# - copy C:\jq-win32.exe .\test
# - cd .\test
# - C:\agentC3SL\bin\agent-v0.0.exe --once --print > test.json
# - testWin.bat
# - C:\agentC3SL\uninstall_agent.exe /SILENT /VERYSILENT
# - dir /b /a "C:\agentC3SL\*" | >nul findstr "^" && (echo Agent has been uninstalled) || (exit 1);
# dependencies:
# - compileWin
......@@ -6,6 +6,10 @@ project( simmc-agent )
set ( VERSION_MAJOR 0 )
set ( VERSION_MINOR 0 )
# determines the thread library of the system
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
# cpr requires c++11
if(WIN32)
add_definitions( -DBOOST_ALL_NO_LIB )
......@@ -54,7 +58,7 @@ include ( "modules/boost.cmake" )
# compile
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY "../bin" )
add_executable ( agent-v${VERSION_MAJOR}.${VERSION_MINOR} ${SOURCES} )
target_link_libraries ( agent-v${VERSION_MAJOR}.${VERSION_MINOR} ${CURL_LIBRARIES} ${FILESYSTEM_LIB} ${SYSTEM_LIB} ${REGEX_LIB} ${PROGRAM_OPTIONS_LIB} ${CROSS_STATIC} )
target_link_libraries ( agent-v${VERSION_MAJOR}.${VERSION_MINOR} ${CURL_LIBRARIES} ${FILESYSTEM_LIB} ${SYSTEM_LIB} ${REGEX_LIB} ${PROGRAM_OPTIONS_LIB} ${CROSS_STATIC} ${CMAKE_THREAD_LIBS_INIT} )
add_dependencies ( agent-v${VERSION_MAJOR}.${VERSION_MINOR} Boost)
......
......@@ -28,8 +28,6 @@ if (NOT Boost)
PREFIX Boost
GIT_REPOSITORY ${BOOST_URL}
GIT_SUBMODULES libs/asio libs/date_time libs/config libs/core libs/detail libs/io libs/iterator libs/predef libs/preprocessor libs/smart_ptr libs/throw_exception libs/system libs/filesystem libs/integer tools/build tools/bcp libs/serialization libs/interprocess libs/tokenizer libs/algorithm libs/program_options libs/regex libs/static_assert libs/thread libs/utility libs/numeric libs/range libs/array libs/bind libs/concept_check libs/lexical_cast libs/math libs/functional libs/assert libs/type_traits libs/mpl libs/move libs/container libs/any libs/type_index libs/function
UPDATE_COMMAND ./bootstrap.sh --with-libraries=filesystem,system,regex,program_options --includedir=${CMAKE_BINARY_DIR}/include/
CONFIGURE_COMMAND ./b2 headers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment