MakeSwigWithExtras.bat 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. @echo off
  2. SetLocal EnableDelayedExpansion
  3. set sourceDir=%1
  4. CALL :dequote sourceDir
  5. if "%sourceDir%"=="" goto :NOVARS
  6. echo Performing Swig build
  7. set swigPath=%2
  8. CALL :dequote swigPath
  9. if "%swigPath%"=="" goto :SKIPADDSLASH
  10. if "%swigPath:~-1%"=="\" goto :SKIPADDSLASH
  11. SET swigPath=%swigPath%\
  12. :SKIPADDSLASH
  13. del /F /Q SwigOutput\SwigCSharpOutput\*
  14. set option=%4
  15. CALL :dequote option
  16. set dependentDir=%3
  17. CALL :dequote dependentDir
  18. if "%option%"=="MYSQL_AUTOPATCHER" goto :MYSQLAUTOPATCHER
  19. echo Unsupported option
  20. GOTO END
  21. :MYSQLAUTOPATCHER
  22. %swigPath%swig -c++ -csharp -namespace RakNet -I"%1" -I"SwigInterfaceFiles" -I"%3" -DSWIG_ADDITIONAL_AUTOPATCHER_MYSQL -outdir SwigOutput\SwigCSharpOutput -o SwigOutput\CplusDLLIncludes\RakNet_wrap.cxx SwigInterfaceFiles\RakNet.i
  23. :ENDSWIG
  24. if errorlevel 1 GOTO :SWIGERROR
  25. echo Swig build complete
  26. GOTO END
  27. :NOVARS
  28. echo Invalid number of parameters, Usage: MakeSwigWithExtras.bat ^<Directory^> ^<Swig location or ""^> ^<Dependent Extensions Path^> ^<Option1 Example: MYSQL_AUTOPATCHER^>
  29. PAUSE
  30. GOTO END
  31. :SWIGERROR
  32. echo Swig had an error during build
  33. :END
  34. GOTO FILEEND
  35. :DeQuote
  36. SET _DeQuoteVar=%1
  37. CALL SET _DeQuoteString=%%!_DeQuoteVar!%%
  38. IF [!_DeQuoteString:~0^,1!]==[^"] (
  39. IF [!_DeQuoteString:~-1!]==[^"] (
  40. SET _DeQuoteString=!_DeQuoteString:~1,-1!
  41. ) ELSE (GOTO :EOF)
  42. ) ELSE (GOTO :EOF)
  43. SET !_DeQuoteVar!=!_DeQuoteString!
  44. SET _DeQuoteVar=
  45. SET _DeQuoteString=
  46. GOTO :EOF
  47. :FILEEND
粤ICP备19079148号