Skip to content

Commit

Permalink
refactor(xcode.mk, build.bat): install distributables to dist/
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed May 22, 2019
1 parent 821d563 commit 4695691
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
build/
build-static/
debug/
dist/
build.log
data/*
thirdparty/include/*
Expand Down
9 changes: 4 additions & 5 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ shift
goto parse_cmdline_options
:end_parsing_cmdline_options

set DIST_DIR=%RIME_ROOT%\dist
set THIRDPARTY=%RIME_ROOT%\thirdparty

rem set CURL=%THIRDPARTY%\bin\curl.exe
Expand Down Expand Up @@ -197,7 +198,8 @@ set RIME_CMAKE_FLAGS=-G%CMAKE_GENERATOR%^
-DBUILD_TEST=%build_test%^
-DENABLE_LOGGING=%enable_logging%^
-DBOOST_USE_CXX11=ON^
-DCMAKE_CONFIGURATION_TYPES="Release"
-DCMAKE_CONFIGURATION_TYPES="Release"^
-DCMAKE_INSTALL_PREFIX:PATH="%DIST_DIR%"

cd /d %RIME_ROOT%
echo cmake %RIME_ROOT% -B%build% %RIME_CMAKE_FLAGS%
Expand All @@ -206,12 +208,9 @@ if %ERRORLEVEL% NEQ 0 goto ERROR

echo.
echo building librime.
cmake --build build --config Release
cmake --build build --config Release --target INSTALL
if %ERRORLEVEL% NEQ 0 goto ERROR

mkdir build\include
copy /y src\*.h build\include

echo.
echo ready.
echo.
Expand Down
13 changes: 11 additions & 2 deletions xcode.mk
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
RIME_ROOT = $(CURDIR)

RIME_DIST_DIR = $(RIME_ROOT)/dist

RIME_COMPILER_OPTIONS = CC=clang CXX=clang++ \
CXXFLAGS="-stdlib=libc++" LDFLAGS="-stdlib=libc++"

.PHONY: all release debug clean test thirdparty
.PHONY: all release debug clean distclean test thirdparty

all: release

release:
cmake . -Bbuild -GXcode \
-DBUILD_STATIC=ON \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DCMAKE_INSTALL_PREFIX="$(RIME_DIST_DIR)"
cmake --build build --config Release

debug:
Expand All @@ -26,6 +29,12 @@ clean:
rm -f thirdparty/lib/* > /dev/null 2>&1 || true
make -f thirdparty.mk clean-src

dist: release
cmake --build build --config Release --target install

distclean: clean
rm -rf "$(RIME_DIST)" > /dev/null 2>&1 || true

test: release
(cd build/test; LD_LIBRARY_PATH=../lib/Release Release/rime_test)

Expand Down

0 comments on commit 4695691

Please sign in to comment.