File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,8 +180,7 @@ val compileGrammarNative by tasks.registering {
180180 val cmakeEnv = mapOf (" JAVA_HOME" to javaHome)
181181 val configure = ProcessBuilder (
182182 " cmake" , srcDir.path,
183- " -DCMAKE_BUILD_TYPE=Release" ,
184- " -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${cmakeBuildDir.path} "
183+ " -DCMAKE_BUILD_TYPE=Release"
185184 )
186185 .directory(cmakeBuildDir)
187186 .inheritIO()
@@ -200,10 +199,16 @@ val compileGrammarNative by tasks.registering {
200199
201200 val libFile = cmakeBuildDir.resolve(nativeGrammarLibName)
202201 if (! libFile.exists()) {
203- throw GradleException (
204- " Native grammar library was not produced at expected path: ${libFile} . " +
205- " cmake exited successfully but the output file is missing."
206- )
202+ val found = cmakeBuildDir.walkTopDown().maxDepth(3 ).find { it.name == nativeGrammarLibName }
203+ if (found != null ) {
204+ found.copyTo(libFile, overwrite = true )
205+ logger.lifecycle(" Copied native grammar library from {} to {}" , found, libFile)
206+ } else {
207+ throw GradleException (
208+ " Native grammar library was not produced at expected path: ${libFile} . " +
209+ " Searched subdirectories up to 3 levels deep. cmake exited successfully but output is missing."
210+ )
211+ }
207212 }
208213 }
209214}
You can’t perform that action at this time.
0 commit comments