Skip to content

Commit

Permalink
Merge pull request #1894 from Jarod42/OpenMPForXcode
Browse files Browse the repository at this point in the history
Fix openmp for xcode.
  • Loading branch information
samsinsane authored Jun 21, 2022
2 parents 9245472 + 71a1db0 commit 1c22240
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
26 changes: 26 additions & 0 deletions modules/xcode/tests/test_xcode_project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2693,6 +2693,32 @@
]]
end

function suite.XCBuildConfigurationProject_OnOpenMP()
openmp "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 = 0;
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 = (
"-fopenmp",
);
SYMROOT = bin/Debug;
};
name = Debug;
};
]]
end

function suite.XCBuildConfigurationProject_OnFloatStrict()
floatingpoint "Strict"
Expand Down
1 change: 1 addition & 0 deletions modules/xcode/xcode_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,7 @@
["-ffast-math"] = cfg.floatingpoint == "Fast",
["-fomit-frame-pointer"] = cfg.omitframepointer == "On",
["-fno-omit-frame-pointer"] = cfg.omitframepointer == "Off",
["-fopenmp"] = cfg.openmp == "On"
}

local flags = { }
Expand Down
2 changes: 1 addition & 1 deletion website/docs/openmp.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Project configurations.
### Availability ###

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

## Examples ##

Expand Down

0 comments on commit 1c22240

Please sign in to comment.