build.config.py 755 B

123456789101112131415161718192021222324252627282930
  1. import os
  2. cflags = [ "-Wall", "-O3", "-g", "-DLUA_USE_POPEN" ]
  3. lflags = [ "-lSDL2", "-lm" ]
  4. include = [ "src" ]
  5. output = "lite"
  6. if "sanitize" in opt:
  7. log("address sanitizer enabled")
  8. cflags += [ "-fsanitize=address" ]
  9. lflags += [ "-fsanitize=address" ]
  10. if "windows" in opt:
  11. compiler = "x86_64-w64-mingw32-gcc"
  12. output += ".exe"
  13. cflags += [ "-Iwinlib/SDL2-2.0.10/x86_64-w64-mingw32/include" ]
  14. lflags += [ "-Lwinlib/SDL2-2.0.10/x86_64-w64-mingw32/lib" ]
  15. lflags = [ "-lmingw32", "-lSDL2main" ] + lflags
  16. lflags += [ "-lwinmm" ]
  17. lflags += [ "-mwindows" ]
  18. lflags += [ "res.res" ]
  19. def pre():
  20. os.system("x86_64-w64-mingw32-windres res.rc -O coff -o res.res")
  21. def post():
  22. os.remove("res.res")