Sometimes you need dynamic enumerations, such as some selector options from database, but you will find that it seems like an the enumeration can only be modified at app startup. Try this:
1 2 3 4 5 6 7 8 9 10 11
myuan@jxtkfuwuqi ~> curl 10.242.155.222:8000 {"detail":[{"loc":["query","e"],"msg":"field required","type":"value_error.missing"}]}⏎ myuan@jxtkfuwuqi ~> curl 10.242.155.222:8000/rand-enum {"message":{"0-7":"value-85","1-8":"value-6","2-5":"value-10","3-5":"value-99","4-4":"value-14"}}⏎ myuan@jxtkfuwuqi ~> curl '10.242.155.222:8000?e=value-10' {"e":"value-10"}⏎ myuan@jxtkfuwuqi ~> curl '10.242.155.222:8000?e=value-9' {"detail":[{"loc":["query","e"],"msg":"value is not a valid enumeration member; permitted: 'value-85', 'value-6', 'value-10', 'value-99', 'value-14'","type":"type_error.enum","ctx":{"enum_values":["value-85","value-6","value-10","value-99","value-14"]}}]}⏎ myuan@jxtkfuwuqi ~> curl '10.242.155.222:8000?e=value-11' {"detail":[{"loc":["query","e"],"msg":"value is not a valid enumeration member; permitted: 'value-85', 'value-6', 'value-10', 'value-99', 'value-14'","type":"type_error.enum","ctx":{"enum_values":["value-85","value-6","value-10","value-99","value-14"]}}]}⏎
Enumeration constraints are still in effect while the enumeration is modified
target("great-loader") set_kind("binary") add_includedirs("../great-project/src/") if is_os("windows") then add_linkdirs("../great-project/build/windows/x64/release/") elseif is_os("linux") then add_linkdirs("../great-project/build/linux/x86_64/release/") end add_links("great-project")
add_files("src/*.cpp")
土法土在手动add_linkdirs, 然后手动add_links.
之后使用xmake; xmake run 已经可以看到正确结果了.
add_urls("https://github.com/myrepo/foo.git") add_versions("1.0", "<shasum256 or gitcommit>")
on_install(function(package) local configs = {} ifpackage:config("shared") then configs.kind = "shared" end import("package.tools.xmake").install(package, configs) end)
on_test(function(package) -- TODO check includes and interfaces -- assert(package:has_cfuncs("foo", {includes = "foo.h"}) end)
-DARROW_COMPUTE=ON: Computational kernel functions and other support
-DARROW_CSV=ON: CSV reader module
-DARROW_CUDA=ON: CUDA integration for GPU development. Depends on NVIDIA CUDA toolkit. The CUDA toolchain used to build the library can be customized by using the $CUDA_HOME environment variable.
-DARROW_DATASET=ON: Dataset API, implies the Filesystem API
-DARROW_FILESYSTEM=ON: Filesystem API for accessing local and remote filesystems
-DARROW_FLIGHT=ON: Arrow Flight RPC system, which depends at least on gRPC
-DARROW_GANDIVA=ON: Gandiva expression compiler, depends on LLVM, Protocol Buffers, and re2
-DARROW_GANDIVA_JAVA=ON: Gandiva JNI bindings for Java
-DARROW_HDFS=ON: Arrow integration with libhdfs for accessing the Hadoop Filesystem
-DARROW_HIVESERVER2=ON: Client library for HiveServer2 database protocol
-DARROW_JSON=ON: JSON reader module
-DARROW_ORC=ON: Arrow integration with Apache ORC
-DARROW_PARQUET=ON: Apache Parquet libraries and Arrow integration
-DARROW_PLASMA=ON: Plasma Shared Memory Object Store
-DARROW_PLASMA_JAVA_CLIENT=ON: Build Java client for Plasma
-DARROW_PYTHON=ON: Arrow Python C++ integration library (required for building pyarrow). This library must be built against the same Python version for which you are building pyarrow. NumPy must also be installed. Enabling this option also enables ARROW_COMPUTE, ARROW_CSV, ARROW_DATASET, ARROW_FILESYSTEM, ARROW_HDFS, and ARROW_JSON.
-DARROW_S3=ON: Support for Amazon S3-compatible filesystems
-DARROW_WITH_BZ2=ON: Build support for BZ2 compression
-DARROW_WITH_ZLIB=ON: Build support for zlib (gzip) compression
-DARROW_WITH_LZ4=ON: Build support for lz4 compression
-DARROW_WITH_SNAPPY=ON: Build support for Snappy compression
-DARROW_WITH_ZSTD=ON: Build support for ZSTD compression
-DARROW_WITH_BROTLI=ON: Build support for Brotli compression
ifpackage:config("shared") then configs.kind = "shared" end for name instring.gmatch(package:config("components"), "[%w|_]+") do table.insert(configs, string.format("-DARROW_%s=ON", string.upper(name))) end