lidavidm commented on code in PR #2738: URL: https://github.com/apache/arrow-adbc/pull/2738#discussion_r2065217506
########## c/cmake_modules/GoUtils.cmake: ########## @@ -135,10 +135,20 @@ function(add_go_lib GO_MOD_DIR GO_LIBNAME) "${GO_BUILD_FLAGS} $<$<CONFIG:DEBUG>:-gcflags=\"-N -l\">") # if we're building debug mode then change the default CGO_CFLAGS and CGO_CXXFLAGS from "-g O2" to "-g3" - set(GO_ENV_VARS - "CGO_ENABLED=1 $<$<CONFIG:DEBUG>:CGO_CFLAGS=-g3> $<$<CONFIG:DEBUG>:CGO_CXXFLAGS=-g3>" - ) - separate_arguments(GO_ENV_VARS NATIVE_COMMAND "${GO_ENV_VARS}") + set(GO_FLAGS) + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(GO_FLAGS "-g3") + endif() + string(JOIN " " GO_FLAGS "${GO_FLAGS}") + + foreach(DEFINE ${ARG_DEFINES}) + list(APPEND GO_FLAGS "-D${DEFINE}") + endforeach() + + set(GO_ENV_VARS) + list(APPEND GO_ENV_VARS "CGO_ENABLED=1") + list(APPEND GO_ENV_VARS "CGO_CFLAGS=\"${GO_FLAGS}\"") + list(APPEND GO_ENV_VARS "CGO_CXXFLAGS=\"${GO_FLAGS}\"") Review Comment: But the escape isn't for `cmake -E env`, it's to escape the nested quotes -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org