Skip to content

Commit

Permalink
contrib: Allow optimizing x265 with -Oz via --optimize=size-aggressive.
Browse files Browse the repository at this point in the history
Additionally reduces file size 4.5%.
  • Loading branch information
Nomis101 authored and bradleysepos committed Jan 17, 2020
1 parent bcbba45 commit 2a64670
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
14 changes: 11 additions & 3 deletions contrib/x265_10bit/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
14 changes: 11 additions & 3 deletions contrib/x265_12bit/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
14 changes: 11 additions & 3 deletions contrib/x265_8bit/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2a64670

Please sign in to comment.