blob: 4cd2a1de759b8d8436a3800dabb098c98910c965 [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
12macro(append_c_source_file new_c_file)
13 list(APPEND local_c_source_files "${new_c_file}")
14endmacro()
15
16macro(append_cpp_source_file new_cpp_file)
17 list(APPEND local_cpp_source_files "${new_cpp_file}")
18endmacro()
19
20macro(append_asm_source_file new_asm_file)
21 list(APPEND local_asm_source_files "${new_asm_file}")
22endmacro()
23
24macro(append_imp_c_source_file new_import_c_file)
25 list(APPEND local_imp_c_files "${new_import_c_file}")
26endmacro()
27
28# files are relative to the src directory
29
30function(set_c_files input_c_source_files)
31 set(local_c_source_files "")
32 append_c_source_file("kmp_ftn_cdecl.c")
33 append_c_source_file("kmp_ftn_extra.c")
34 append_c_source_file("kmp_version.c")
Jonathan Peyton7979a072015-05-20 22:33:24 +000035 if(${LIBOMP_OMPT_SUPPORT})
Andrey Churbanove5f44922015-04-29 16:22:07 +000036 append_c_source_file("ompt-general.c")
37 endif()
Jim Cownie3b81ce62014-08-05 09:32:28 +000038 if(${STUBS_LIBRARY})
39 append_c_source_file("kmp_stub.c")
40 else()
41 append_c_source_file("kmp_alloc.c")
42 append_c_source_file("kmp_atomic.c")
43 append_c_source_file("kmp_csupport.c")
44 append_c_source_file("kmp_debug.c")
45 append_c_source_file("kmp_itt.c")
46 append_c_source_file("kmp_environment.c")
47 append_c_source_file("kmp_error.c")
48 append_c_source_file("kmp_global.c")
49 append_c_source_file("kmp_i18n.c")
50 append_c_source_file("kmp_io.c")
51 append_c_source_file("kmp_runtime.c")
52 append_c_source_file("kmp_settings.c")
53 append_c_source_file("kmp_str.c")
54 append_c_source_file("kmp_tasking.c")
55 append_c_source_file("kmp_taskq.c")
56 append_c_source_file("kmp_threadprivate.c")
57 append_c_source_file("kmp_utility.c")
Jonathan Peyton7979a072015-05-20 22:33:24 +000058 if(${LIBOMP_USE_ITT_NOTIFY})
Jim Cownie3b81ce62014-08-05 09:32:28 +000059 append_c_source_file("thirdparty/ittnotify/ittnotify_static.c")
60 endif()
61 if(${WINDOWS})
62 append_c_source_file("z_Windows_NT_util.c")
63 append_c_source_file("z_Windows_NT-586_util.c")
64 else()
65 append_c_source_file("z_Linux_util.c")
66 append_c_source_file("kmp_gsupport.c")
67 endif()
68 endif()
69 set(${input_c_source_files} "${local_c_source_files}" PARENT_SCOPE)
70endfunction()
71
72function(set_cpp_files input_cpp_source_files)
73 set(local_cpp_source_files "")
74 if(NOT ${STUBS_LIBRARY})
Jim Cownie4cc4bb42014-10-07 16:25:50 +000075 append_cpp_source_file("kmp_barrier.cpp")
76 append_cpp_source_file("kmp_wait_release.cpp")
Jim Cownie3b81ce62014-08-05 09:32:28 +000077 append_cpp_source_file("kmp_affinity.cpp")
78 append_cpp_source_file("kmp_dispatch.cpp")
79 append_cpp_source_file("kmp_lock.cpp")
80 append_cpp_source_file("kmp_sched.cpp")
Jonathan Peyton7979a072015-05-20 22:33:24 +000081 if(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40)
Jim Cownie3b81ce62014-08-05 09:32:28 +000082 append_cpp_source_file("kmp_taskdeps.cpp")
83 append_cpp_source_file("kmp_cancel.cpp")
84 endif()
Jonathan Peyton7979a072015-05-20 22:33:24 +000085 if(${LIBOMP_STATS})
Jim Cownie4cc4bb42014-10-07 16:25:50 +000086 append_cpp_source_file("kmp_stats.cpp")
87 append_cpp_source_file("kmp_stats_timing.cpp")
88 endif()
Jim Cownie3b81ce62014-08-05 09:32:28 +000089 endif()
90
91 set(${input_cpp_source_files} "${local_cpp_source_files}" PARENT_SCOPE)
92endfunction()
93
94
95function(set_asm_files input_asm_source_files)
96 set(local_asm_source_files "")
97 if(NOT ${STUBS_LIBRARY})
98 if(${WINDOWS})
99 append_asm_source_file("z_Windows_NT-586_asm.asm")
100 else()
101 append_asm_source_file("z_Linux_asm.s")
102 endif()
103 endif()
104 set(${input_asm_source_files} "${local_asm_source_files}" PARENT_SCOPE)
105endfunction()
106
107
108function(set_imp_c_files input_imp_c_files)
109 set(local_imp_c_files "")
110 if(${WINDOWS})
111 append_imp_c_source_file("kmp_import.c")
112 endif()
113 set(${input_imp_c_files} "${local_imp_c_files}" PARENT_SCOPE)
114endfunction()