diff options
author | montellese <montellese@xbmc.org> | 2015-01-08 10:49:46 +0100 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2015-01-10 18:40:32 +0100 |
commit | 1d843dc3ff6402e00b498f82bf81225095736a34 (patch) | |
tree | 7b45c6eefdc361a325a012a8e7005f5232e24ba7 /tools | |
parent | 290c59b8a096ea74d7780db42e5923b6fe82469a (diff) |
[win32] update/cleanup build scripts for binary addons
Diffstat (limited to 'tools')
-rw-r--r-- | tools/buildsteps/win32/make-addon-depends.bat | 100 | ||||
-rw-r--r-- | tools/buildsteps/win32/make-addons.bat | 48 |
2 files changed, 17 insertions, 131 deletions
diff --git a/tools/buildsteps/win32/make-addon-depends.bat b/tools/buildsteps/win32/make-addon-depends.bat deleted file mode 100644 index fd4ac3ce4a..0000000000 --- a/tools/buildsteps/win32/make-addon-depends.bat +++ /dev/null @@ -1,100 +0,0 @@ -@ECHO OFF - -SETLOCAL - -SET EXITCODE=0 - -SET noclean=false -SET dependency= -FOR %%b in (%1, %2) DO ( - IF %%b == noclean ( - SET noclean=true - ) ELSE ( IF %%b == clean ( - SET noclean=false - ) ELSE ( - SET dependency=%%b - )) -) - -rem set Visual C++ build environment -call "%VS120COMNTOOLS%..\..\VC\bin\vcvars32.bat" - -SET WORKDIR=%WORKSPACE% - -IF "%WORKDIR%" == "" ( - SET WORKDIR=%CD%\..\..\.. -) - -rem setup some paths that we need later -SET CUR_PATH=%CD% - -SET BASE_PATH=%WORKDIR%\project\cmake\ -SET SCRIPTS_PATH=%BASE_PATH%\scripts\windows -SET ADDONS_PATH=%BASE_PATH%\addons -SET ADDONS_OUTPUT_PATH=%ADDONS_PATH%\output -SET ADDON_DEPENDS_PATH=%ADDONS_PATH%\depends -SET ADDON_DEPENDS_BUILD_PATH=%ADDON_DEPENDS_PATH%\build - -SET ERRORFILE=%BASE_PATH%\make-addon-depends.error - -IF %noclean% == false ( - rem remove the output directory if it exists - IF EXIST "%ADDONS_OUTPUT_PATH%" ( - RMDIR "%ADDONS_OUTPUT_PATH%" /S /Q > NUL - ) - - rem remove the build directory if it exists - IF EXIST "%ADDON_DEPENDS_BUILD_PATH%" ( - RMDIR "%ADDON_DEPENDS_BUILD_PATH%" /S /Q > NUL - ) -) - -rem create the output directory -IF NOT EXIST "%ADDONS_OUTPUT_PATH%" MKDIR "%ADDONS_OUTPUT_PATH%" - -rem create the build directory -IF NOT EXIST "%ADDON_DEPENDS_BUILD_PATH%" MKDIR "%ADDON_DEPENDS_BUILD_PATH%" - -rem go into the build directory -CD "%ADDON_DEPENDS_BUILD_PATH%" - -SET DEPENDS_TO_BUILD="all" -IF "%dependency%" NEQ "" ( - SET DEPENDS_TO_BUILD="%dependency%" -) - -rem execute cmake to generate makefiles processable by nmake -cmake "%ADDON_DEPENDS_PATH%" -G "NMake Makefiles" ^ - -DCMAKE_BUILD_TYPE=Release ^ - -DCMAKE_USER_MAKE_RULES_OVERRIDE="%SCRIPTS_PATH%/c-flag-overrides.cmake" ^ - -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%SCRIPTS_PATH%/cxx-flag-overrides.cmake" ^ ^ - -DCMAKE_INSTALL_PREFIX=%ADDONS_OUTPUT_PATH% ^ - -DARCH_DEFINES="-DTARGET_WINDOWS -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_USE_32BIT_TIME_T -D_WINSOCKAPI_" ^ - -DDEPENDS_TO_BUILD="%DEPENDS_TO_BUILD%" -IF ERRORLEVEL 1 ( - ECHO cmake error level: %ERRORLEVEL% > %ERRORFILE% - GOTO ERROR -) - -rem execute nmake to build the addon depends -nmake %dependency% -IF ERRORLEVEL 1 ( - ECHO nmake error level: %ERRORLEVEL% > %ERRORFILE% - GOTO ERROR -) - -rem everything was fine -GOTO END - -:ERROR -rem something went wrong -ECHO Failed to build addon dependencies -ECHO See %ERRORFILE% for more details -SET EXITCODE=1 - -:END -rem go back to the original directory -cd %CUR_PATH% - -rem exit the script with the defined exitcode -EXIT /B %EXITCODE% diff --git a/tools/buildsteps/win32/make-addons.bat b/tools/buildsteps/win32/make-addons.bat index 48ff14073b..a123b377bb 100644 --- a/tools/buildsteps/win32/make-addons.bat +++ b/tools/buildsteps/win32/make-addons.bat @@ -4,22 +4,17 @@ SETLOCAL SET EXITCODE=0 -SET getdepends=true SET install=false -SET noclean=false +SET clean=false SET addon= FOR %%b in (%1, %2, %3, %4) DO ( - IF %%b == nodepends ( - SET getdepends=false - ) ELSE ( IF %%b == install ( + IF %%b == install ( SET install=true - ) ELSE ( IF %%b == noclean ( - SET noclean=true ) ELSE ( IF %%b == clean ( - SET noclean=false + SET clean=true ) ELSE ( SET addon=%%b - )))) + )) ) rem set Visual C++ build environment @@ -41,33 +36,23 @@ SET ADDONS_BUILD_PATH=%ADDONS_PATH%\build SET ERRORFILE=%BASE_PATH%\make-addons.error -rem determine whether make-addon-depends.bat should be called with noclean or not -SET addon_depends_mode=clean -IF %noclean% == true ( - SET addon_depends_mode=noclean -) - -IF %getdepends% == true ( - ECHO -------------------------------------------------- - ECHO Building addon dependencies - ECHO -------------------------------------------------- - - CALL make-addon-depends.bat %addon_depends_mode% - IF ERRORLEVEL 1 ( - ECHO make-addon-depends error level: %ERRORLEVEL% > %ERRORFILE% - GOTO ERROR - ) - - ECHO. -) - -IF %noclean% == false ( +IF %clean% == true ( rem remove the build directory if it exists IF EXIST "%ADDONS_BUILD_PATH%" ( RMDIR "%ADDONS_BUILD_PATH%" /S /Q > NUL ) + + rem remove the build directory if it exists + IF EXIST "%ADDON_DEPENDS_PATH%" ( + RMDIR "%ADDON_DEPENDS_PATH%" /S /Q > NUL + ) + + GOTO END ) +rem create the depends directory +IF NOT EXIST "%ADDON_DEPENDS_PATH%" MKDIR "%ADDON_DEPENDS_PATH%" + rem create the build directory IF NOT EXIST "%ADDONS_BUILD_PATH%" MKDIR "%ADDONS_BUILD_PATH%" @@ -97,7 +82,8 @@ cmake "%ADDONS_PATH%" -G "NMake Makefiles" ^ -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%SCRIPTS_PATH%/cxx-flag-overrides.cmake" ^ -DCMAKE_INSTALL_PREFIX=%ADDONS_INSTALL_PATH% ^ -DAPP_ROOT=%WORKDIR% ^ - -DCMAKE_PREFIX_PATH=%ADDON_DEPENDS_PATH% ^ + -DBUILD_DIR=%ADDONS_BUILD_PATH% ^ + -DDEPENDS_PATH=%ADDON_DEPENDS_PATH% ^ -DPACKAGE_ZIP=1 ^ -DARCH_DEFINES="-DTARGET_WINDOWS -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_USE_32BIT_TIME_T -D_WINSOCKAPI_" ^ -DADDONS_TO_BUILD="%ADDONS_TO_BUILD%" |