Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions modules/xcode/tests/test_xcode_project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2461,6 +2461,57 @@
]]
end


function suite.XCBuildConfigurationProject_OnOptimizeOff()
optimize "Off"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end


function suite.XCBuildConfigurationProject_OnOptimizeOn()
optimize "On"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 3;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end


function suite.XCBuildConfigurationProject_OnOptimizeSize()
optimize "Size"
prepare()
Expand Down Expand Up @@ -2511,6 +2562,34 @@
end


function suite.XCBuildConfigurationProject_OnOptimizeFull()
optimize "Full"
prepare()
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
test.capture [[
A14350AC4595EE5E57CE36EC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
GCC_OPTIMIZATION_LEVEL = 3;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
OBJROOT = obj/Debug;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"-ffast-math",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end


function suite.XCBuildConfigurationProject_OnStaticRuntime()
staticruntime "On"
prepare()
Expand Down
4 changes: 2 additions & 2 deletions modules/xcode/xcode_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@
settings['GCC_ENABLE_OBJC_EXCEPTIONS'] = 'NO'
end

local optimizeMap = { On = 3, Size = 's', Speed = 3, Full = 'fast', Debug = 'g' }
local optimizeMap = { On = 3, Size = 's', Speed = 3, Full = 3, Debug = 'g' }
settings['GCC_OPTIMIZATION_LEVEL'] = optimizeMap[cfg.optimize] or 0

if cfg.pchheader and cfg.enablepch ~= p.OFF then
Expand Down Expand Up @@ -1565,7 +1565,7 @@

-- build list of "other" C/C++ flags
local checks = {
["-ffast-math"] = cfg.floatingpoint == "Fast",
["-ffast-math"] = cfg.floatingpoint == "Fast" or cfg.optimize == "Full",
["-fomit-frame-pointer"] = cfg.omitframepointer == "On",
["-fno-omit-frame-pointer"] = cfg.omitframepointer == "Off",
["-fopenmp"] = cfg.openmp == "On"
Expand Down
Loading