Skip to content

Commit 6296d5a

Browse files
shiamiLEOYoon-Tsaw
authored andcommitted
build(build.bat): add command Line option to clean build
Closes rime#343
1 parent f5a9b60 commit 6296d5a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

build.bat

+15-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ if not defined PLATFORM_TOOLSET (
4343
set PLATFORM_TOOLSET=v141_xp
4444
)
4545

46+
set clean=0
4647
set build_dir_base=build
4748
set build_dir_suffix=
4849
set build_config=Release
@@ -57,6 +58,7 @@ set enable_logging=ON
5758

5859
:parse_cmdline_options
5960
if "%1" == "" goto end_parsing_cmdline_options
61+
if "%1" == "clean" set clean=1
6062
if "%1" == "boost" set build_boost=1
6163
if "%1" == "boost_x64" (
6264
set build_boost=1
@@ -97,11 +99,23 @@ shift
9799
goto parse_cmdline_options
98100
:end_parsing_cmdline_options
99101

102+
if %clean% == 0 (
100103
if %build_librime% == 0 (
101104
if %build_boost% == 0 (
102105
if %build_thirdparty% == 0 (
103106
set build_librime=1
104-
)))
107+
))))
108+
109+
if %clean% == 1 (
110+
rmdir /s /q build
111+
rmdir /s /q thirdparty\src\capnproto\build
112+
rmdir /s /q thirdparty\src\glog\cmake-build
113+
rmdir /s /q thirdparty\src\googletest\build
114+
rmdir /s /q thirdparty\src\leveldb\build
115+
rmdir /s /q thirdparty\src\marisa-trie\build
116+
rmdir /s /q thirdparty\src\opencc\build
117+
rmdir /s /q thirdparty\src\yaml-cpp\build
118+
)
105119

106120
set build_dir=%build_dir_base%%build_dir_suffix%
107121

0 commit comments

Comments
 (0)