diff --git a/CMakeLists.txt b/CMakeLists.txt index 4866b1cb3f8a7c32d3a0ad61360a89487614d755..db638532b275ffc6183b8dd56008cf47ec0efdee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,12 @@ cmake_minimum_required(VERSION 3.20.0) -include(cmake/Utils.cmake) -include(cmake/Env.cmake) +if(BUILD_AS_MAIN_PROJECT) + message(STATUS "drcmsg build as main project") + include(cmake/Utils.cmake) + include(cmake/Env.cmake) +else() + message(STATUS "drcmsg build as sub project") +endif() project(oblogmsg VERSION 3.2.1) diff --git a/build.sh b/build.sh index 0aa88a23337f064b183f7eb95782a1836dfb236a..977de31e278f7a005a656d7769bfa30ace2c3562 100755 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ BUILD_SH=$TOPDIR/build.sh ALL_ARGS=("$@") DEP_DIR=${TOPDIR}/deps/3rd/usr/local/oceanbase/deps/devel TOOLS_DIR=${TOPDIR}/deps/3rd/usr/local/oceanbase/devtools -CMAKE_COMMAND="${TOOLS_DIR}/bin/cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1" +CMAKE_COMMAND="${TOOLS_DIR}/bin/cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DBUILD_AS_MAIN_PROJECT=ON" echo "$0 ${ALL_ARGS[@]}" @@ -137,4 +137,4 @@ function main esac } -main "$@" \ No newline at end of file +main "$@"