buildJNI 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. #replace the path below with your ndk-dir
  3. #NDK=/Users/wangyang/android_dev/android-ndk
  4. if [[ "$NDK" == "" ]]; then
  5. echo "Please specify the NDK variable to your ndk-dir"
  6. exit
  7. fi
  8. cd $(dirname $0)
  9. for i in $*
  10. do
  11. if [ "${i}" == "-r" ] || [ "${i}" == "--release" ]; then
  12. export CGE_RELEASE_MODE=1
  13. echo "release mode enabled!"
  14. fi
  15. if [ "${i}" == "-d" ] || [ "${i}" == "--debug" ]; then
  16. export CGE_DEBUG_MODE=1
  17. echo "debug mode enabled!"
  18. fi
  19. if [ "${i}" == "-b" ] || [ "${i}" == "-B" ]; then
  20. BUILD_ARG=-B
  21. echo "force rebuild!"
  22. fi
  23. if [ "${i}" == "--noface" ] || [ "${i}" == "-n" ]; then
  24. NO_FACE=1
  25. echo "disable face module!"
  26. fi
  27. if [ "${i}" == "--leaktest" ] || [ "${i}" == "-lt" ] || [ "${i}" == "--lt" ]; then
  28. export CGE_USE_LEAK_TEST=1
  29. echo "leak test enabled!"
  30. fi
  31. done
  32. if [[ "$NO_FACE" == "" ]]; then
  33. export CGE_USE_FACE_MODULE=1
  34. fi
  35. export CGE_USE_VIDEO_MODULE=1
  36. echo "The NDK dir is: ${NDK}, If the shell can not run normally, you should set the NDK variable to your local ndk-dir"
  37. $NDK/ndk-build ${BUILD_ARG} -j8