diff options
author | Simon Wang <jellalleonhardt4869@gmail.com> | 2021-09-13 19:50:45 +0800 |
---|---|---|
committer | Yuxuan 'fishy' Wang <yuxuan.wang@reddit.com> | 2022-09-11 08:25:32 -0700 |
commit | d5927a96019154fa590c38f3a7ca70275af11b3c (patch) | |
tree | 4c0a412c9d0bd333e24f21cc6d13bedadc487268 /compiler/cpp/tests | |
parent | 944b8e68a099392d80153ebcf26f32ff7f1d893a (diff) | |
download | thrift-d5927a96019154fa590c38f3a7ca70275af11b3c.tar.gz |
THRIFT-5423: IDL parameter validation for Go
Closes https://github.com/apache/thrift/pull/2469.
Diffstat (limited to 'compiler/cpp/tests')
-rw-r--r-- | compiler/cpp/tests/CMakeLists.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler/cpp/tests/CMakeLists.txt b/compiler/cpp/tests/CMakeLists.txt index 0e8254158..b8b2777a9 100644 --- a/compiler/cpp/tests/CMakeLists.txt +++ b/compiler/cpp/tests/CMakeLists.txt @@ -76,6 +76,8 @@ set(thrift_compiler_SOURCES ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/audit/t_audit.cpp ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/common.cc ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/generate/t_generator.cc + ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/generate/validator_parser.cc + ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/generate/validator_parser.h ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/parse/t_typedef.cc ${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/parse/parse.cc ${THRIFT_COMPILER_SOURCE_DIR}/thrift/version.h @@ -96,6 +98,18 @@ macro(THRIFT_ADD_COMPILER name description initial) endif() endmacro() +# This macro adds an option THRIFT_VALIDATOR_COMPILER_${NAME} +# that allows enabling or disabling certain languages +macro(THRIFT_ADD_VALIDATOR_COMPILER name description initial) + string(TOUPPER "THRIFT_VALIDATOR_COMPILER_${name}" enabler) + set(src "${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/generate/${name}_validator_generator.cc") + list(APPEND "${THRIFT_COMPILER_SOURCE_DIR}/src/thrift/generate/${name}_validator_generator.h") + option(${enabler} ${description} ${initial}) + if(${enabler}) + list(APPEND thrift-compiler_SOURCES ${src}) + endif() +endmacro() + # The following compiler with unit tests can be enabled or disabled THRIFT_ADD_COMPILER(c_glib "Enable compiler for C with Glib" OFF) THRIFT_ADD_COMPILER(cl "Enable compiler for Common LISP" OFF) @@ -125,6 +139,9 @@ THRIFT_ADD_COMPILER(swift "Enable compiler for Swift" OFF) THRIFT_ADD_COMPILER(xml "Enable compiler for XML" OFF) THRIFT_ADD_COMPILER(xsd "Enable compiler for XSD" OFF) +# The following compiler can be enabled or disabled by enabling or disabling certain languages +THRIFT_ADD_VALIDATOR_COMPILER(go "Enable validator compiler for Go" ON) + # Thrift is looking for include files in the src directory # we also add the current binary directory for generated files include_directories(${CMAKE_CURRENT_BINARY_DIR} ${THRIFT_COMPILER_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/catch) |