Skip to content
Open
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
35 changes: 30 additions & 5 deletions vinca/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,27 +424,41 @@ def generate_output(pkg_shortname, vinca_conf, distro, version, all_pkgs=None):
output["requirements"]["run"].extend(resolved_python)
output["requirements"]["host"].extend(resolved_python)

if is_dummy_metapackage(pkg_shortname, vinca_conf):
is_dummy_package = is_dummy_metapackage(pkg_shortname, vinca_conf)
build_type = pkg.get_build_type()

if is_dummy_package:
# Dummy recipes do not actually build anything, so we set the script to empty
output["build"]["script"] = ""
elif pkg.get_build_type() in ["cmake", "catkin"]:
elif build_type in ["cmake", "catkin"]:
output["build"]["script"] = (
"${{ '$RECIPE_DIR/build_catkin.sh' if unix or wasm32 else '%RECIPE_DIR%\\\\bld_catkin.bat' }}"
)
elif pkg.get_build_type() in ["ament_cmake"]:
elif build_type in ["ament_cmake"]:
output["build"]["script"] = (
"${{ '$RECIPE_DIR/build_ament_cmake.sh' if unix or wasm32 else '%RECIPE_DIR%\\\\bld_ament_cmake.bat' }}"
)
elif pkg.get_build_type() in ["ament_python"]:
elif build_type in ["ament_python"]:
output["build"]["script"] = (
"${{ '$RECIPE_DIR/build_ament_python.sh' if unix or wasm32 else '%RECIPE_DIR%\\\\bld_ament_python.bat' }}"
)
resolved_setuptools = resolve_pkgname("python-setuptools", vinca_conf, distro)
output["requirements"]["host"].extend(resolved_setuptools)
else:
print(f"Unknown build type for {pkg_shortname}: {pkg.get_build_type()}")
print(f"Unknown build type for {pkg_shortname}: {build_type}")
return None

if not is_dummy_package and build_type in ["cmake", "catkin", "ament_cmake"]:
output["requirements"]["build"].append(
{
"if": "osx",
"then": [
"clang-tools ${{ (cxx_compiler_version ~ '.*') if "
"cxx_compiler_version is defined else '*' }}"
],
}
)

if vinca_conf.get("mutex_package"):
mutex_dep = get_mutex_package_dependency(vinca_conf, distro)
if mutex_dep:
Expand Down Expand Up @@ -1152,6 +1166,17 @@ def parse_package(pkg, distro, vinca_conf, path):
"${{ '$RECIPE_DIR/build_catkin.sh' if unix or wasm32 else '%RECIPE_DIR%\\\\bld_catkin.bat' }}"
)

if pkg.get_build_type() in ["cmake", "catkin", "ament_cmake"]:
recipe["requirements"]["build"].append(
{
"if": "osx",
"then": [
"clang-tools ${{ (cxx_compiler_version ~ '.*') if "
"cxx_compiler_version is defined else '*' }}"
],
}
)

return recipe


Expand Down
15 changes: 15 additions & 0 deletions vinca/templates/build_ament_cmake.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ else
export CMAKE_BLD="cmake"
fi;

# CMake tries to find arm64-apple-darwin20.0.0-clang-scan-deps but only clang-scan-deps (without prefix)
# are found if using clang < 22.*, so we need to manually specify the path
CMAKE_CLANG_SCAN_DEPS_ARGS=()
if [[ $target_platform =~ osx.* ]]; then
CLANG_SCAN_DEPS="$BUILD_PREFIX/bin/clang-scan-deps"
if [[ ! -x "$CLANG_SCAN_DEPS" ]]; then
echo "Missing executable clang-scan-deps at $CLANG_SCAN_DEPS" >&2
exit 1
fi
CMAKE_CLANG_SCAN_DEPS_ARGS+=(
"-DCMAKE_CXX_COMPILER_CLANG_SCAN_DEPS=$CLANG_SCAN_DEPS"
)
fi

if [ "${PKG_NAME}" == "@(ros_package_prefix)-rmw-wasm-cpp" ]; then
WORK_DIR=$SRC_DIR/$PKG_NAME/src/work/rmw_wasm_cpp
elif [ "${PKG_NAME}" == "@(ros_package_prefix)-wasm-cpp" ]; then
Expand Down Expand Up @@ -132,6 +146,7 @@ $CMAKE_GEN \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$OSX_DEPLOYMENT_TARGET \
--compile-no-warning-as-error \
$EXTRA_CMAKE_ARGS \
"${CMAKE_CLANG_SCAN_DEPS_ARGS[@@]}" \
@(additional_cmake_args) \
$WORK_DIR

Expand Down
15 changes: 15 additions & 0 deletions vinca/templates/build_catkin.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ if [[ $target_platform =~ emscripten.* ]]; then
"
fi

# CMake tries to find arm64-apple-darwin20.0.0-clang-scan-deps but only clang-scan-deps (without prefix)
# are found if using clang < 22.*, so we need to manually specify the path
CMAKE_CLANG_SCAN_DEPS_ARGS=()
if [[ $target_platform =~ osx.* ]]; then
CLANG_SCAN_DEPS="$BUILD_PREFIX/bin/clang-scan-deps"
if [[ ! -x "$CLANG_SCAN_DEPS" ]]; then
echo "Missing executable clang-scan-deps at $CLANG_SCAN_DEPS" >&2
exit 1
fi
CMAKE_CLANG_SCAN_DEPS_ARGS+=(
"-DCMAKE_CXX_COMPILER_CLANG_SCAN_DEPS=$CLANG_SCAN_DEPS"
)
fi

export SKIP_TESTING=@(skip_testing)

if [ "${PKG_NAME}" == "@(ros_package_prefix)-euslisp" ] || [ "${PKG_NAME}" = "@(ros_package_prefix)-jskeus" ] || [ "${PKG_NAME}" = "@(ros_package_prefix)-roseus" ]; then
Expand Down Expand Up @@ -109,6 +123,7 @@ cmake ${CMAKE_ARGS} --compile-no-warning-as-error \
-DCATKIN_BUILD_BINARY_PACKAGE=$CATKIN_BUILD_BINARY_PACKAGE \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$OSX_DEPLOYMENT_TARGET \
$EXTRA_CMAKE_ARGS \
"${CMAKE_CLANG_SCAN_DEPS_ARGS[@@]}" \
@(additional_cmake_args) \
-G "$GENERATOR" \
$SRC_DIR/$PKG_NAME/src/work/@(additional_folder)
Expand Down