From 302ebce6ac05f527852c8fc721487758b602d144 Mon Sep 17 00:00:00 2001 From: canxin Date: Fri, 29 Mar 2024 10:00:25 +0800 Subject: [PATCH] fix permisssion in cmake and gradle --- cmake/cargokit.cmake | 4 +++- gradle/plugin.gradle | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/cargokit.cmake b/cmake/cargokit.cmake index 8832600..ddd05df 100644 --- a/cmake/cargokit.cmake +++ b/cmake/cargokit.cmake @@ -50,6 +50,7 @@ function(apply_cargokit target manifest_dir lib_name any_symbol_name) else() set(SCRIPT_EXTENSION ".sh") set(IMPORT_LIB_EXTENSION "") + execute_process(COMMAND chmod +x "${cargokit_cmake_root}/run_build_tool${SCRIPT_EXTENSION}") endif() # Using generators in custom command is only supported in CMake 3.20+ @@ -75,6 +76,7 @@ function(apply_cargokit target manifest_dir lib_name any_symbol_name) ) endif() + set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/_phony_" PROPERTIES SYMBOLIC TRUE) if (TARGET ${target}) @@ -94,4 +96,4 @@ function(apply_cargokit target manifest_dir lib_name any_symbol_name) # Allow adding the output library to plugin bundled libraries set("${target}_cargokit_lib" ${OUTPUT_LIB} PARENT_SCOPE) -endfunction() \ No newline at end of file +endfunction() diff --git a/gradle/plugin.gradle b/gradle/plugin.gradle index a9a6ec7..12c49f1 100644 --- a/gradle/plugin.gradle +++ b/gradle/plugin.gradle @@ -55,7 +55,13 @@ abstract class CargoKitBuildTask extends DefaultTask { def manifestDir = Paths.get(project.buildscript.sourceFile.parent, project.cargokit.manifestDir) def rootProjectDir = project.rootProject.projectDir - + + if (!Os.isFamily(Os.FAMILY_WINDOWS)) { + project.exec { + commandLine 'chmod', '+x', path + } + } + project.exec { executable path args "build-gradle"