build.bat 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. @echo off
  2. setlocal EnableDelayedExpansion
  3. set argc=0
  4. set valid="no"
  5. for %%a in (%*) do (
  6. set /A argc+=1
  7. if /I "%%a"=="help" (
  8. call:usage
  9. goto:eof
  10. )
  11. if /I "%%a"=="all" set valid="yes"
  12. if /I "%%a"=="release" set valid="yes"
  13. if /I "%%a"=="debug" set valid="yes"
  14. if /I "%%a"=="clean" set valid="yes"
  15. if !valid!=="no" (
  16. echo Invalid option: %%a
  17. call:usage
  18. goto:eof
  19. )
  20. )
  21. if %argc%==0 echo Building schedule: all
  22. if not %argc%==0 echo Building schedule: %*
  23. echo Starting in 3 seconds...
  24. ping 1.1.1.1 -n 1 -w 3000 > nul
  25. rem sleep 3 ::This function makes command line DOS-esque C:\Archiv~1
  26. if %argc%==0 (call:all)
  27. for %%a in (%*) do (call:%%a)
  28. goto:eof
  29. :debug
  30. echo.
  31. echo.
  32. echo ****************************************
  33. echo STARTING: debug
  34. if not exist debug mkdir debug
  35. cd debug
  36. cmake .. -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DFL_BACKTRACE=ON -DFL_USE_FLOAT=OFF -DFL_CPP11=OFF
  37. nmake
  38. cd ..
  39. echo.
  40. echo FINISHED: debug
  41. echo ****************************************
  42. goto:eof
  43. :release
  44. echo.
  45. echo.
  46. echo ****************************************
  47. echo STARTING: release
  48. if not exist release mkdir release
  49. cd release
  50. cmake .. -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DFL_BACKTRACE=OFF -DFL_USE_FLOAT=OFF -DFL_CPP11=OFF
  51. nmake
  52. cd ..
  53. echo.
  54. echo FINISHED: release
  55. echo ****************************************
  56. goto:eof
  57. :all
  58. echo.
  59. echo.
  60. echo ****************************************
  61. echo STARTING: all
  62. call:debug
  63. call:release
  64. echo.
  65. echo FINISHED: all
  66. echo ****************************************
  67. goto:eof
  68. :clean
  69. echo.
  70. echo.
  71. echo ****************************************
  72. echo STARTING: clean
  73. if exist debug rmdir /S /Q debug
  74. if exist release rmdir /S /Q release
  75. echo.
  76. echo FINISHED: clean
  77. echo ****************************************
  78. goto:eof
  79. :usage
  80. echo Usage: build.bat [options]
  81. echo where [options] can be any of the following:
  82. echo ^ all builds fuzzylite in debug and release mode (default)
  83. echo ^ debug builds fuzzylite in debug mode
  84. echo ^ release builds fuzzylite in release mode
  85. echo ^ clean erases previous builds
  86. echo ^ help shows this information
  87. echo.
  88. ENDLOCAL