Skip to content

Commit

Permalink
fix compilation with WIN32_LEAN_AND_MEAN
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjap committed Apr 26, 2024
1 parent 1110fd6 commit 897ff38
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 21 deletions.
76 changes: 56 additions & 20 deletions .github/workflows/colcon-workspace.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
name: colcon workspace
name: ROS workspace CI

on: [push, pull_request]

jobs:
# build on Ubuntu docker images
build_linux:
name: "Ubuntu (${{ matrix.ros_distribution }})"
name: Ubuntu (${{ matrix.ros_distribution }}, ${{ matrix.config }})

runs-on: ubuntu-latest

strategy:
matrix:
ros_distribution: [noetic, humble]
ros_distribution: [melodic, noetic, humble]
config: ["default"] # nice name
cmake_args: ['[ ]'] # empty list of options
include:
- docker_image: ubuntu:18.04
ros_distribution: melodic
ros_version: 1

- docker_image: ubuntu:20.04
ros_distribution: noetic
ros_version: 1
Expand All @@ -21,6 +27,13 @@ jobs:
ros_distribution: humble
ros_version: 2

# build static library, this will set BUILD_PYTHON_WRAPPER to OFF
- docker_image: ubuntu:22.04
ros_distribution: humble
ros_version: 2
config: "static"
cmake_args: '[ "-DBUILD_SHARED_LIBS=OFF" ]'

container:
image: ${{ matrix.docker_image }}

Expand All @@ -30,29 +43,37 @@ jobs:
apt update
apt install --no-install-recommends -y git ca-certificates
- uses: actions/checkout@v4
- uses: actions/checkout@v3
#with:
# submodules: recursive

- name: Setup ROS environment
uses: ros-tooling/setup-ros@v0.7
uses: ros-tooling/setup-ros@v0.4

- name: ROS 1 CI Action
if: ${{ matrix.ros_version == 1 }}
uses: ros-tooling/action-ros-ci@v0.3
uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: apriltag
target-ros1-distro: ${{ matrix.ros_distribution }}

- name: ROS 2 CI Action
if: ${{ matrix.ros_version == 2 }}
uses: ros-tooling/action-ros-ci@v0.3
uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: apriltag
target-ros2-distro: ${{ matrix.ros_distribution }}
colcon-defaults: |
{
"build": {
"cmake-args": ${{ matrix.cmake_args }}
}
}
# build on Windows native
build_windows:
name: "Windows (${{ matrix.ros_distribution }})"
name: Windows (${{ matrix.ros_distribution }})

runs-on: windows-2019

Expand All @@ -67,51 +88,66 @@ jobs:
ros_version: 2

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup ROS environment
uses: ros-tooling/setup-ros@v0.7
uses: ros-tooling/setup-ros@v0.4

- name: ROS 1 CI Action
if: ${{ matrix.ros_version == 1 }}
uses: ros-tooling/action-ros-ci@v0.3
uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: apriltag
target-ros1-distro: ${{ matrix.ros_distribution }}
colcon-defaults: |
{
"build": {
"cmake-args": [ "-DBUILD_SHARED_LIBS=OFF", "-DCMAKE_CXX_FLAGS='/DWIN32_MEAN_AND_LEAN'" ]
}
}
- name: ROS 2 CI Action
if: ${{ matrix.ros_version == 2 }}
uses: ros-tooling/action-ros-ci@v0.3
uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: apriltag
target-ros2-distro: ${{ matrix.ros_distribution }}
colcon-defaults: |
{
"build": {
"cmake-args": [ "-DBUILD_SHARED_LIBS=OFF", "-DCMAKE_CXX_FLAGS='/DWIN32_MEAN_AND_LEAN'" ]
}
}
# build on macOS native
build_macos:
name: "macOS (${{ matrix.ros_distribution }})"
name: macOS (${{ matrix.ros_distribution }})

runs-on: macos-latest

strategy:
fail-fast: false
matrix:
ros_distribution: [humble]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Setup ROS environment
uses: ros-tooling/setup-ros@v0.7
uses: ros-tooling/setup-ros@v0.4

- name: ROS 2 CI Action
uses: ros-tooling/action-ros-ci@v0.3
uses: ros-tooling/action-ros-ci@v0.2
with:
package-name: apriltag
target-ros2-distro: ${{ matrix.ros_distribution }}
colcon-defaults: |
{
"build": {
"cmake-args": [ "-DBUILD_PYTHON_WRAPPER=OFF" ]
}
}
2 changes: 1 addition & 1 deletion common/time_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ either expressed or implied, of the Regents of The University of Michigan.
#include <time.h>

#ifdef _WIN32
#include <windows.h>
#include <Winsock2.h>
typedef long long suseconds_t;
#endif

Expand Down

0 comments on commit 897ff38

Please sign in to comment.