Skip to content

Commit

Permalink
Enable 24.04 CI, remove distutils dependency (#587)
Browse files Browse the repository at this point in the history
* Enable GitHub workflow on Ubuntu Noble
* Require cmake version 3.22.1
  Part of gazebosim/gz-cmake#350.
* Remove old ruby cmake code
* Remove old python cmake code
  Also don't need to install python3-distutils anymore.

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters authored Apr 18, 2024
1 parent e0193a5 commit 2f1e049
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
1 change: 0 additions & 1 deletion .github/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ libeigen3-dev
libgz-cmake4-dev
libgz-utils3-dev
libpython3-dev
python3-distutils
python3-pybind11
python3-pytest
ruby-dev
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ jobs:
cppcheck-enabled: true
cpplint-enabled: true
doxygen-enabled: true
noble-ci:
runs-on: ubuntu-latest
name: Ubuntu Noble CI
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@noble
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)

#============================================================================
# Initialize the project
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)

project(gz-math-examples)

Expand Down
15 changes: 3 additions & 12 deletions src/python_pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
endif()

if(USE_SYSTEM_PATHS_FOR_PYTHON_INSTALLATION)
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c "if True:
from distutils import sysconfig as sc
print(sc.get_python_lib(plat_specific=True))"
OUTPUT_VARIABLE Python3_SITEARCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
# Get install variable from Python3 module
# Python3_SITEARCH is available from 3.12 on, workaround if needed:
find_package(Python3 COMPONENTS Interpreter)
endif()
# Get install variable from Python3 module
# Python3_SITEARCH is available from 3.12 on, workaround if needed:
find_package(Python3 COMPONENTS Interpreter)

if(USE_DIST_PACKAGES_FOR_PYTHON)
string(REPLACE "site-packages" "dist-packages" GZ_PYTHON_INSTALL_PATH ${Python3_SITEARCH})
Expand Down
6 changes: 1 addition & 5 deletions src/ruby/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ if (RUBY_FOUND)

# Create the ruby library
set(CMAKE_SWIG_OUTDIR "${CMAKE_BINARY_DIR}/lib/ruby")
if(CMAKE_VERSION VERSION_GREATER 3.8.0)
SWIG_ADD_LIBRARY(${SWIG_RB_LIB} LANGUAGE ruby SOURCES ruby.i ${swig_i_files})
else()
SWIG_ADD_MODULE(${SWIG_RB_LIB} ruby ruby.i ${swig_i_files})
endif()
SWIG_ADD_LIBRARY(${SWIG_RB_LIB} LANGUAGE ruby SOURCES ruby.i ${swig_i_files})

# Suppress warnings on SWIG-generated files
target_compile_options(${SWIG_RB_LIB} PRIVATE
Expand Down

0 comments on commit 2f1e049

Please sign in to comment.