Jim Cownie | 3b81ce6 | 2014-08-05 09:32:28 +0000 | [diff] [blame] | 1 | # |
| 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 | macro(append_c_source_file new_c_file) |
| 13 | list(APPEND local_c_source_files "${new_c_file}") |
| 14 | endmacro() |
| 15 | |
| 16 | macro(append_cpp_source_file new_cpp_file) |
| 17 | list(APPEND local_cpp_source_files "${new_cpp_file}") |
| 18 | endmacro() |
| 19 | |
| 20 | macro(append_asm_source_file new_asm_file) |
| 21 | list(APPEND local_asm_source_files "${new_asm_file}") |
| 22 | endmacro() |
| 23 | |
| 24 | macro(append_imp_c_source_file new_import_c_file) |
| 25 | list(APPEND local_imp_c_files "${new_import_c_file}") |
| 26 | endmacro() |
| 27 | |
| 28 | # files are relative to the src directory |
| 29 | |
| 30 | function(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 Peyton | 7979a07 | 2015-05-20 22:33:24 +0000 | [diff] [blame] | 35 | if(${LIBOMP_OMPT_SUPPORT}) |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 36 | append_c_source_file("ompt-general.c") |
| 37 | endif() |
Jim Cownie | 3b81ce6 | 2014-08-05 09:32:28 +0000 | [diff] [blame] | 38 | 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 Peyton | 7979a07 | 2015-05-20 22:33:24 +0000 | [diff] [blame] | 58 | if(${LIBOMP_USE_ITT_NOTIFY}) |
Jim Cownie | 3b81ce6 | 2014-08-05 09:32:28 +0000 | [diff] [blame] | 59 | 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) |
| 70 | endfunction() |
| 71 | |
| 72 | function(set_cpp_files input_cpp_source_files) |
| 73 | set(local_cpp_source_files "") |
| 74 | if(NOT ${STUBS_LIBRARY}) |
Jim Cownie | 4cc4bb4 | 2014-10-07 16:25:50 +0000 | [diff] [blame] | 75 | append_cpp_source_file("kmp_barrier.cpp") |
| 76 | append_cpp_source_file("kmp_wait_release.cpp") |
Jim Cownie | 3b81ce6 | 2014-08-05 09:32:28 +0000 | [diff] [blame] | 77 | 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 Peyton | 7979a07 | 2015-05-20 22:33:24 +0000 | [diff] [blame] | 81 | if(${LIBOMP_OMP_VERSION} GREATER 40 OR ${LIBOMP_OMP_VERSION} EQUAL 40) |
Jim Cownie | 3b81ce6 | 2014-08-05 09:32:28 +0000 | [diff] [blame] | 82 | append_cpp_source_file("kmp_taskdeps.cpp") |
| 83 | append_cpp_source_file("kmp_cancel.cpp") |
| 84 | endif() |
Jonathan Peyton | 7979a07 | 2015-05-20 22:33:24 +0000 | [diff] [blame] | 85 | if(${LIBOMP_STATS}) |
Jim Cownie | 4cc4bb4 | 2014-10-07 16:25:50 +0000 | [diff] [blame] | 86 | append_cpp_source_file("kmp_stats.cpp") |
| 87 | append_cpp_source_file("kmp_stats_timing.cpp") |
| 88 | endif() |
Jim Cownie | 3b81ce6 | 2014-08-05 09:32:28 +0000 | [diff] [blame] | 89 | endif() |
| 90 | |
| 91 | set(${input_cpp_source_files} "${local_cpp_source_files}" PARENT_SCOPE) |
| 92 | endfunction() |
| 93 | |
| 94 | |
| 95 | function(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) |
| 105 | endfunction() |
| 106 | |
| 107 | |
| 108 | function(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) |
| 114 | endfunction() |