From 71a1db029c259398598f6bf14d5c5355b9b55b94 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Wed, 8 Jun 2022 23:19:33 +0200 Subject: [PATCH] Fix openmp for xcode. --- modules/xcode/tests/test_xcode_project.lua | 26 ++++++++++++++++++++++ modules/xcode/xcode_common.lua | 1 + website/docs/openmp.md | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/modules/xcode/tests/test_xcode_project.lua b/modules/xcode/tests/test_xcode_project.lua index db163058e5..87096e2190 100644 --- a/modules/xcode/tests/test_xcode_project.lua +++ b/modules/xcode/tests/test_xcode_project.lua @@ -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" diff --git a/modules/xcode/xcode_common.lua b/modules/xcode/xcode_common.lua index 4dfda3edea..bacfcabb1f 100644 --- a/modules/xcode/xcode_common.lua +++ b/modules/xcode/xcode_common.lua @@ -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 = { } diff --git a/website/docs/openmp.md b/website/docs/openmp.md index 9b9ffe6fb3..23d0bae4d8 100644 --- a/website/docs/openmp.md +++ b/website/docs/openmp.md @@ -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 ##