summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNomis101 <[email protected]>2020-01-15 02:09:26 +0100
committerBradley Sepos <[email protected]>2020-01-16 21:31:45 -0500
commit2a64670a88521b33fcad02b8ab5752a7d0c60e0c (patch)
tree38a8ac525899237f87630d8b26b5d8e578708419
parentbcbba45e498428ada540fa52482c5c497407d6eb (diff)
contrib: Allow optimizing x265 with -Oz via --optimize=size-aggressive.
Additionally reduces file size 4.5%.
-rw-r--r--contrib/x265_10bit/module.defs14
-rw-r--r--contrib/x265_12bit/module.defs14
-rw-r--r--contrib/x265_8bit/module.defs14
3 files changed, 33 insertions, 9 deletions
diff --git a/contrib/x265_10bit/module.defs b/contrib/x265_10bit/module.defs
index b172587e6..6f1f0c103 100644
--- a/contrib/x265_10bit/module.defs
+++ b/contrib/x265_10bit/module.defs
@@ -23,10 +23,18 @@ ifneq (1,$(FEATURE.numa))
X265_10.CONFIGURE.extra += -DENABLE_LIBNUMA=OFF
endif
-ifneq (none,$(X265_10.GCC.g))
- X265_10.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Debug
+ifeq (size-aggressive,$(GCC.O))
+ X265_10.CONFIGURE.extra += -DCMAKE_CXX_FLAGS_MINSIZEREL="-Oz -DNDEBUG" -DCMAKE_C_FLAGS_MINSIZEREL="-Oz -DNDEBUG"
+endif
+
+ifeq ($(GCC.O),$(filter $(GCC.O),size size-aggressive))
+ X265_10.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=MinSizeRel
else
- X265_10.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Release
+ ifneq (none,$(X265_10.GCC.g))
+ X265_10.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Debug
+ else
+ X265_10.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Release
+ endif
endif
ifeq (1,$(HOST.cross))
diff --git a/contrib/x265_12bit/module.defs b/contrib/x265_12bit/module.defs
index 4919ccba9..cfc62e679 100644
--- a/contrib/x265_12bit/module.defs
+++ b/contrib/x265_12bit/module.defs
@@ -23,10 +23,18 @@ ifneq (1,$(FEATURE.numa))
X265_12.CONFIGURE.extra += -DENABLE_LIBNUMA=OFF
endif
-ifneq (none,$(X265_12.GCC.g))
- X265_12.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Debug
+ifeq (size-aggressive,$(GCC.O))
+ X265_12.CONFIGURE.extra += -DCMAKE_CXX_FLAGS_MINSIZEREL="-Oz -DNDEBUG" -DCMAKE_C_FLAGS_MINSIZEREL="-Oz -DNDEBUG"
+endif
+
+ifeq ($(GCC.O),$(filter $(GCC.O),size size-aggressive))
+ X265_12.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=MinSizeRel
else
- X265_12.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Release
+ ifneq (none,$(X265_12.GCC.g))
+ X265_12.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Debug
+ else
+ X265_12.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Release
+ endif
endif
ifeq (1,$(HOST.cross))
diff --git a/contrib/x265_8bit/module.defs b/contrib/x265_8bit/module.defs
index 743d54250..efe77cbe4 100644
--- a/contrib/x265_8bit/module.defs
+++ b/contrib/x265_8bit/module.defs
@@ -20,10 +20,18 @@ ifneq (1,$(FEATURE.numa))
X265_8.CONFIGURE.extra += -DENABLE_LIBNUMA=OFF
endif
-ifneq (none,$(X265_8.GCC.g))
- X265_8.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Debug
+ifeq (size-aggressive,$(GCC.O))
+ X265_8.CONFIGURE.extra += -DCMAKE_CXX_FLAGS_MINSIZEREL="-Oz -DNDEBUG" -DCMAKE_C_FLAGS_MINSIZEREL="-Oz -DNDEBUG"
+endif
+
+ifeq ($(GCC.O),$(filter $(GCC.O),size size-aggressive))
+ X265_8.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=MinSizeRel
else
- X265_8.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Release
+ ifneq (none,$(X265_8.GCC.g))
+ X265_8.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Debug
+ else
+ X265_8.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Release
+ endif
endif
ifeq (1,$(HOST.cross))