1# 2#//===----------------------------------------------------------------------===// 3#// 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 7#// 8#//===----------------------------------------------------------------------===// 9# 10 11function(libomp_get_definitions_flags cppflags) 12 set(cppflags_local) 13 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") 20 libomp_append(cppflags_local "-D _USRDLL") 21 libomp_append(cppflags_local "-D _ITERATOR_DEBUG_LEVEL=0" IF_TRUE DEBUG_BUILD) 22 libomp_append(cppflags_local "-D _DEBUG" IF_TRUE DEBUG_BUILD) 23 else() 24 libomp_append(cppflags_local "-D _GNU_SOURCE") 25 libomp_append(cppflags_local "-D _REENTRANT") 26 endif() 27 28 # CMake doesn't include CPPFLAGS from environment, but we will. 29 set(${cppflags} ${cppflags_local} ${LIBOMP_CPPFLAGS} $ENV{CPPFLAGS} PARENT_SCOPE) 30endfunction() 31