Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github Action for Windows and fix build #1049

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Windows
on:
pull_request:

jobs:
build:
name: Window CI
env:
PACKAGE: gz-rendering9
runs-on: windows-latest
steps:
- name: setup-pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
run-install: false

- name: Install build tools
run: |
pixi init
pixi add vcstool colcon-common-extensions pkgconfig
- name: Setup pixi env variables
shell: bash
run: |
eval "$(pixi shell-hook)"
echo CMAKE_PREFIX_PATH=$CONDA_PREFIX/Library >> $GITHUB_ENV
- name: Install base dependencies
run: |
# List adapted from https://github.com/gazebo-tooling/release-tools/blob/f89ac8cafc646260598eb8eb6d94be8093bdc9f7/jenkins-scripts/lib/windows_env_vars.bat#L22
pixi add assimp dlfcn-win32 eigen ffmpeg freeimage gdal gflags ogre ogre-next spdlog tinyxml2
- name: Clone source dependencies
run: |
mkdir src
cd src
pixi run vcs import --input https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/${env:PACKAGE}.yaml

- uses: actions/checkout@v4
with:
path: src/gz-rendering

- name: Build Dependencies
run: |
pixi run colcon build --merge-install --cmake-args -G"Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF --event-handlers console_direct+ --packages-up-to ${env:PACKAGE}

- name: Build Package
run: pixi run colcon build --merge-install --cmake-args -G"Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DSKIP_ogre=ON --event-handlers console_direct+ --packages-select ${env:PACKAGE}

- name: Test
run: pixi run colcon test --merge-install --event-handlers console_direct+ --packages-select ${env:PACKAGE}
8 changes: 6 additions & 2 deletions ogre2/src/Ogre2Scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#else
#ifndef _WIN32
#ifdef _WIN32
// windows.h has to be included *before* GL/gl.h
// to avoid redefinition errors.
#include <windows.h>
#endif

#include <GL/gl.h>
#endif
#endif

#include <gz/common/Console.hh>

Expand Down