提交 5427a67c 编写于 作者: M Megvii Engine Team

fix(cmake/subdirectory): fix project import by other sdk by add-subdirectory

notice: if you are cross build, please follow step
----
define SRC_DIR you sdk root dir
SRC_DIR=$($READLINK -f "`dirname $0`")
source $SRC_DIR/megbrain/scripts/cmake-build/utils/utils.sh
build_flatc $SRC_DIR/megbrain false

your build code
----

GitOrigin-RevId: ad97860f5ffc1128a8c177f0822c02e240634716
上级 241b35a6
......@@ -7,7 +7,7 @@
# MGB_VER_STRING: Version string
option(MGB_FORCE_DEV_VERSION "Force -dev tag in version stamp" OFF)
file (READ "${CMAKE_SOURCE_DIR}/src/core/include/megbrain/version.h" content)
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/src/core/include/megbrain/version.h" content)
string (REGEX MATCH "MGB_MAJOR +([0-9]+)" _ ${content})
set (MGB_VER_MAJOR ${CMAKE_MATCH_1})
......
......@@ -15,6 +15,7 @@ if [ $OS = "Darwin" ];then
READLINK=greadlink
fi
PROJECT_DIR=$(dirname "${BASH_SOURCE[0]}")/../../../
function cd_real_build_dir() {
REAL_DIR=$($READLINK -f $1)
echo "may alias dir: $1"
......@@ -46,7 +47,7 @@ function build_flatc() {
-DFLATBUFFERS_BUILD_FLATHASH=OFF \
-DFLATBUFFERS_BUILD_FLATLIB=OFF \
-DFLATBUFFERS_LIBCXX_WITH_CLANG=OFF \
$SRC_DIR/third_party/flatbuffers
${PROJECT_DIR}/third_party/flatbuffers
${NINJA_BASE} all
${NINJA_BASE} install/strip
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册