Merge pull request #1860 from Jarod42/openmp-gcc-clang
Add support of openmp for gcc/clang.
This commit is contained in:
commit
c4265c5ede
@ -49,6 +49,7 @@
|
||||
Fast = "-ffast-math",
|
||||
},
|
||||
strictaliasing = gcc.shared.strictaliasing,
|
||||
openmp = gcc.shared.openmp,
|
||||
optimize = {
|
||||
Off = "-O0",
|
||||
On = "-O2",
|
||||
|
@ -67,6 +67,9 @@
|
||||
Level2 = { "-fstrict-aliasing", "-Wstrict-aliasing=2" },
|
||||
Level3 = { "-fstrict-aliasing", "-Wstrict-aliasing=3" },
|
||||
},
|
||||
openmp = {
|
||||
On = "-fopenmp"
|
||||
},
|
||||
optimize = {
|
||||
Off = "-O0",
|
||||
On = "-O2",
|
||||
|
@ -68,4 +68,20 @@
|
||||
prepare()
|
||||
test.contains({ "-miphoneos-version-min=5.0" }, clang.getcxxflags(cfg))
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check handling of openmp.
|
||||
--
|
||||
|
||||
function suite.cflags_onOpenmpOn()
|
||||
openmp "On"
|
||||
prepare()
|
||||
test.contains("-fopenmp", clang.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cflags_onOpenmpOff()
|
||||
openmp "Off"
|
||||
prepare()
|
||||
test.excludes("-fopenmp", clang.getcflags(cfg))
|
||||
end
|
||||
|
||||
|
@ -702,6 +702,21 @@
|
||||
test.contains({ "-fstrict-aliasing", "-Wstrict-aliasing=3" }, gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
--
|
||||
-- Check handling of openmp.
|
||||
--
|
||||
|
||||
function suite.cflags_onOpenmpOn()
|
||||
openmp "On"
|
||||
prepare()
|
||||
test.contains("-fopenmp", gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cflags_onOpenmpOff()
|
||||
openmp "Off"
|
||||
prepare()
|
||||
test.excludes("-fopenmp", gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
--
|
||||
-- Check handling of system search paths.
|
||||
|
@ -20,15 +20,11 @@ Project configurations.
|
||||
|
||||
### Availability ###
|
||||
|
||||
Premake 5.0-beta1 or later. Currently only implemented for Visual Studio 2010+. As a workaround for other toolsets, you can use [buildoptions](buildoptions.md) like this:
|
||||
|
||||
```lua
|
||||
filter "toolset:not msc*"
|
||||
buildoptions "-fopenmp"
|
||||
```
|
||||
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.
|
||||
|
||||
## Examples ##
|
||||
|
||||
```lua
|
||||
openmp "On"
|
||||
```
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user