build_mamba.bat 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. @echo ON
  2. :: cmd
  3. echo "Building %PKG_NAME%."
  4. if /I "%PKG_NAME%" == "mamba" (
  5. cd mamba
  6. %PYTHON% -m pip install . --no-deps -vv
  7. exit 0
  8. )
  9. rmdir /Q /S build
  10. mkdir build
  11. cd build
  12. if errorlevel 1 exit /b 1
  13. set "CXXFLAGS=%CXXFLAGS% /D_LIBCPP_DISABLE_AVAILABILITY=1"
  14. :: Generate the build files.
  15. echo "Generating the build files..."
  16. if /I "%PKG_NAME%" == "libmamba" (
  17. cmake .. ^
  18. %CMAKE_ARGS% ^
  19. -GNinja ^
  20. -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
  21. -DCMAKE_PREFIX_PATH=%PREFIX% ^
  22. -DCMAKE_BUILD_TYPE=Release ^
  23. -DBUILD_LIBMAMBA=ON ^
  24. -DBUILD_SHARED=ON ^
  25. -DBUILD_MAMBA_PACKAGE=ON
  26. )
  27. if /I "%PKG_NAME%" == "libmambapy" (
  28. cmake .. ^
  29. %CMAKE_ARGS% ^
  30. -GNinja ^
  31. -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
  32. -DCMAKE_PREFIX_PATH=%PREFIX% ^
  33. -DCMAKE_BUILD_TYPE=Release ^
  34. -DPython_EXECUTABLE=%PYTHON% ^
  35. -DBUILD_LIBMAMBAPY=ON
  36. )
  37. if errorlevel 1 exit /b 1
  38. :: Build.
  39. echo "Building..."
  40. ninja
  41. if errorlevel 1 exit /b 1
  42. :: Install.
  43. echo "Installing..."
  44. ninja install
  45. if errorlevel 1 exit /b 1
  46. if /I "%PKG_NAME%" == "libmambapy" (
  47. cd ../libmambapy
  48. rmdir /Q /S build
  49. %PYTHON% -m pip install . --no-deps -vv
  50. del *.pyc /a /s
  51. )
  52. :: Error free exit.
  53. echo "Error free exit!"
  54. exit 0