summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorBradley Sepos <[email protected]>2020-03-27 18:27:55 -0400
committerBradley Sepos <[email protected]>2020-03-30 08:41:36 -0400
commit2a07135d2408d6f2d3f32594c357a7c8c6f9c729 (patch)
tree5c3370b2b9507d98f44c13d542cfbd1e8c75207c /macosx
parented8b3a3ef263507563d9234efd17ee47e91ebbf8 (diff)
macosx: Pass compiler optimization level to Xcode.
Fixes #2719.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HandBrake.xcodeproj/project.pbxproj16
-rw-r--r--macosx/module.defs8
2 files changed, 16 insertions, 8 deletions
diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj
index 18ff3b458..3510d1f92 100644
--- a/macosx/HandBrake.xcodeproj/project.pbxproj
+++ b/macosx/HandBrake.xcodeproj/project.pbxproj
@@ -2567,11 +2567,12 @@
EXTERNAL_BUILD = "$(CONFIGURATION_BUILD_DIR)/external";
EXTERNAL_DRIVER = xcode;
EXTERNAL_JOBS = auto;
+ EXTERNAL_O = 0;
EXTERNAL_SRC = ..;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_OPTIMIZATION_LEVEL = "$(EXTERNAL_O)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -2651,10 +2652,12 @@
EXTERNAL_BUILD = "$(CONFIGURATION_BUILD_DIR)/external";
EXTERNAL_DRIVER = xcode;
EXTERNAL_JOBS = auto;
+ EXTERNAL_O = s;
EXTERNAL_SRC = ..;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = "$(EXTERNAL_O)";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
@@ -2874,7 +2877,6 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -2940,7 +2942,6 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -3146,7 +3147,6 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -3270,7 +3270,6 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -3389,11 +3388,12 @@
EXTERNAL_BUILD = "$(CONFIGURATION_BUILD_DIR)/external";
EXTERNAL_DRIVER = xcode;
EXTERNAL_JOBS = auto;
+ EXTERNAL_O = 0;
EXTERNAL_SRC = ..;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_OPTIMIZATION_LEVEL = "$(EXTERNAL_O)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -3498,7 +3498,6 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -3561,7 +3560,6 @@
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -3669,10 +3667,12 @@
EXTERNAL_BUILD = "$(CONFIGURATION_BUILD_DIR)/external";
EXTERNAL_DRIVER = xcode;
EXTERNAL_JOBS = auto;
+ EXTERNAL_O = s;
EXTERNAL_SRC = ..;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = "$(EXTERNAL_O)";
GCC_PREPROCESSOR_DEFINITIONS = "__SANDBOX_ENABLED__=1";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
diff --git a/macosx/module.defs b/macosx/module.defs
index cbf537a4c..9d654ede9 100644
--- a/macosx/module.defs
+++ b/macosx/module.defs
@@ -33,6 +33,12 @@ MACOSX.map.g.min = debug
MACOSX.map.g.std = debug
MACOSX.map.g.max = debug
+## mapping from symbolic optimization value to actual level
+MACOSX.map.O.none = 0
+MACOSX.map.O.size = s
+MACOSX.map.O.size-aggressive = z
+MACOSX.map.O.speed = 3
+
## xcconfig: must be one of macosx/xcconfig/*.xcconfig
MACOSX.xcconfig = $(foreach x,$(XCODE.xcconfig),-xcconfig $(MACOSX.src/)xcconfig/$(x))
MACOSX.sdk = $(foreach sdk,$(GCC.sysroot),-sdk $(sdk))
@@ -63,6 +69,7 @@ MACOSX.XCODE = $(strip \
EXTERNAL_DRIVER='$(XCODE.driver)' \
EXTERNAL_GOALS='$(3)' \
EXTERNAL_JOBS='$(MACOSX.JOBS)' \
+ EXTERNAL_O='$(MACOSX.map.O.$(MACOSX.GCC.O))' \
EXTERNAL_VARS='$(-*-command-variables-*-)' \
\
$(MACOSX.extra_cflags) \
@@ -88,6 +95,7 @@ MACOSX.XCODE_ARCHIVE = $(strip \
EXTERNAL_DRIVER='$(XCODE.driver)' \
EXTERNAL_GOALS='$(3)' \
EXTERNAL_JOBS='$(MACOSX.JOBS)' \
+ EXTERNAL_O='$(MACOSX.map.O.$(MACOSX.GCC.O))' \
EXTERNAL_VARS='$(-*-command-variables-*-)' \
\
$(MACOSX.extra_cflags) \