An embeddable, thread-safe implementation of the cubescript language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.0 KiB

  1. project('libcubescript', ['cpp'],
  2. version: '0.1.0',
  3. default_options: [
  4. 'buildtype=debugoptimized', 'warning_level=3', 'cpp_rtti=false',
  5. 'cpp_std=none'
  6. ],
  7. meson_version: '>=0.50'
  8. )
  9. dir_prefix = get_option('prefix')
  10. dir_include = join_paths(dir_prefix, get_option('includedir'))
  11. dir_data = join_paths(dir_prefix, get_option('datadir'))
  12. dir_lib = join_paths(dir_prefix, get_option('libdir'))
  13. dir_package_include = join_paths(dir_include, 'cubescript')
  14. libcubescript_includes = [include_directories('include')]
  15. cxx = meson.get_compiler('cpp')
  16. extra_cxxflags = []
  17. if get_option('buildtype') != 'plain'
  18. if cxx.has_argument('-Wshadow')
  19. extra_cxxflags += '-Wshadow'
  20. endif
  21. if cxx.has_argument('-Wold-style-cast')
  22. extra_cxxflags += '-Wold-style-cast'
  23. endif
  24. endif
  25. # Meson does not support C++20 std in a portable way in this version
  26. # unless specified explicitly, have our own logic which will guess it
  27. if get_option('cpp_std') == 'none'
  28. if cxx.has_argument('-std=c++20')
  29. # modern gcc/clang
  30. extra_cxxflags += '-std=c++20'
  31. elif cxx.has_argument('-std=c++2a')
  32. # older gcc/clang
  33. extra_cxxflags += '-std=c++2a'
  34. elif cxx.has_argument('/std:c++20')
  35. # future msvc++? not supported anywhere yet
  36. extra_cxxflags += '/std:c++20'
  37. elif cxx.has_argument('/std:c++latest')
  38. # msvc++ 2019
  39. extra_cxxflags += '/std:c++latest'
  40. endif
  41. endif
  42. build_root = meson.current_build_dir()
  43. subdir('include')
  44. subdir('src')
  45. subdir('tools')
  46. if meson.is_cross_build() and get_option('tests')
  47. build_tests = get_option('tests_cross')
  48. else
  49. build_tests = get_option('tests')
  50. endif
  51. if build_tests
  52. subdir('tests')
  53. endif
  54. pkg = import('pkgconfig')
  55. pkg.generate(
  56. libraries: libcubescript_target,
  57. version: meson.project_version(),
  58. name: 'libcubescript',
  59. filebase: 'libcubescript',
  60. url: 'https://git.octaforge.org/octaforge/libcubescript',
  61. description: 'An embeddable version of the CubeScript language'
  62. )