mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-09 00:15:10 +00:00
使用rattler-build进行构建测试
This commit is contained in:
65
recipes/msgs/bld_ament_cmake.bat
Normal file
65
recipes/msgs/bld_ament_cmake.bat
Normal file
@@ -0,0 +1,65 @@
|
||||
:: Generated by vinca http://github.com/RoboStack/vinca.
|
||||
:: DO NOT EDIT!
|
||||
setlocal EnableDelayedExpansion
|
||||
|
||||
set "PYTHONPATH=%LIBRARY_PREFIX%\lib\site-packages;%SP_DIR%"
|
||||
|
||||
:: MSVC is preferred.
|
||||
set CC=cl.exe
|
||||
set CXX=cl.exe
|
||||
|
||||
rd /s /q build
|
||||
mkdir build
|
||||
pushd build
|
||||
|
||||
:: set "CMAKE_GENERATOR=Ninja"
|
||||
|
||||
:: try to fix long paths issues by using default generator
|
||||
set "CMAKE_GENERATOR=Visual Studio %VS_MAJOR% %VS_YEAR%"
|
||||
set "SP_DIR_FORWARDSLASHES=%SP_DIR:\=/%"
|
||||
|
||||
set PYTHON="%PREFIX%\python.exe"
|
||||
|
||||
cmake ^
|
||||
-G "%CMAKE_GENERATOR%" ^
|
||||
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
|
||||
-DCMAKE_BUILD_TYPE=Release ^
|
||||
-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=True ^
|
||||
-DPYTHON_EXECUTABLE=%PYTHON% ^
|
||||
-DPython_EXECUTABLE=%PYTHON% ^
|
||||
-DPython3_EXECUTABLE=%PYTHON% ^
|
||||
-DSETUPTOOLS_DEB_LAYOUT=OFF ^
|
||||
-DBUILD_SHARED_LIBS=ON ^
|
||||
-DBUILD_TESTING=OFF ^
|
||||
-DCMAKE_OBJECT_PATH_MAX=255 ^
|
||||
-DPYTHON_INSTALL_DIR=%SP_DIR_FORWARDSLASHES% ^
|
||||
--compile-no-warning-as-error ^
|
||||
%SRC_DIR%\src
|
||||
if errorlevel 1 exit 1
|
||||
|
||||
set "infile=%SRC_DIR%\build\cmake_install.cmake"
|
||||
set "tmpfile=%infile%.tmp"
|
||||
|
||||
rem 模式串
|
||||
set "pattern=echo %PYTHON%"
|
||||
|
||||
> "%tmpfile%" (
|
||||
for /f "usebackq delims=" %%L in ("%infile%") do (
|
||||
set "line=%%L"
|
||||
rem 把 pattern 从 line 里“删除”,看看结果是否变化
|
||||
set "test=!line:%pattern%=!"
|
||||
if "!test!" neq "!line!" (
|
||||
rem 含有 echo %PYTHON%,对整行做 \→\\ 全局替换
|
||||
echo !line:\=\\!
|
||||
) else (
|
||||
rem 不含,原样输出
|
||||
echo !line!
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
rem 用 tmp 覆盖原文件
|
||||
move /Y "%tmpfile%" "%infile%" > nul
|
||||
|
||||
cmake --build . --config Release --target install
|
||||
if errorlevel 1 exit 1
|
||||
Reference in New Issue
Block a user