Skip to content

Commit

Permalink
Better release handling
Browse files Browse the repository at this point in the history
  • Loading branch information
xarkes authored and Anton Kochkov committed Jun 23, 2017
1 parent 1659874 commit 0452dea
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ build_script:
- set
- if %builder% == msvc_cccl_64 ( sys\msvc.bat && make windist WINBITS=%builder% )

- cmd: if %builder% == msvc_ninja_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && meson.bat && sys\meson_install.bat %DIST_FOLDER% && zip -r %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == msvc_ninja_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && meson.bat --release && sys\meson_install.bat %DIST_FOLDER% && zip -r %ARTIFACT_ZIP% %DIST_FOLDER% )

- cmd: if %builder% == mingw32 ( sys\mingw32.bat && sh -c "export PATH=%EXP_PATH%:${PATH}; make windist WINBITS=%builder% ZIPNAME=%ARTIFACT_ZIP%" )

Expand Down
51 changes: 35 additions & 16 deletions meson.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
@ECHO OFF

SET BACKEND=ninja
SET REGEN=
SET RELEASE=
SET BUILDDIR=build

:PARSEARGS
IF NOT "%1"=="" (
IF "%1"=="-p" (
SET BACKEND=vs2015
)
IF "%1"=="-p2" (
SET BACKEND=vs2017
)
IF "%1"=="-r" (
SET REGEN=1
)
IF "%1"=="--release" (
SET RELEASE=--buildtype=release
)
SHIFT
GOTO PARSEARGS
)

IF EXIST shlr\capstone GOTO START
ECHO [ R2 MESON CLONING CAPSTONE ]
git clone -b next --depth 10 http://github.com/aquynh/capstone.git shlr\capstone
Expand All @@ -8,31 +32,26 @@ git apply ..\capstone-patches\add-mips2.patch
cd ..\..

:START
IF "%1"=="-p" GOTO BUILDPROJECT
IF "%1"=="-p2" GOTO BUILDPROJECT2
IF "%1"=="-r" GOTO REBUILD
IF EXIST build GOTO BUILD
python meson.py --prefix=%CD% build
IF NOT "%RELEASE%"=="" ECHO [ R2 MESON BUILD: RELEASE ]
IF "%REGEN%"=="1" GOTO REBUILD
IF NOT "%BACKEND%"=="ninja" GOTO BUILDPROJECT

IF EXIST %BUILDDIR% GOTO BUILD
python meson.py --prefix=%CD% %BUILDDIR% %RELEASE%

:BUILD
ECHO [ R2 MESON NINJA BUILD ]
copy shlr\spp\config.def.h shlr\spp\config.h
ninja -C build
ninja -C %BUILDDIR%
exit /b %errorlevel%

:BUILDPROJECT
ECHO [ R2 MESON BUILDING VS2015 SLN]
IF EXIST build rd /s /q build
python meson.py --prefix=%CD% build --backend=vs2015
GOTO EXIT

:BUILDPROJECT2
ECHO [ R2 MESON BUILDING VS2017 SLN]
IF EXIST build rd /s /q build
python meson.py --prefix=%CD% build --backend=vs2017
ECHO [ R2 MESON BUILDING %BACKEND% SLN]
IF EXIST %BUILDDIR% rd /s /q %BUILDDIR%
python meson.py --prefix=%CD% %BUILDDIR% --backend=%BACKEND% %RELEASE%
GOTO EXIT

:REBUILD
python.exe meson.py --internal regenerate %CD% "%CD%\build" --backend ninja
python.exe meson.py --internal regenerate %CD% "%CD%\%BUILDDIR%" --backend %BACKEND% %RELEASE%

:EXIT
6 changes: 4 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ if host_machine.system() == 'windows'
#platform_deps = [cc.find_library('ws2_32')]
platform_inc = include_directories(['.','../libr/include','../libr/include/msvc'])
host_os = 'windows'
# Add /MT flag to add necessary runtimes into libraries/executables.
add_global_arguments('/MT', language: 'c')
if get_option('buildtype') == 'release'
# Add /MT flag to add necessary runtimes into libraries/executables.
add_global_arguments('/MT', language: 'c')
endif
endif

# load plugin configuration
Expand Down

0 comments on commit 0452dea

Please sign in to comment.