# file : build2/buildfile # copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file import libs = libbutl%lib{butl} import libs += libpkgconf%lib{pkgconf} exe{b}: cxx{b} libue{b} libue{b}: {hxx ixx txx cxx}{** -b -b-options -config -version} \ {hxx ixx cxx}{b-options} {hxx}{config version} \ $libs hxx{config}: in{config} hxx{version}: in{version} $src_root/manifest # Pass our compiler target to be used as build2 host. # obj{b context}: cxx.poptions += -DBUILD2_HOST_TRIPLET=\"$cxx.target\" # Pass native C and C++ compiler paths (not forgetting to escape backslashes # on Windows). These are used as defaults for BUILD2_DEFAULT_*. # if ($cxx.target == $build.host) { c/obj{init}: cxx.poptions += \ -DBUILD2_NATIVE_C=\"$regex.replace($recall($c.path), '\\', '\\\\')\" cxx/obj{init}: cxx.poptions += \ -DBUILD2_NATIVE_CXX=\"$regex.replace($recall($cxx.path), '\\', '\\\\')\" } if ($cxx.target.class != "windows") cxx.libs += -lpthread else { # Adjust stack size (affects all threads). # if ($cxx.target.cpu == "x86_64") stack_size = 8388608 # 8M else stack_size = 4194304 # 4M if ($cxx.class == 'msvc') cxx.loptions += "/STACK:$stack_size" else cxx.loptions += "-Wl,--stack,$stack_size" } # Generated options parser. # if $cli.configured { cli.cxx{b-options}: cli{b} cli.options += -I $src_root --include-with-brackets --include-prefix build2 \ --guard-prefix BUILD2 --cxx-prologue "#include " \ --cli-namespace build2::cl --generate-file-scanner --keep-separator \ --generate-parse --generate-specifier # Usage options. # cli.options += --suppress-undocumented --long-usage --ansi-color \ --page-usage 'build2::print_$name$_' --option-length 20 # Include the generated cli files into the distribution and don't remove # them when cleaning in src (so that clean results in a state identical to # distributed). # cli.cxx{*}: dist = true cli.cxx{*}: clean = ($src_root != $out_root) # We keep the generated code in the repository so copy it back to src in # case of a forwarded configuration. # cli.cxx{*}: backlink = overwrite }