SCsub 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env python
  2. import platform
  3. Import('env')
  4. Import('env_modules')
  5. env_xatlas_unwrap = env_modules.Clone()
  6. # Thirdparty source files
  7. if env['builtin_xatlas']:
  8. thirdparty_dir = "#thirdparty/xatlas/"
  9. thirdparty_sources = [
  10. "xatlas.cpp",
  11. ]
  12. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  13. env_xatlas_unwrap.Append(CPPPATH=[thirdparty_dir])
  14. # upstream uses c++11
  15. if (not env.msvc):
  16. env_xatlas_unwrap.Append(CXXFLAGS="-std=c++11")
  17. if env["platform"] == 'x11':
  18. # if not specifically one of the *BSD, then use LINUX as default
  19. if platform.system() == "FreeBSD":
  20. env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"])
  21. elif platform.system() == "OpenBSD":
  22. env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"])
  23. else:
  24. env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"])
  25. elif env["platform"] == 'osx':
  26. env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"])
  27. elif env["platform"] == 'windows':
  28. if env.msvc:
  29. env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ])
  30. else:
  31. env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"])
  32. env.Append(LIBS=["dbghelp"])
  33. env_thirdparty = env_xatlas_unwrap.Clone()
  34. env_thirdparty.disable_warnings()
  35. env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
  36. # Godot source files
  37. env_xatlas_unwrap.add_source_files(env.modules_sources, "*.cpp")