Skip to content

Commit 17373aa

Browse files
committed
test for macos and windows support
1 parent 95bc9fe commit 17373aa

File tree

6 files changed

+55
-4
lines changed

6 files changed

+55
-4
lines changed

.github/workflows/cpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
17+
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-2022, macos-14]
1818
steps:
1919
- uses: actions/checkout@v3
2020
- name: Setup cmake

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
13+
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2022, macos-14]
1414

1515
steps:
1616
- uses: actions/checkout@v3

cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
3333
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
3434

3535
include(3rdparty/find_dependencies.cmake)
36+
include(cmake/CompilerOptions.cmake)
3637

3738
add_subdirectory(map_closures)
3839
add_subdirectory(gt_closures)

cpp/cmake/CompilerOptions.cmake

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# MIT License
2+
#
3+
# Copyright (c) 2022 Ignacio Vizzo, Tiziano Guadagnino, Benedikt Mersch, Cyrill
4+
# Stachniss.
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
function(set_global_target_properties target)
24+
target_compile_features(${target} PUBLIC cxx_std_17)
25+
target_compile_definitions(${target} PUBLIC $<$<COMPILE_LANG_AND_ID:CXX,MSVC>:_USE_MATH_DEFINES>)
26+
target_compile_options(
27+
${target}
28+
PRIVATE # MSVC
29+
$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/W4>
30+
$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/WX>
31+
# Clang/AppleClang
32+
$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-fcolor-diagnostics>
33+
$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wall>
34+
$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wextra>
35+
$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wno-sign-conversion>
36+
# GNU
37+
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-fdiagnostics-color=always>
38+
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wall>
39+
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wextra>
40+
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-pedantic>
41+
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wcast-align>
42+
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wcast-qual>
43+
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wdisabled-optimization>
44+
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Woverloaded-virtual>)
45+
set(INCLUDE_DIRS ${PROJECT_SOURCE_DIR})
46+
get_filename_component(INCLUDE_DIRS ${INCLUDE_DIRS} PATH)
47+
target_include_directories(
48+
${target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
49+
PUBLIC $<BUILD_INTERFACE:${INCLUDE_DIRS}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
50+
endfunction()

cpp/gt_closures/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ add_library(gt_closures STATIC)
2525
target_sources(gt_closures PRIVATE VoxelHashSet.cpp GTClosures.cpp)
2626
target_include_directories(gt_closures PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
2727
target_link_libraries(gt_closures PUBLIC Eigen3::Eigen TBB::tbb tsl::robin_map)
28-
target_compile_features(gt_closures PUBLIC cxx_std_17)
28+
set_global_target_properties(gt_closures)

cpp/map_closures/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ add_library(map_closures STATIC)
2525
target_sources(map_closures PRIVATE DensityMap.cpp AlignRansac2D.cpp MapClosures.cpp)
2626
target_include_directories(map_closures PUBLIC ${hbst_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
2727
target_link_libraries(map_closures PUBLIC Eigen3::Eigen TBB::tbb ${OpenCV_LIBS})
28-
target_compile_features(map_closures PUBLIC cxx_std_17)
28+
set_global_target_properties(map_closures)

0 commit comments

Comments
 (0)