Fork of the espurna firmware for `mhsw` switches
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.

24 lines
893 B

  1. import os
  2. def ldscripts_inject_libpath(env):
  3. platform = env.PioPlatform()
  4. framework_dir = platform.get_package_dir("framework-arduinoespressif8266")
  5. # espressif8266@1.5.0 did not append this directory into the LIBPATH
  6. libpath_sdk = os.path.join(framework_dir, "tools", "sdk", "ld")
  7. env.Append(LIBPATH=[libpath_sdk])
  8. libpath_base = os.path.join("$PROJECT_DIR", "..", "dist", "ld")
  9. env.Append(LIBPATH=[os.path.join(libpath_base, "pre_2.5.0")])
  10. # local.eagle.app.v6.common.ld exists only with Core >2.5.0
  11. def check_local_ld(target, source, env):
  12. local_ld = env.subst(
  13. os.path.join("$BUILD_DIR", "ld", "local.eagle.app.v6.common.ld")
  14. )
  15. if os.path.exists(local_ld):
  16. env.Prepend(LIBPATH=[os.path.join(libpath_base, "latest")])
  17. env.AddPreAction(os.path.join("$BUILD_DIR", "firmware.elf"), check_local_ld)