blob: 46beec79f701b1b94726d4516b801334555efdb6 [file] [log] [blame]
Jonathan Peyton2e013352015-07-15 16:05:30 +00001#
2#//===----------------------------------------------------------------------===//
3#//
Chandler Carruth57b08b02019-01-19 10:56:40 +00004#// 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 Peyton2e013352015-07-15 16:05:30 +00007#//
8#//===----------------------------------------------------------------------===//
9#
10
11function(libomp_get_definitions_flags cppflags)
Jonathan Peyton5b4acbd2015-07-15 16:57:19 +000012 set(cppflags_local)
Jonathan Peyton2e013352015-07-15 16:05:30 +000013
Jonathan Peyton5b4acbd2015-07-15 16:57:19 +000014 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 Peyton5b4acbd2015-07-15 16:57:19 +000020 libomp_append(cppflags_local "-D _USRDLL")
21 libomp_append(cppflags_local "-D _ITERATOR_DEBUG_LEVEL=0" IF_TRUE DEBUG_BUILD)
Jonathan Peytonc0225ca2015-08-28 18:42:10 +000022 libomp_append(cppflags_local "-D _DEBUG" IF_TRUE DEBUG_BUILD)
Jonathan Peyton5b4acbd2015-07-15 16:57:19 +000023 else()
24 libomp_append(cppflags_local "-D _GNU_SOURCE")
25 libomp_append(cppflags_local "-D _REENTRANT")
Jonathan Peyton5b4acbd2015-07-15 16:57:19 +000026 endif()
Jonathan Peyton2e013352015-07-15 16:05:30 +000027
Jonathan Peyton5b4acbd2015-07-15 16:57:19 +000028 # CMake doesn't include CPPFLAGS from environment, but we will.
29 set(${cppflags} ${cppflags_local} ${LIBOMP_CPPFLAGS} $ENV{CPPFLAGS} PARENT_SCOPE)
Jonathan Peyton2e013352015-07-15 16:05:30 +000030endfunction()