Skip to content

Commit cd4841a

Browse files
committed
[C/C++] Allow overriding Gradle wrapper location.
Fixes #1091.
1 parent a4c1ca1 commit cd4841a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,16 @@ file(GLOB_RECURSE SBE_SOURCES
137137
"${CMAKE_CURRENT_SOURCE_DIR}/sbe-tool/src/main/java/*.java"
138138
)
139139

140+
if (NOT DEFINED GRADLE_WRAPPER)
141+
if (MSVC)
142+
set(GRADLE_WRAPPER "gradlew.bat" CACHE INTERNAL "Location of the Gradle wrapper script")
143+
else ()
144+
set(GRADLE_WRAPPER "./gradlew" CACHE INTERNAL "Location of the Gradle wrapper script")
145+
endif ()
146+
endif ()
147+
140148
add_custom_command(OUTPUT ${SBE_JAR}
141-
COMMAND ./gradlew assemble -x javadoc --console=plain
149+
COMMAND ${GRADLE_WRAPPER} assemble -x javadoc --console=plain
142150
DEPENDS ${SBE_SOURCES}
143151
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
144152
COMMENT "Generating SBE jar"

0 commit comments

Comments
 (0)