Jonathan Peyton | 2e01335 | 2015-07-15 16:05:30 +0000 | [diff] [blame] | 1 | # |
| 2 | #//===----------------------------------------------------------------------===// |
| 3 | #// |
| 4 | #// The LLVM Compiler Infrastructure |
| 5 | #// |
| 6 | #// This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | #// Source Licenses. See LICENSE.txt for details. |
| 8 | #// |
| 9 | #//===----------------------------------------------------------------------===// |
| 10 | # |
| 11 | |
| 12 | function(libomp_get_definitions_flags cppflags) |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 13 | set(cppflags_local) |
Jonathan Peyton | 2e01335 | 2015-07-15 16:05:30 +0000 | [diff] [blame] | 14 | |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 15 | if(WIN32) |
| 16 | libomp_append(cppflags_local "-D _CRT_SECURE_NO_WARNINGS") |
| 17 | libomp_append(cppflags_local "-D _CRT_SECURE_NO_DEPRECATE") |
| 18 | libomp_append(cppflags_local "-D _WINDOWS") |
| 19 | libomp_append(cppflags_local "-D _WINNT") |
| 20 | libomp_append(cppflags_local "-D _WIN32_WINNT=0x0501") |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 21 | libomp_append(cppflags_local "-D _USRDLL") |
| 22 | libomp_append(cppflags_local "-D _ITERATOR_DEBUG_LEVEL=0" IF_TRUE DEBUG_BUILD) |
Jonathan Peyton | c0225ca | 2015-08-28 18:42:10 +0000 | [diff] [blame] | 23 | libomp_append(cppflags_local "-D _DEBUG" IF_TRUE DEBUG_BUILD) |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 24 | else() |
| 25 | libomp_append(cppflags_local "-D _GNU_SOURCE") |
| 26 | libomp_append(cppflags_local "-D _REENTRANT") |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 27 | endif() |
Jonathan Peyton | 2e01335 | 2015-07-15 16:05:30 +0000 | [diff] [blame] | 28 | |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 29 | # CMake doesn't include CPPFLAGS from environment, but we will. |
| 30 | set(${cppflags} ${cppflags_local} ${LIBOMP_CPPFLAGS} $ENV{CPPFLAGS} PARENT_SCOPE) |
Jonathan Peyton | 2e01335 | 2015-07-15 16:05:30 +0000 | [diff] [blame] | 31 | endfunction() |
| 32 | |