|
| 1 | +project('tmxlite', 'cpp', 'c', |
| 2 | + version: '1.2.1', |
| 3 | + meson_version: '>=0.49.2', |
| 4 | + default_options: [ |
| 5 | + 'buildtype=release', |
| 6 | + 'cpp_std=c++14', |
| 7 | + 'b_ndebug=if-release' |
| 8 | + ] |
| 9 | +) |
| 10 | + |
| 11 | +cpp = meson.get_compiler('cpp') |
| 12 | +if get_option('use_rtti') |
| 13 | + if cpp.get_argument_syntax() == 'gcc' |
| 14 | + if get_option('project_static_runtime') |
| 15 | + add_project_arguments('-Wall', '-static', language: ['cpp', 'c']) |
| 16 | + else |
| 17 | + add_project_arguments('-Wall', language: ['cpp', 'c']) |
| 18 | + endif |
| 19 | + endif |
| 20 | +else |
| 21 | + if cpp.get_argument_syntax() == 'gcc' |
| 22 | + if get_option('project_static_runtime') |
| 23 | + add_project_arguments('-Wall', '-fno-rtti', '-static', language: ['cpp', 'c']) |
| 24 | + else |
| 25 | + add_project_arguments('-Wall', '-fno-rtti', language: ['cpp', 'c']) |
| 26 | + endif |
| 27 | + endif |
| 28 | +endif |
| 29 | + |
| 30 | +binary_postfix = '' |
| 31 | +if get_option('default_library') == 'static' |
| 32 | + if get_option('debug') |
| 33 | + add_project_arguments('-D_DEBUG_', '-DTMXLITE_STATIC', language: ['cpp', 'c']) |
| 34 | + binary_postfix = '-s-d' |
| 35 | + else |
| 36 | + add_project_arguments('-O4', '-DTMXLITE_STATIC', language: ['cpp', 'c']) |
| 37 | + binary_postfix = '-s' |
| 38 | + endif |
| 39 | +elif get_option('default_library') == 'shared' |
| 40 | + if get_option('debug') |
| 41 | + add_project_arguments('-D_DEBUG_', language: ['cpp', 'c']) |
| 42 | + binary_postfix = '-d' |
| 43 | + else |
| 44 | + add_project_arguments('-O4', language: ['cpp', 'c']) |
| 45 | + endif |
| 46 | +else |
| 47 | + error('Unsupported option \'' + get_option('default_library') + '\' for project ' + meson.project_name()) |
| 48 | +endif |
| 49 | + |
| 50 | +if cpp.get_argument_syntax() == 'msvc' |
| 51 | + add_project_arguments('-D_CRT_SECURE_NO_WARNINGS', language: ['cpp', 'c']) |
| 52 | +endif |
| 53 | + |
| 54 | +subdir('tmxlite') |
0 commit comments