[CMake] Different cmake build directories for different build types (#3623) (#3629)

add `CMAKE_BUILD_TYPE` as the suffix of build directory.
This commit is contained in:
sduzh
2020-05-20 21:41:44 +08:00
committed by GitHub
parent 0d66e6bd15
commit 792307ae54
2 changed files with 7 additions and 8 deletions

View File

@ -29,9 +29,6 @@ endif()
project(doris CXX C)
# set CMAKE_BUILD_TYPE
if (DEFINED ENV{BUILD_TYPE})
set(CMAKE_BUILD_TYPE $ENV{BUILD_TYPE})
endif()
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RELEASE)
endif()

View File

@ -154,14 +154,16 @@ cd ${DORIS_HOME}
# Clean and build Backend
if [ ${BUILD_BE} -eq 1 ] ; then
echo "Build Backend"
CMAKE_BUILD_TYPE=${BUILD_TYPE:-Release}
echo "Build Backend: ${CMAKE_BUILD_TYPE}"
CMAKE_BUILD_DIR=${DORIS_HOME}/be/build_${CMAKE_BUILD_TYPE}
if [ ${CLEAN} -eq 1 ]; then
rm -rf ${DORIS_HOME}/be/build/
rm -rf $CMAKE_BUILD_DIR
rm -rf ${DORIS_HOME}/be/output/
fi
mkdir -p ${DORIS_HOME}/be/build/
cd ${DORIS_HOME}/be/build/
${CMAKE_CMD} -DMAKE_TEST=OFF -DWITH_MYSQL=${WITH_MYSQL} -DWITH_LZO=${WITH_LZO} ../
mkdir -p ${CMAKE_BUILD_DIR}
cd ${CMAKE_BUILD_DIR}
${CMAKE_CMD} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DMAKE_TEST=OFF -DWITH_MYSQL=${WITH_MYSQL} -DWITH_LZO=${WITH_LZO} ../
make -j${PARALLEL}
make install
cd ${DORIS_HOME}