install_AWSNativeSDK_android.cmd 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. @echo off
  2. REM
  3. REM Copyright (c) Contributors to the Open 3D Engine Project.
  4. REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. REM
  6. REM SPDX-License-Identifier: Apache-2.0 OR MIT
  7. REM
  8. SET BLD_PATH=temp\build
  9. SET SRC_PATH=temp\src
  10. SET INST_PATH=temp\install
  11. SET OUT_BIN_PATH=%TARGET_INSTALL_ROOT%\bin
  12. mkdir %OUT_BIN_PATH%\Debug
  13. mkdir %OUT_BIN_PATH%\Release
  14. SET OUT_INCLUDE_PATH=%TARGET_INSTALL_ROOT%\include
  15. mkdir %OUT_INCLUDE_PATH%
  16. SET OUT_LIB_PATH=%TARGET_INSTALL_ROOT%\lib
  17. mkdir %OUT_LIB_PATH%\Debug\dependencies
  18. mkdir %OUT_LIB_PATH%\Release\dependencies
  19. REM CMake Install Debug and 3rdParty
  20. ECHO "CMake Install Debug Shared to %INST_PATH%"
  21. call cmake --install %BLD_PATH%\Debug_Shared --prefix %INST_PATH% --config Debug
  22. IF %ERRORLEVEL% NEQ 0 (
  23. ECHO "CMake Install Debug Shared to %INST_PATH% failed"
  24. exit /b 1
  25. )
  26. ECHO "CMake Install Debug Static to %INST_PATH%"
  27. call cmake --install %BLD_PATH%\Debug_Static --prefix %INST_PATH% --config Debug
  28. IF %ERRORLEVEL% NEQ 0 (
  29. ECHO "CMake Install Debug Static to %INST_PATH% failed"
  30. exit /b 1
  31. )
  32. call:CopyDynamicAndStaticLibs "Debug"
  33. IF %ERRORLEVEL% NEQ 0 (
  34. exit /b 1
  35. )
  36. REM CMake Install Release and 3rdParty
  37. ECHO "CMake Install Release Shared to %INST_PATH%"
  38. call cmake --install %BLD_PATH%\Release_Shared --prefix %INST_PATH% --config Release
  39. IF %ERRORLEVEL% NEQ 0 (
  40. ECHO "CMake Install Release Shared to %INST_PATH% failed"
  41. exit /b 1
  42. )
  43. ECHO "CMake Install Release Static to %INST_PATH%"
  44. call cmake --install %BLD_PATH%\Release_Static --prefix %INST_PATH% --config Release
  45. IF %ERRORLEVEL% NEQ 0 (
  46. ECHO "CMake Install Release Static to %INST_PATH% failed"
  47. exit /b 1
  48. )
  49. call:CopyDynamicAndStaticLibs "Release"
  50. IF %ERRORLEVEL% NEQ 0 (
  51. exit /b 1
  52. )
  53. REM Copy include headers
  54. ECHO "Copying include headers to %OUT_INCLUDE_PATH%"
  55. Xcopy %INST_PATH%\include\* %OUT_INCLUDE_PATH% /E /Y
  56. IF %ERRORLEVEL% NEQ 0 (
  57. ECHO "Copying include headers to %OUT_INCLUDE_PATH% failed"
  58. exit /b 1
  59. )
  60. REM Copy license
  61. ECHO "Copying LICENSE.TXT to %TARGET_INSTALL_ROOT%"
  62. copy /Y %SRC_PATH%\LICENSE.TXT %TARGET_INSTALL_ROOT%
  63. IF %ERRORLEVEL% NEQ 0 (
  64. ECHO "Copying LICENSE.TXT to %TARGET_INSTALL_ROOT% failed"
  65. exit /b 1
  66. )
  67. ECHO "Custom Install for AWSNativeSDK finished successfully"
  68. exit /b 0
  69. :CopyDynamicAndStaticLibs
  70. SET BUILD_TYPE=%~1
  71. ECHO "Copying shared .so to %OUT_BIN_PATH%\%BUILD_TYPE%"
  72. copy /Y %INST_PATH%\lib\%BUILD_TYPE%_Shared\*.so %OUT_BIN_PATH%\%BUILD_TYPE%\
  73. IF %ERRORLEVEL% NEQ 0 (
  74. ECHO "Copying shared .so to %OUT_BIN_PATH%\%BUILD_TYPE% failed"
  75. exit /b 1
  76. )
  77. ECHO "Copying static .a to %OUT_LIB_PATH%\%BUILD_TYPE%"
  78. copy /Y %INST_PATH%\lib\%BUILD_TYPE%_Static\*.a %OUT_LIB_PATH%\%BUILD_TYPE%\
  79. IF %ERRORLEVEL% NEQ 0 (
  80. ECHO "Copying static .a to %OUT_LIB_PATH%\%BUILD_TYPE% failed"
  81. exit /b 1
  82. )
  83. ECHO "Copying curl static .a to %OUT_LIB_PATH%\%BUILD_TYPE%\dependencies"
  84. copy /Y %BLD_PATH%\%BUILD_TYPE%_Static\external-install\curl\lib\*.a %OUT_LIB_PATH%\%BUILD_TYPE%\dependencies\
  85. IF %ERRORLEVEL% NEQ 0 (
  86. ECHO "Copying 3rdParty static .a to %OUT_LIB_PATH%\%BUILD_TYPE%\dependencies failed"
  87. exit /b 1
  88. )
  89. GOTO:EOF