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") |
| 35 | if(${STUBS_LIBRARY}) |
| 36 | append_c_source_file("kmp_stub.c") |
| 37 | else() |
| 38 | append_c_source_file("kmp_alloc.c") |
| 39 | append_c_source_file("kmp_atomic.c") |
| 40 | append_c_source_file("kmp_csupport.c") |
| 41 | append_c_source_file("kmp_debug.c") |
| 42 | append_c_source_file("kmp_itt.c") |
| 43 | append_c_source_file("kmp_environment.c") |
| 44 | append_c_source_file("kmp_error.c") |
| 45 | append_c_source_file("kmp_global.c") |
| 46 | append_c_source_file("kmp_i18n.c") |
| 47 | append_c_source_file("kmp_io.c") |
| 48 | append_c_source_file("kmp_runtime.c") |
| 49 | append_c_source_file("kmp_settings.c") |
| 50 | append_c_source_file("kmp_str.c") |
| 51 | append_c_source_file("kmp_tasking.c") |
| 52 | append_c_source_file("kmp_taskq.c") |
| 53 | append_c_source_file("kmp_threadprivate.c") |
| 54 | append_c_source_file("kmp_utility.c") |
| 55 | if(${USE_ITT_NOTIFY}) |
| 56 | append_c_source_file("thirdparty/ittnotify/ittnotify_static.c") |
| 57 | endif() |
| 58 | if(${WINDOWS}) |
| 59 | append_c_source_file("z_Windows_NT_util.c") |
| 60 | append_c_source_file("z_Windows_NT-586_util.c") |
| 61 | else() |
| 62 | append_c_source_file("z_Linux_util.c") |
| 63 | append_c_source_file("kmp_gsupport.c") |
| 64 | endif() |
| 65 | endif() |
| 66 | set(${input_c_source_files} "${local_c_source_files}" PARENT_SCOPE) |
| 67 | endfunction() |
| 68 | |
| 69 | function(set_cpp_files input_cpp_source_files) |
| 70 | set(local_cpp_source_files "") |
| 71 | if(NOT ${STUBS_LIBRARY}) |
Jim Cownie | 4cc4bb4 | 2014-10-07 16:25:50 +0000 | [diff] [blame] | 72 | append_cpp_source_file("kmp_barrier.cpp") |
| 73 | append_cpp_source_file("kmp_wait_release.cpp") |
Jim Cownie | 3b81ce6 | 2014-08-05 09:32:28 +0000 | [diff] [blame] | 74 | append_cpp_source_file("kmp_affinity.cpp") |
| 75 | append_cpp_source_file("kmp_dispatch.cpp") |
| 76 | append_cpp_source_file("kmp_lock.cpp") |
| 77 | append_cpp_source_file("kmp_sched.cpp") |
| 78 | if("${omp_version}" STREQUAL "40") |
| 79 | append_cpp_source_file("kmp_taskdeps.cpp") |
| 80 | append_cpp_source_file("kmp_cancel.cpp") |
| 81 | endif() |
Jim Cownie | 4cc4bb4 | 2014-10-07 16:25:50 +0000 | [diff] [blame] | 82 | if(${STATS_GATHERING}) |
| 83 | append_cpp_source_file("kmp_stats.cpp") |
| 84 | append_cpp_source_file("kmp_stats_timing.cpp") |
| 85 | endif() |
Jim Cownie | 3b81ce6 | 2014-08-05 09:32:28 +0000 | [diff] [blame] | 86 | endif() |
| 87 | |
| 88 | set(${input_cpp_source_files} "${local_cpp_source_files}" PARENT_SCOPE) |
| 89 | endfunction() |
| 90 | |
| 91 | |
| 92 | function(set_asm_files input_asm_source_files) |
| 93 | set(local_asm_source_files "") |
| 94 | if(NOT ${STUBS_LIBRARY}) |
| 95 | if(${WINDOWS}) |
| 96 | append_asm_source_file("z_Windows_NT-586_asm.asm") |
| 97 | else() |
| 98 | append_asm_source_file("z_Linux_asm.s") |
| 99 | endif() |
| 100 | endif() |
| 101 | set(${input_asm_source_files} "${local_asm_source_files}" PARENT_SCOPE) |
| 102 | endfunction() |
| 103 | |
| 104 | |
| 105 | function(set_imp_c_files input_imp_c_files) |
| 106 | set(local_imp_c_files "") |
| 107 | if(${WINDOWS}) |
| 108 | append_imp_c_source_file("kmp_import.c") |
| 109 | endif() |
| 110 | set(${input_imp_c_files} "${local_imp_c_files}" PARENT_SCOPE) |
| 111 | endfunction() |