Skip to content

Commit 6fe2364

Browse files
Add env var for CMake build dir to avoid too long path on Windows (#115)
* add env var for build dir to avoid too long path on windows * use VINCA_ prefix * also on unix * use custom cmake build dir on win CI to avoid too long path * format
1 parent afdcfe8 commit 6fe2364

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

vinca/generate_gha.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,10 @@ def build_win_pipeline(stages, trigger_branch, outfile="win.yml", azure_template
370370
"runs-on": vm_imagename,
371371
"strategy": {"fail-fast": False},
372372
"needs": prev_batch_keys,
373-
"env": {"CONDA_BLD_PATH": "C:\\\\bld\\\\"},
373+
"env": [
374+
{"CONDA_BLD_PATH": "C:\\\\bld\\\\"},
375+
{"VINCA_CUSTOM_CMAKE_BUILD_DIR": "C:\\\\x\\\\"},
376+
],
374377
"steps": [
375378
{"name": "Checkout code", "uses": "actions/checkout@v6"},
376379
{

vinca/templates/bld_ament_cmake.bat.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ set "PYTHONPATH=%LIBRARY_PREFIX%\lib\site-packages;%SP_DIR%"
88
set CC=cl.exe
99
set CXX=cl.exe
1010

11+
:: If defined, can use a custom CMake build directory which can be useful
12+
:: to avoid too long path problems on windows
13+
if defined VINCA_CUSTOM_CMAKE_BUILD_DIR (
14+
cd /d "%VINCA_CUSTOM_CMAKE_BUILD_DIR%"
15+
)
1116
rd /s /q build
1217
mkdir build
1318
pushd build

vinca/templates/build_ament_cmake.sh.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
set -eo pipefail
55

6+
if [[ -n "$VINCA_CUSTOM_CMAKE_BUILD_DIR" ]]; then
7+
cd "$VINCA_CUSTOM_CMAKE_BUILD_DIR"
8+
fi
69
rm -rf build
710
mkdir build
811
cd build

0 commit comments

Comments
 (0)