SCsub 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/usr/bin/env python
  2. import platform
  3. Import('env')
  4. Import('env_modules')
  5. env_thekla_unwrap = env_modules.Clone()
  6. # Thirdparty source files
  7. if env['builtin_thekla_atlas']:
  8. thirdparty_dir = "#thirdparty/thekla_atlas/"
  9. thirdparty_sources = [
  10. "nvcore/Memory.cpp",
  11. "nvcore/Debug.cpp",
  12. "nvcore/StrLib.cpp",
  13. "nvcore/FileSystem.cpp",
  14. "nvcore/RadixSort.cpp",
  15. "nvmath/Basis.cpp",
  16. "nvmath/ConvexHull.cpp",
  17. "nvmath/Fitting.cpp",
  18. "nvmath/Plane.cpp",
  19. "nvmath/ProximityGrid.cpp",
  20. "nvmath/Random.cpp",
  21. "nvmath/Solver.cpp",
  22. "nvmath/Sparse.cpp",
  23. "nvmath/TypeSerialization.cpp",
  24. "poshlib/posh.c",
  25. "nvimage/BitMap.cpp",
  26. "nvimage/Image.cpp",
  27. "nvmesh/BaseMesh.cpp",
  28. "nvmesh/MeshBuilder.cpp",
  29. "nvmesh/TriMesh.cpp",
  30. "nvmesh/QuadTriMesh.cpp",
  31. "nvmesh/MeshTopology.cpp",
  32. "nvmesh/halfedge/Edge.cpp",
  33. "nvmesh/halfedge/Mesh.cpp",
  34. "nvmesh/halfedge/Face.cpp",
  35. "nvmesh/halfedge/Vertex.cpp",
  36. "nvmesh/geometry/Bounds.cpp",
  37. "nvmesh/geometry/Measurements.cpp",
  38. "nvmesh/raster/Raster.cpp",
  39. "nvmesh/param/Atlas.cpp",
  40. "nvmesh/param/AtlasBuilder.cpp",
  41. "nvmesh/param/AtlasPacker.cpp",
  42. "nvmesh/param/LeastSquaresConformalMap.cpp",
  43. "nvmesh/param/OrthogonalProjectionMap.cpp",
  44. "nvmesh/param/ParameterizationQuality.cpp",
  45. "nvmesh/param/SingleFaceMap.cpp",
  46. "nvmesh/param/Util.cpp",
  47. "nvmesh/weld/VertexWeld.cpp",
  48. "nvmesh/weld/Snap.cpp",
  49. "thekla/thekla_atlas.cpp"
  50. ]
  51. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  52. env_thekla_unwrap.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "poshlib", thirdparty_dir + "nvcore", thirdparty_dir + "nvmesh"])
  53. # upstream uses c++11
  54. if (not env.msvc):
  55. env_thekla_unwrap.Append(CXXFLAGS="-std=c++11")
  56. if env["platform"] == 'x11':
  57. # if not specifically one of the *BSD, then use LINUX as default
  58. if platform.system() == "FreeBSD":
  59. env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"])
  60. elif platform.system() == "OpenBSD":
  61. env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"])
  62. else:
  63. env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"])
  64. elif env["platform"] == 'osx':
  65. env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"])
  66. elif env["platform"] == 'windows':
  67. if env.msvc:
  68. env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ])
  69. else:
  70. env_thekla_unwrap.Append(CCFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"])
  71. env.Append(LIBS=["dbghelp"])
  72. env_thirdparty = env_thekla_unwrap.Clone()
  73. env_thirdparty.disable_warnings()
  74. env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
  75. # Godot source files
  76. env_thekla_unwrap.add_source_files(env.modules_sources, "*.cpp")