simon0-o commented on code in PR #2469:
URL: https://github.com/apache/thrift/pull/2469#discussion_r939937878


##########
compiler/cpp/CMakeLists.txt:
##########
@@ -71,35 +73,50 @@ 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 "src/thrift/generate/${name}_validator_generator.cc")
+    list(APPEND "src/thrift/generate/${name}_validator_generator.h")
+    option(${enabler} ${description} ${initial})
+    if(${enabler})
+        list(APPEND thrift-compiler_SOURCES ${src})

Review Comment:
   > it seems to me that if someone tries to disable 
`THRIFT_VALIDATOR_COMPILER_go` it will also disable `THRIFT_COMPILER_go`
   
   Actually, it won't enable/disable `THRIFT_COMPILER_go`, `enabler` is a local 
variable, and also the `src`. `THRIFT_ADD_VALIDATOR_COMPILER` will check if 
`initial` is `ON`, if it is `THRIFT_ADD_VALIDATOR_COMPILER` will add 
"src/thrift/generate/${name}_validator_generator.cc" and 
"src/thrift/generate/${name}_validator_generator.h" to compiler source files.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to