Jonathan Peyton | 2e01335 | 2015-07-15 16:05:30 +0000 | [diff] [blame] | 1 | # |
| 2 | #//===----------------------------------------------------------------------===// |
| 3 | #// |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 4 | #// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | #// See https://llvm.org/LICENSE.txt for license information. |
| 6 | #// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Jonathan Peyton | 2e01335 | 2015-07-15 16:05:30 +0000 | [diff] [blame] | 7 | #// |
| 8 | #//===----------------------------------------------------------------------===// |
| 9 | # |
| 10 | |
| 11 | function(libomp_get_definitions_flags cppflags) |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 12 | set(cppflags_local) |
Jonathan Peyton | 2e01335 | 2015-07-15 16:05:30 +0000 | [diff] [blame] | 13 | |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 14 | if(WIN32) |
| 15 | libomp_append(cppflags_local "-D _CRT_SECURE_NO_WARNINGS") |
| 16 | libomp_append(cppflags_local "-D _CRT_SECURE_NO_DEPRECATE") |
| 17 | libomp_append(cppflags_local "-D _WINDOWS") |
| 18 | libomp_append(cppflags_local "-D _WINNT") |
| 19 | libomp_append(cppflags_local "-D _WIN32_WINNT=0x0501") |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 20 | libomp_append(cppflags_local "-D _USRDLL") |
| 21 | 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] | 22 | libomp_append(cppflags_local "-D _DEBUG" IF_TRUE DEBUG_BUILD) |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 23 | else() |
| 24 | libomp_append(cppflags_local "-D _GNU_SOURCE") |
| 25 | libomp_append(cppflags_local "-D _REENTRANT") |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 26 | endif() |
Jonathan Peyton | 2e01335 | 2015-07-15 16:05:30 +0000 | [diff] [blame] | 27 | |
Jonathan Peyton | 5b4acbd | 2015-07-15 16:57:19 +0000 | [diff] [blame] | 28 | # CMake doesn't include CPPFLAGS from environment, but we will. |
| 29 | set(${cppflags} ${cppflags_local} ${LIBOMP_CPPFLAGS} $ENV{CPPFLAGS} PARENT_SCOPE) |
Jonathan Peyton | 2e01335 | 2015-07-15 16:05:30 +0000 | [diff] [blame] | 30 | endfunction() |