My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

simulator.py 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # PlatformIO pre: script for simulator builds
  3. #
  4. # Get the environment thus far for the build
  5. Import("env")
  6. #print(env.Dump())
  7. #
  8. # Give the binary a distinctive name
  9. #
  10. env['PROGNAME'] = "MarlinSimulator"
  11. #
  12. # If Xcode is installed add the path to its Frameworks folder,
  13. # or if Mesa is installed try to use its GL/gl.h.
  14. #
  15. import sys
  16. if sys.platform == 'darwin':
  17. #
  18. # Silence half of the ranlib warnings. (No equivalent for 'ARFLAGS')
  19. #
  20. env['RANLIBFLAGS'] += [ "-no_warning_for_no_symbols" ]
  21. # Default paths for Xcode and a lucky GL/gl.h dropped by Mesa
  22. xcode_path = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
  23. mesa_path = "/opt/local/include/GL/gl.h"
  24. import os.path
  25. if os.path.exists(xcode_path):
  26. env['BUILD_FLAGS'] += [ "-F" + xcode_path ]
  27. print("Using OpenGL framework headers from Xcode.app")
  28. elif os.path.exists(mesa_path):
  29. env['BUILD_FLAGS'] += [ '-D__MESA__' ]
  30. print("Using OpenGL header from", mesa_path)
  31. else:
  32. print("\n\nNo OpenGL headers found. Install Xcode for matching headers, or use 'sudo port install mesa' to get a GL/gl.h.\n\n")
  33. # Break out of the PIO build immediately
  34. sys.exit(1)
  35. env.AddCustomTarget("upload", "$BUILD_DIR/${PROGNAME}", "$BUILD_DIR/${PROGNAME}")