Fix "make install" on Unix and add tests for it to CI scripts
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
58e91c4304
commit
29f0ef6e17
3 changed files with 28 additions and 12 deletions
23
.travis.yml
23
.travis.yml
|
@ -30,17 +30,17 @@ osx_xcode94: &osx_xcode94
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- <<: *linux_gcc8
|
- <<: *linux_gcc8
|
||||||
env: [ BUILD_TYPE=Debug, C_COMPILER=gcc-8, CXX_COMPILER=g++-8 ]
|
env: [ BUILD_TYPE=Debug, C_COMPILER=gcc-8, CXX_COMPILER=g++-8, USE_SANITIZER=none ]
|
||||||
- <<: *linux_gcc8
|
- <<: *linux_gcc8
|
||||||
env: [ BUILD_TYPE=Release, C_COMPILER=gcc-8, CXX_COMPILER=g++-8 ]
|
env: [ BUILD_TYPE=Release, C_COMPILER=gcc-8, CXX_COMPILER=g++-8, USE_SANITIZER=none ]
|
||||||
- <<: *linux_clang60
|
- <<: *linux_clang60
|
||||||
env: [ BUILD_TYPE=Debug, C_COMPILER=clang-6.0, CXX_COMPILER=clang++-6.0 ]
|
env: [ BUILD_TYPE=Debug, C_COMPILER=clang-6.0, CXX_COMPILER=clang++-6.0, USE_SANITIZER=address ]
|
||||||
- <<: *linux_clang60
|
- <<: *linux_clang60
|
||||||
env: [ BUILT_TYPE=Release, C_COMPILER=clang-6.0, CXX_COMPILER=clang++-6.0 ]
|
env: [ BUILT_TYPE=Release, C_COMPILER=clang-6.0, CXX_COMPILER=clang++-6.0, USE_SANITIZER=none ]
|
||||||
- <<: *osx_xcode94
|
- <<: *osx_xcode94
|
||||||
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++ ]
|
env: [ BUILD_TYPE=Debug, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=address ]
|
||||||
- <<: *osx_xcode94
|
- <<: *osx_xcode94
|
||||||
env: [ BUILD_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++ ]
|
env: [ BUILD_TYPE=Release, C_COMPILER=clang, CXX_COMPILER=clang++, USE_SANITIZER=none ]
|
||||||
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
|
@ -67,7 +67,12 @@ script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- conan install ..
|
- conan install ..
|
||||||
- cmake -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ../src
|
- cmake -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DUSE_SANITIZER=${USE_SANITIZER} -DCMAKE_INSTALL_PREFIX=${PWD}/install ../src
|
||||||
- cmake --build .
|
- cmake --build . --target install
|
||||||
|
- mkdir install/share/CycloneDDS/examples/helloworld/build
|
||||||
|
- if [ "$USE_SANITIZER" = "none" ]; then
|
||||||
|
(cd install/share/CycloneDDS/examples/helloworld/build && cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. && cmake --build .) ;
|
||||||
|
else
|
||||||
|
(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 .) ;
|
||||||
|
fi
|
||||||
- ctest -T test
|
- ctest -T test
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,14 @@ build_script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- conan install -s arch=%ARCH% -s build_type=%CONFIGURATION% ..
|
- conan install -s arch=%ARCH% -s build_type=%CONFIGURATION% ..
|
||||||
- cmake -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%GENERATOR%" ../src
|
- cmake -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=%CD%/install -G "%GENERATOR%" ../src
|
||||||
|
- cmake --build . --config %CONFIGURATION% --target install
|
||||||
|
- cd install/share/CycloneDDS/examples/helloworld
|
||||||
|
- mkdir build
|
||||||
|
- cd build
|
||||||
|
- cmake -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "%GENERATOR%" ..
|
||||||
- cmake --build . --config %CONFIGURATION%
|
- cmake --build . --config %CONFIGURATION%
|
||||||
|
- cd ../../../../../..
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- ctest --test-action test --build-config %CONFIGURATION%
|
- ctest --test-action test --build-config %CONFIGURATION%
|
||||||
|
|
||||||
|
|
|
@ -120,12 +120,18 @@ if(BUILD_TESTING)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include/os/${system_name}/os_platform_public.h")
|
||||||
|
set(os_platform_public_h "${CMAKE_CURRENT_SOURCE_DIR}/include/os/${system_name}/os_platform_public.h")
|
||||||
|
else()
|
||||||
|
set(os_platform_public_h "${CMAKE_CURRENT_SOURCE_DIR}/include/os/posix/os_platform_public.h")
|
||||||
|
endif()
|
||||||
|
|
||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/os/os_public.h"
|
"${CMAKE_CURRENT_SOURCE_DIR}/include/os/os_public.h"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/os/os_decl_attributes.h"
|
"${CMAKE_CURRENT_SOURCE_DIR}/include/os/os_decl_attributes.h"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/os/os_decl_attributes_sal.h"
|
"${CMAKE_CURRENT_SOURCE_DIR}/include/os/os_decl_attributes_sal.h"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/os/${system_name}/os_platform_public.h"
|
"${os_platform_public_h}"
|
||||||
DESTINATION
|
DESTINATION
|
||||||
"${CMAKE_INSTALL_INCLUDEDIR}/ddsc/os"
|
"${CMAKE_INSTALL_INCLUDEDIR}/ddsc/os"
|
||||||
COMPONENT
|
COMPONENT
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue