Open Cartman0 opened 2 years ago
I'm saying from day one that splitting options in machine files makes not sense at all. I'm still pretty mad we did not put everything in a single [options] category. I still have to check examples to know the syntax everytime...
i see, if focus on existence of templates, i want a follow native/cross template file with descriptions:
native_template.ini
(incomplete):
UPDATE: 2022/03/21
## native file
## "constants" that can be used on .ini files
### 🔗 https://mesonbuild.com/Machine-files.html#constants
[constants]
## "Properties" that is key value pairs accessed using the meson.get_external_property(), or meson.get_cross_property().
### 🔗 https://mesonbuild.com/Machine-files.html#properties
[properties]
# cmake_toolchain_file='' # specifies an absolute path to an already existing CMake toolchain file that will be loaded with include() as the last instruction of the automatically generated CMake toolchain file from Meson. (new in 0.56.0)
# cmake_defaults='' # is a boolean that specifies whether Meson should automatically generate default toolchain variables from other sections (binaries, host_machine, etc.) in the machine file. Defaults are always overwritten by variables set in the [cmake] section. The default is true. (new in 0.56.0)
# cmake_skip_compiler_test='' # is an enum that specifies when Meson should automatically generate toolchain variables to skip the CMake compiler sanity checks. This only has an effect if cmake_defaults is true. Supported values are always, never, dep_only. The default is dep_only. (new in 0.56.0)
# cmake_use_exe_wrapper='' # is a boolean that controls whether to use the exe_wrapper specified in [binaries] to run generated executables in CMake subprojects. This setting has no effect if the exe_wrapper was not specified. The default value is true. (new in 0.56.0)
# java_home=''
## Project specific options
### Being able to set project specific options in a cross or native file can be done using the [project options] section of the specific file (if doing a cross build the options from the native file will be ignored)
### âš require to define options in `meson_option.txt`
### able to set -Doption when using `meson` command on terminal
### able to access using `get_option()` in `meson.build`file
### 🔗 https://mesonbuild.com/Machine-files.html#project-specific-options
[project options]
## Binaries
### 🔗 https://mesonbuild.com/Machine-files.html#binaries
[binaries]
# c = 'gcc'
# c_ld='ld'
# cpp='g++'
# cpp_ld='ld'
# ar='ar'
# sed = 'sed'
# llvm-config = '/usr/lib/llvm-11/bin/llvm-config'
## Builtin-options
### 🔗 https://mesonbuild.com/Builtin-options
[built-in options]
### Compiler options ### Compiler options 🔗 https://mesonbuild.com/Builtin-options.html#compiler-options
# c_args=[] # C compile arguments to use
# c_link_args=[] # C link arguments to use
# c_std='none' # 'none'/'c89'/'c99'/'c11'/'c17'/'c18'/'c2x'/'gnu89'/'gnu99'/'gnu11'/'gnu17'/'gnu18'/'gnu2x' # C language standard to use
# c_winlibs=[] # see below free-form comma-separated list Standard Windows libs to link against
# c_thread_count=4 #integer value ≥ 0 # Number of threads to use with emcc when using threads
# cpp_args=[] # free-form comma-separated list # C++ compile arguments to use
# cpp_link_args=[] # free-form comma-separated list # C++ link arguments to use
# cpp_std='none' # none/c++98/c++03/c++11/c++14/c++17/c++20/c++2a/c++1z/gnu++03/gnu++11/gnu++14/gnu++17/gnu++1z/gnu++2a, gnu++20, vc++14, vc++17, vc++latest C++ language standard to use
# cpp_debugstl=false # true/false # C++ STL debug mode
# cpp_eh='default' # none/default/a/s/sc # C++ exception handling type
# cpp_rtti=true # true/false # Whether to enable RTTI (runtime type identification)
# cpp_thread_count=4 # integer value ≥ 0 # Number of threads to use with emcc when using threads
# cpp_winlibs=[] # see below free-form comma-separated list # Standard Windows libs to link against
# fortran_std='none' # [none, legacy, f95, f2003, f2008, f2018] # Fortran language standard to use
# cuda_ccbindir='' # filesystem path # CUDA non-default toolchain directory to use (-ccbin) (Added in 0.57.1)
### Universal options 🔗 https://mesonbuild.com/Builtin-options.html#universal-options
#### Directories
# prefix='/usr/local' # prefix defaults to 'C:/' on Windows, and '/usr/local' otherwise. # Installation prefix
# bindir='bin' # Executable directory
# datadir='share' # Data file directory
# includedir='include' # Header file directory
# infodir='share/info' # Info page directory
# libdir='' # `libdir` is automatically detected based on your platform, it should be correct when doing "native" (build machine == host machine) compilation. For cross compiles Meson will try to guess the correct libdir, but it may not be accurate, especially on Linux where different distributions have different defaults. Using a cross file, particularly the paths section may be necessary. # Library directory
# libexecdir='libexec' # Library executable directory
# localedir='share/locale' # Locale data directory
# localstatedir='var' # Localstate data directory
# mandir='share/man' # Manual page directory
# sbindir='sbin' # System executable directory
# sharedstatedir='com' # Architecture-independent data directory
# sysconfdir='etc' # Sysconf data directory
### Core options 🔗 https://mesonbuild.com/Builtin-options.html#core-options
# auto_features='auto' # {enabled, disabled, auto} # Override value of all 'auto' features
# backend='ninja' # {ninja, vs, vs2010, vs2012, vs2013, vs2015, vs2017, vs2019, vs2022, xcode} # Backend to use
# buildtype='debug' # {plain, debug, debugoptimized, release, minsize, custom} # Build type to use
# debug=true # Debug
# default_library='shared' # {shared, static, both} # Default library type
# errorlogs=true # Whether to print the logs from failing tests.
# install_umask='022' # {preserve, 0000-0777} # Default umask to apply on permissions of installed files no no
# layout='mirror' {mirror,flat} # Build directory layout
# optimization='0' # {0, g, 1, 2, 3, s} # Optimization level
# pkg_config_path='' # {OS separated path} # Additional paths for pkg-config to search before builtin paths
# cmake_prefix_path=[] # Additional prefixes for cmake to search before builtin paths yes no
# stdsplit=true # Split stdout and stderr in test logs
# strip=false # Strip targets on install
# unity='off' # {on, off, subprojects} # Unity build
# unity_size {>=2} 4 Unity file block size no no
# warning_level=1 # {0, 1, 2, 3} Set the warning level. From 0 = none to 3 = highest no yes
# werror=false # Treat warnings as errors
# wrap_mode='default' {default, nofallback, nodownload, forcefallback, nopromote} # Wrap mode to use no no
# force_fallback_for=[] # Force fallback for those dependencies no no
### Base option 🔗 https://mesonbuild.com/Builtin-options.html#base-options
# b_asneeded=true # true/false # Use -Wl,--as-needed when linking
# b_bitcode=false # true/false # Embed Apple bitcode, see below
# b_colorout='always' # auto/always/never # Use colored output
# b_coverage=false # true/false # Enable coverage tracking
# b_lundef=true # true/false # Don't allow undefined symbols when linking
# b_lto=false # true/false # Use link time optimization
# b_lto_threads=0 # Any integer* # Use multiple threads for lto. (Added in 0.57.0)
# b_lto_mode='default' # default/thin # Select between lto modes, thin and default. (Added in 0.57.0)
# b_ndebug=false # true/false # if-release Disable asserts
# b_pch=true # true/false # Use precompiled headers
# b_pgo='off' # off/generate/use # Use profile guided optimization
# b_sanitize='none' # see below Code sanitizer to use
# b_staticpic=true # true/false # Build static libraries as position independent
# b_pie=false # true/false # Build position-independent executables (since 0.49.0)
# b_vscrt='from_buildtype' #none/md/mdd/mt/mtd/from_buildtype/static_from_buildtype # VS runtime library to use (since 0.48.0) (static_from_buildtype since 0.56.0)
though this is a naive solution, i think web search num may be reduced little.
"project options"(in native/cross file, https://mesonbuild.com/Machine-files.html#project-specific-options) are contained in "Build options"(https://mesonbuild.com/Build-options.html)?
As far as I can see behavior, it seems to be classified as follow:
however, as far as I can read doc, no notes that "project options" is a part of "Build options" and required
meson_option.txt
in its page (https://mesonbuild.com/Machine-files.html#project-specific-options), and no notes that related "project options"(in native/cross file) in "Build options" page (https://mesonbuild.com/Build-options.html).this confuse me because doc is user-friendly-less.. Is my understanding correct?