blob: 978b72fbc45910c58dd6078acd9de47c8c43df8c [file] [log] [blame]
Jim Cownie3b81ce62014-08-05 09:32:28 +00001#
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# void append_ev_flags(string new_flag);
13# - appends new_flag to ev_flags list
14macro(append_ev_flags new_flag)
15 list(APPEND local_ev_flags "${new_flag}")
16endmacro()
17
18# void append_gd_flags(string new_flag);
19# - appends new_flag to gd_flags list
20macro(append_gd_flags new_flag)
21 list(APPEND local_gd_flags "${new_flag}")
22endmacro()
23
24include(HelperFunctions) # for set_legal_type(), set_legal_arch()
25
26# Perl expand-vars.pl flags
27function(set_ev_flags input_ev_flags)
28 set(local_ev_flags)
29 set_legal_type("${lib_type}" legal_type)
30 set_legal_arch("${arch}" legal_arch)
31 # need -D Revision="\$Revision" to show up
32 append_ev_flags("-D Revision=\"\\\\$$Revision\"")
33 append_ev_flags("-D Date=\"\\\\$$Date\"")
34 append_ev_flags("-D KMP_TYPE=\"${legal_type}\"")
35 append_ev_flags("-D KMP_ARCH=\"${legal_arch}\"")
36 append_ev_flags("-D KMP_VERSION_MAJOR=${version}")
37 append_ev_flags("-D KMP_VERSION_MINOR=0")
38 append_ev_flags("-D KMP_VERSION_BUILD=${build_number}")
39 append_ev_flags("-D KMP_BUILD_DATE=\"${date}\"")
40 append_ev_flags("-D KMP_TARGET_COMPILER=12")
41 if(${DEBUG_BUILD} OR ${RELWITHDEBINFO_BUILD})
42 append_ev_flags("-D KMP_DIAG=1")
43 append_ev_flags("-D KMP_DEBUG_INFO=1")
44 else()
45 append_ev_flags("-D KMP_DIAG=0")
46 append_ev_flags("-D KMP_DEBUG_INFO=0")
47 endif()
48 if(${omp_version} EQUAL 40)
49 append_ev_flags("-D OMP_VERSION=201307")
50 elseif(${omp_version} EQUAL 30)
51 append_ev_flags("-D OMP_VERSION=201107")
52 else()
53 append_ev_flags("-D OMP_VERSION=200505")
54 endif()
55 set(${input_ev_flags} "${local_ev_flags}" PARENT_SCOPE)
56endfunction()
57
58function(set_gd_flags input_gd_flags)
59 set(local_gd_flags)
60 if(${IA32})
61 append_gd_flags("-D arch_32")
62 elseif(${INTEL64})
63 append_gd_flags("-D arch_32e")
64 else()
65 append_gd_flags("-D arch_${arch}")
66 endif()
67 if(${NORMAL_LIBRARY})
68 append_gd_flags("-D norm")
69 elseif(${PROFILE_LIBRARY})
70 append_gd_flags("-D prof")
71 elseif(${STUBS_LIBRARY})
72 append_gd_flags("-D stub")
73 endif()
Andrey Churbanov062e1982015-05-07 17:07:06 +000074 if(${omp_version} GREATER 41 OR ${omp_version} EQUAL 41)
75 append_gd_flags("-D OMP_41")
76 endif()
Jim Cownie3b81ce62014-08-05 09:32:28 +000077 if(${omp_version} GREATER 40 OR ${omp_version} EQUAL 40)
78 append_gd_flags("-D OMP_40")
79 endif()
80 if(${omp_version} GREATER 30 OR ${omp_version} EQUAL 30)
81 append_gd_flags("-D OMP_30")
82 endif()
83 if(NOT "${version}" STREQUAL "4")
84 append_gd_flags("-D msvc_compat")
85 endif()
86 if(${DEBUG_BUILD} OR ${RELWITHDEBINFO_BUILD})
87 append_gd_flags("-D KMP_DEBUG")
88 endif()
89 if(${COMPILER_SUPPORTS_QUAD_PRECISION})
90 append_gd_flags("-D HAVE_QUAD")
91 endif()
92 set(${input_gd_flags} "${local_gd_flags}" PARENT_SCOPE)
93endfunction()