2016-10-10 22:02:01 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
import lutin.debug as debug
|
|
|
|
import lutin.tools as tools
|
|
|
|
import os
|
|
|
|
|
|
|
|
import lutinLib_ffmpegCommon
|
|
|
|
|
|
|
|
def add_generate_path(target, my_module):
|
|
|
|
generated_path = os.path.join("generated", target.get_name())
|
|
|
|
generated_path_bs = os.path.join("generated", target.get_name() + "_" + str(target.get_bus_size()))
|
|
|
|
if os.path.exists(os.path.join(os.path.dirname(__file__), generated_path_bs)) == True:
|
|
|
|
my_module.add_path(generated_path_bs)
|
|
|
|
elif os.path.exists(os.path.join(os.path.dirname(__file__), generated_path)) == True:
|
|
|
|
my_module.add_path(generated_path)
|
|
|
|
else:
|
|
|
|
debug.warning("get default Path for type: " + str(target.get_type()))
|
|
|
|
my_module.add_path("generated/Linux")
|
|
|
|
|
|
|
|
|
|
|
|
def add_common_property(target, my_module):
|
|
|
|
add_generate_path(target, my_module)
|
|
|
|
|
2016-10-11 21:14:19 +02:00
|
|
|
|
2016-10-10 22:02:01 +02:00
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-D_ISOC99_SOURCE",
|
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
|
|
|
"-D_LARGEFILE_SOURCE",
|
|
|
|
"-D_POSIX_C_SOURCE=200112",
|
2016-10-11 21:14:19 +02:00
|
|
|
"-D_DARWIN_C_SOURCE",
|
2016-10-10 22:02:01 +02:00
|
|
|
"-D_XOPEN_SOURCE=600",
|
|
|
|
"-DHAVE_AV_CONFIG_H",
|
|
|
|
])
|
|
|
|
if "Linux" in target.get_type():
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-DZLIB_CONST",
|
|
|
|
"-D_GNU_SOURCE=1",
|
|
|
|
"-D_REENTRANT",
|
|
|
|
"-DPIC"
|
|
|
|
])
|
2016-10-13 21:42:54 +02:00
|
|
|
elif "MacOs" in target.get_type():
|
2016-10-11 21:14:19 +02:00
|
|
|
my_module.add_depend([
|
|
|
|
"QuartzCore",
|
|
|
|
"AppKit",
|
|
|
|
"opengl",
|
|
|
|
"CoreVideo",
|
|
|
|
"AVFoundation",
|
|
|
|
"CoreMedia",
|
|
|
|
"VideoDecodeAcceleration",
|
|
|
|
"CoreGraphics",
|
|
|
|
"CoreServices",
|
|
|
|
])
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-DZLIB_CONST",
|
|
|
|
"-D_REENTRANT",
|
|
|
|
"-DPIC"
|
|
|
|
])
|
2016-10-10 22:02:01 +02:00
|
|
|
elif "Windows" in target.get_type():
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-U__STRICT_ANSI__",
|
|
|
|
"-D__USE_MINGW_ANSI_STDIO=1",
|
|
|
|
"-D__printf__=__gnu_printf__",
|
|
|
|
])
|
2016-10-11 21:23:32 +02:00
|
|
|
elif "Android" in target.get_type():
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-DANDROID",
|
|
|
|
"-Dstrtod=avpriv_strtod",
|
|
|
|
"-ftree-ter",
|
|
|
|
])
|
|
|
|
if target.get_arm_mode() == "thumb":
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-DCONFIG_THUMB=1",
|
|
|
|
])
|
|
|
|
else:
|
|
|
|
my_module.add_flag('c', [
|
2016-10-11 21:14:19 +02:00
|
|
|
"-DCONFIG_THUMB=0",
|
2016-10-11 21:23:32 +02:00
|
|
|
])
|
2016-10-13 21:42:54 +02:00
|
|
|
elif "---IOs" in target.get_type():
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-DZLIB_CONST",
|
|
|
|
"-D_REENTRANT",
|
|
|
|
"-DPIC"
|
|
|
|
])
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-DANDROID",
|
|
|
|
"-Dstrtod=avpriv_strtod",
|
|
|
|
"-ftree-ter",
|
|
|
|
])
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-DCONFIG_THUMB=0",
|
|
|
|
])
|
2016-10-11 21:23:32 +02:00
|
|
|
|
|
|
|
if target.get_arch() == "arm":
|
|
|
|
# need to force optimisation (compilation error otherwise)
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-O3"
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2016-10-10 22:02:01 +02:00
|
|
|
|
|
|
|
#-I/usr/include/SDL
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-Wdeclaration-after-statement",
|
|
|
|
"-Wall",
|
|
|
|
"-Wdisabled-optimization",
|
|
|
|
"-Wpointer-arith",
|
2016-10-11 21:23:32 +02:00
|
|
|
#"-Wredundant-decls",
|
2016-10-10 22:02:01 +02:00
|
|
|
"-Wwrite-strings",
|
|
|
|
"-Wtype-limits",
|
|
|
|
"-Wundef",
|
|
|
|
"-Wmissing-prototypes",
|
|
|
|
"-Wno-pointer-to-int-cast",
|
|
|
|
"-Wstrict-prototypes",
|
|
|
|
"-Wempty-body",
|
|
|
|
"-Wno-parentheses",
|
|
|
|
"-Wno-switch",
|
|
|
|
"-Wno-format-zero-length",
|
2016-10-11 21:23:32 +02:00
|
|
|
#"-Wno-pointer-sign",
|
|
|
|
#"-Wno-unused-const-variable",
|
2016-10-10 22:02:01 +02:00
|
|
|
"-fno-math-errno",
|
|
|
|
"-fno-signed-zeros",
|
2016-10-11 21:14:19 +02:00
|
|
|
##"-Werror=format-security",
|
2016-10-10 22:02:01 +02:00
|
|
|
"-Werror=implicit-function-declaration",
|
|
|
|
"-Werror=missing-prototypes",
|
|
|
|
"-Werror=return-type",
|
2016-10-11 21:14:19 +02:00
|
|
|
##"-Werror=vla",
|
|
|
|
##"-Wformat",
|
|
|
|
##"-fdiagnostics-color=auto",
|
2016-10-10 22:02:01 +02:00
|
|
|
])
|
2016-10-11 21:14:19 +02:00
|
|
|
|
2016-10-10 22:02:01 +02:00
|
|
|
if "Windows" in target.get_type():
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-fomit-frame-pointer",
|
|
|
|
"-Wno-maybe-uninitialized",
|
|
|
|
])
|
2016-10-11 21:14:19 +02:00
|
|
|
elif "MacOs" in target.get_type() \
|
|
|
|
or "IOs" in target.get_type():
|
|
|
|
my_module.add_flag('c', [
|
|
|
|
"-fomit-frame-pointer",
|
|
|
|
"-Qunused-arguments",
|
|
|
|
])
|
|
|
|
my_module.add_path('ffmpeg/compat/dispatch_semaphore')
|
2016-10-10 22:02:01 +02:00
|
|
|
|
|
|
|
if target.get_compilator() == "clang":
|
|
|
|
my_module.add_flag('c', [ "-Wno-uninitialized"])
|
|
|
|
else:
|
|
|
|
my_module.add_flag('c', [ "-Wno-maybe-uninitialized"])
|
|
|
|
if "Linux" in target.get_type():
|
|
|
|
# TODO: Check the real impact ...
|
2016-10-11 21:14:19 +02:00
|
|
|
my_module.add_flag('link-dynamic', ["-Wl,-Bsymbolic"])
|
|
|
|
|