summaryrefslogtreecommitdiff
path: root/drivers/png/SCsub
blob: ea2324c0cfdfea053c4b6c774c5456ad599b5cc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Import('env')
Import('env_drivers')

# Thirdparty source files

if (env["libpng"] == "builtin"):
	thirdparty_dir = "#thirdparty/libpng/"
	thirdparty_png_sources = [
		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",
	]

	# 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":
		env_drivers.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=2"])
		env_neon = env_drivers.Clone();
		if "S_compiler" in env:
			env_neon['CC'] = env['S_compiler']
		#env_neon.Append(CPPFLAGS=["-DPNG_ARM_NEON"])
		thirdparty_png_sources.append(env_neon.Object(thirdparty_dir + "/arm/arm_init.c"))
		thirdparty_png_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S"))
	else:
		env_drivers.Append(CPPFLAGS=["-DPNG_ARM_NEON_OPT=0"])

	#env_drivers.add_source_files(env.drivers_sources, thirdparty_png_sources)
	env.drivers_sources += thirdparty_png_sources # Concatenation necessary for neon objects it seems?
	env_drivers.Append(CPPPATH = [thirdparty_dir])


# Godot's own source files

env_drivers.add_source_files(env.drivers_sources, "*.cpp")

Export('env_drivers')
Export('env')