2018-11-10 12:10:26 +00:00
|
|
|
$dist = $args[0]
|
|
|
|
$python = Split-Path((Get-Command python.exe).Path)
|
|
|
|
|
2021-01-16 10:48:31 +00:00
|
|
|
if (-not (Test-Path -Path 'jsdec' -PathType Container)) {
|
2024-02-24 15:55:19 +00:00
|
|
|
git clone https://github.com/rizinorg/jsdec.git --depth 1 --branch "dev"
|
2020-10-03 10:50:57 +00:00
|
|
|
}
|
2021-01-16 10:48:31 +00:00
|
|
|
cd jsdec
|
2024-02-24 15:55:19 +00:00
|
|
|
$jsdecdir = (Get-Item .).FullName
|
|
|
|
|
|
|
|
& meson.exe setup --buildtype=release -Dbuild_type=cutter "$jsdecdir\build_lib"
|
|
|
|
ninja -C "$jsdecdir\build_lib"
|
|
|
|
|
|
|
|
# cmake is silly and expects .lib but meson generates the static lib as .a
|
|
|
|
Copy-Item "$jsdecdir\build_lib\libjsdec.a" -Destination "$jsdecdir\build_lib\jsdec.lib"
|
|
|
|
|
|
|
|
mkdir build_plugin
|
|
|
|
cd build_plugin
|
|
|
|
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DJSDEC_BUILD_DIR="$jsdecdir\build_lib" -DCMAKE_INSTALL_PREFIX="$dist" $cmake_opts "$jsdecdir\cutter-plugin"
|
|
|
|
ninja install
|
|
|
|
|
2021-11-23 18:25:20 +00:00
|
|
|
$ErrorActionPreference = 'Stop'
|
2024-02-24 15:55:19 +00:00
|
|
|
$pathdll = "$dist\share\rizin\cutter\plugins\native\jsdec_cutter.dll"
|
2021-11-23 18:25:20 +00:00
|
|
|
if(![System.IO.File]::Exists($pathdll)) {
|
2024-02-24 15:55:19 +00:00
|
|
|
echo "files: $dist\share\rizin\cutter\plugins\native\"
|
|
|
|
ls "$dist\share\rizin\cutter\plugins\native\"
|
2021-11-23 18:25:20 +00:00
|
|
|
throw (New-Object System.IO.FileNotFoundException("File not found: $pathdll", $pathdll))
|
|
|
|
}
|