Skip to content

Commit 1c22240

Browse files
authored
Merge pull request premake#1894 from Jarod42/OpenMPForXcode
Fix openmp for xcode.
2 parents 9245472 + 71a1db0 commit 1c22240

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

modules/xcode/tests/test_xcode_project.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,6 +2693,32 @@
26932693
]]
26942694
end
26952695

2696+
function suite.XCBuildConfigurationProject_OnOpenMP()
2697+
openmp "On"
2698+
prepare()
2699+
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
2700+
test.capture [[
2701+
A14350AC4595EE5E57CE36EC /* Debug */ = {
2702+
isa = XCBuildConfiguration;
2703+
buildSettings = {
2704+
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
2705+
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
2706+
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
2707+
GCC_OPTIMIZATION_LEVEL = 0;
2708+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
2709+
GCC_WARN_ABOUT_RETURN_TYPE = YES;
2710+
GCC_WARN_UNUSED_VARIABLE = YES;
2711+
OBJROOT = obj/Debug;
2712+
ONLY_ACTIVE_ARCH = NO;
2713+
OTHER_CFLAGS = (
2714+
"-fopenmp",
2715+
);
2716+
SYMROOT = bin/Debug;
2717+
};
2718+
name = Debug;
2719+
};
2720+
]]
2721+
end
26962722

26972723
function suite.XCBuildConfigurationProject_OnFloatStrict()
26982724
floatingpoint "Strict"

modules/xcode/xcode_common.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,7 @@
15561556
["-ffast-math"] = cfg.floatingpoint == "Fast",
15571557
["-fomit-frame-pointer"] = cfg.omitframepointer == "On",
15581558
["-fno-omit-frame-pointer"] = cfg.omitframepointer == "Off",
1559+
["-fopenmp"] = cfg.openmp == "On"
15591560
}
15601561

15611562
local flags = { }

website/docs/openmp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Project configurations.
2121
### Availability ###
2222

2323
Premake 5.0-beta1 or later for Visual Studio 2010+ and the MSC toolset.
24-
Premake 5.0-beta2 or later for the GCC and Clang toolsets.
24+
Premake 5.0-beta2 or later for the GCC and Clang toolsets and for xcode.
2525

2626
## Examples ##
2727

0 commit comments

Comments
 (0)