2014-02-10 02:10:30 +01:00
|
|
|
Import('env')
|
|
|
|
|
2016-10-15 12:39:28 +02:00
|
|
|
env_png = env.Clone()
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-10-15 12:39:28 +02:00
|
|
|
# Thirdparty source files
|
2016-10-09 23:36:17 +02:00
|
|
|
if (env["libpng"] == "builtin"):
|
|
|
|
thirdparty_dir = "#thirdparty/libpng/"
|
2016-10-13 18:54:00 +02:00
|
|
|
thirdparty_sources = [
|
2016-10-09 23:36:17 +02:00
|
|
|
thirdparty_dir + "png.c",
|
|
|
|
thirdparty_dir + "pngerror.c",
|
|
|
|
thirdparty_dir + "pngget.c",
|
|
|
|
thirdparty_dir + "pngmem.c",
|
|
|
|
thirdparty_dir + "pngpread.c",
|
|
|
|
thirdparty_dir + "pngread.c",
|
|
|
|
thirdparty_dir + "pngrio.c",
|
|
|
|
thirdparty_dir + "pngrtran.c",
|
|
|
|
thirdparty_dir + "pngrutil.c",
|
|
|
|
thirdparty_dir + "pngset.c",
|
|
|
|
thirdparty_dir + "pngtrans.c",
|
|
|
|
thirdparty_dir + "pngwio.c",
|
|
|
|
thirdparty_dir + "pngwrite.c",
|
|
|
|
thirdparty_dir + "pngwtran.c",
|
|
|
|
thirdparty_dir + "pngwutil.c",
|
|
|
|
]
|
2014-02-10 02:10:30 +01:00
|
|
|
|
2016-10-09 23:36:17 +02:00
|
|
|
# Currently .ASM filter_neon.S does not compile on NT.
|
|
|
|
import os
|
|
|
|
if ("neon_enabled" in env and env["neon_enabled"]) and os.name!="nt":
|
2016-10-15 12:39:28 +02:00
|
|
|
env_png.Append(CPPFLAGS = ["-DPNG_ARM_NEON_OPT=2"])
|
|
|
|
env_neon = env_png.Clone();
|
2016-10-09 23:36:17 +02:00
|
|
|
if "S_compiler" in env:
|
|
|
|
env_neon['CC'] = env['S_compiler']
|
2016-10-15 12:39:28 +02:00
|
|
|
#env_neon.Append(CPPFLAGS = ["-DPNG_ARM_NEON"])
|
2016-10-13 18:54:00 +02:00
|
|
|
thirdparty_sources.append(env_neon.Object(thirdparty_dir + "/arm/arm_init.c"))
|
|
|
|
thirdparty_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S"))
|
2016-10-09 23:36:17 +02:00
|
|
|
else:
|
2016-10-15 12:39:28 +02:00
|
|
|
env_png.Append(CPPFLAGS = ["-DPNG_ARM_NEON_OPT=0"])
|
2016-10-09 23:36:17 +02:00
|
|
|
|
2016-10-15 12:39:28 +02:00
|
|
|
#env_png.add_source_files(env.drivers_sources, thirdparty_sources)
|
2016-10-13 18:54:00 +02:00
|
|
|
env.drivers_sources += thirdparty_sources # Concatenation necessary for neon objects it seems?
|
2016-10-15 12:39:28 +02:00
|
|
|
env_png.Append(CPPPATH = [thirdparty_dir])
|
2016-10-09 23:36:17 +02:00
|
|
|
|
2016-10-15 12:39:28 +02:00
|
|
|
# Godot source files
|
|
|
|
env_png.add_source_files(env.drivers_sources, "*.cpp")
|
2016-10-09 23:36:17 +02:00
|
|
|
|
2014-02-10 02:10:30 +01:00
|
|
|
Export('env')
|