project( 'FluxEngine', 'cpp', version : '0.1.0', meson_version : '>=0.60.0', default_options : [ 'cpp_std=c++20', 'warning_level=3', 'buildtype=debugoptimized', ] ) # 1) Grab the active C++ compiler cpp = meson.get_compiler('cpp') ccid = cpp.get_id() # e.g. 'msvc', 'gcc', 'clang', 'intel', ... # 2) Decide your D-flag prefix if ccid == 'msvc' dflag = '/D' else dflag = '-D' endif # 3) Platform macro (all OSes) sys = host_machine.system() if sys == 'windows' plat = 'FLUX_PLATFORM_WINDOWS' elif sys == 'linux' plat = 'FLUX_PLATFORM_LINUX' elif sys == 'darwin' plat = 'FLUX_PLATFORM_MACOS' elif sys == 'freebsd' plat = 'FLUX_PLATFORM_FREEBSD' else plat = 'FLUX_PLATFORM_UNKNOWN' endif add_global_arguments(dflag + plat, language : 'cpp') # 4) Build-type macros bt = get_option('buildtype') if bt == 'debug' add_project_arguments(dflag + 'FLUX_DEBUG', language : 'cpp') elif bt == 'release' add_project_arguments(dflag + 'FLUX_RELEASE', language : 'cpp') elif bt == 'debugoptimized' add_project_arguments(dflag + 'FLUX_DIST', language : 'cpp') else warning('Unrecognized buildtype: ' + bt) endif # Tell Meson to descend into these directories subdir('FluxEngine') subdir('Sandbox')