Skip to content

Commit

Permalink
support relative paths as arguments to .bat build scripts
Browse files Browse the repository at this point in the history
Reviewed By: enpe

Differential Revision:
D63553765

Privacy Context Container: L1191897

fbshipit-source-id: 87c9bf4a282b03164895623cc6961af7dbc60498
  • Loading branch information
ASchneiderMeta authored and facebook-github-bot committed Sep 27, 2024
1 parent 2585082 commit c858a7a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
13 changes: 10 additions & 3 deletions build/cmake/build_ocean_android.bat
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ for %%a in (!-android_abi!) do (
exit /b
)

set BUILD_DIRECTORY=!-build!\!bibase!
set INSTALL_DIRECTORY=!-install!\!bibase!
call :normalize_path !-build!
set BUILD_DIRECTORY=!NORMEDPATH!\!bibase!
call :normalize_path !-install!
set INSTALL_DIRECTORY=!NORMEDPATH!\!bibase!

set TPFWD=!-third-party:\=/!
call :normalize_path !-third-party!
set TPFWD=!NORMEDPATH:\=/!
set TPDIR=!TPFWD!/!bibase!
set TPSPEC=-DCMAKE_PREFIX_PATH="!TPDIR!" -DCMAKE_MODULE_PATH="!TPDIR!" -DCMAKE_FIND_ROOT_PATH="!TPDIR!"

Expand Down Expand Up @@ -202,3 +205,7 @@ if %errorlevel% neq 0 (
) else (
exit /b 0
)

:normalize_path
set NORMEDPATH=%~f1
exit /b
8 changes: 7 additions & 1 deletion build/cmake/build_ocean_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ for %%c in (!-config!) do (

set TPSPEC=
if NOT !-third-party! == NULL (
set TPDIR=!-third-party!\!bibase!
call :normalize_path !-third-party!
set TPDIR=!NORMEDPATH!\!bibase!
set TPSPEC="-DCMAKE_PREFIX_PATH=!TPDIR!"
)

Expand Down Expand Up @@ -153,3 +154,8 @@ if %errorlevel% neq 0 (
) else (
exit /b 0
)

:normalize_path
set NORMEDPATH=%~f1
exit /b

11 changes: 9 additions & 2 deletions build/cmake/build_thirdparty_android.bat
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ for %%a in (!-android_abi!) do (
exit /b
)

set BUILD_DIRECTORY="!-build!\!bibase!"
set INSTALL_DIRECTORY=!-install!\!bibase!
call :normalize_path !-build!
set BUILD_DIRECTORY="!NORMEDPATH!\!bibase!"
call :normalize_path !-install!
set INSTALL_DIRECTORY=!NORMEDPATH!\!bibase!

echo BUILD_TYPE !BUILD_TYPE!
echo BUILD_SHARED_LIBS !BUILD_SHARED_LIBS!
Expand Down Expand Up @@ -182,3 +184,8 @@ if %errorlevel% neq 0 (
) else (
exit /b 0
)

:normalize_path
set NORMEDPATH=%~f1
exit /b

0 comments on commit c858a7a

Please sign in to comment.