build_assimp_unix_like.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. #! /bin/bash
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. #
  9. # -Wno-error, turning off warnings as errors because Assimp uses TinyUSDZ for USD support which has compiler warnings.
  10. cmake_base_command="cmake -S temp/src -B temp/src temp/src/CMakeLists.txt -DCMAKE_BUILD_TYPE=Release -DCMAKE_MODULE_PATH=\"$DOWNLOADED_PACKAGE_FOLDERS\" -DASSIMP_BUILD_ZLIB=OFF -DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_HUNTER_ENABLED=OFF -DASSIMP_BUILD_USD_IMPORTER=ON -DASSIMP_WARNINGS_AS_ERRORS=OFF -DASSIMP_BUILD_TESTS=ON -DCMAKE_CXX_FLAGS=\"-Wno-unused-const-variable -Wno-error\""
  11. # On Mac, load the toolchain file to make sure
  12. # the build matches compatibility with other Mac libraries
  13. if [ "$(uname)" = "Darwin" ];
  14. then
  15. echo "Loading Darwin toolchain file"
  16. cmake_base_command+=" -DCMAKE_TOOLCHAIN_FILE=$PWD/../../Scripts/cmake/Platform/Mac/Toolchain_mac.cmake"
  17. fi
  18. cmake_no_shared_libs="$cmake_base_command -DBUILD_SHARED_LIBS=OFF"
  19. cmake_shared_libs="$cmake_base_command -DBUILD_SHARED_LIBS=ON"
  20. echo "Running first cmake command:"
  21. echo "$cmake_no_shared_libs"
  22. eval "$cmake_no_shared_libs" || exit 1
  23. cmake --build temp/src --config release || exit 1
  24. echo "Running second cmake command:"
  25. echo "$cmake_shared_libs"
  26. eval "$cmake_shared_libs" || exit 1
  27. cmake --build temp/src --config release || exit 1