mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
cmake:
- install cmake configfile for host and target build - cosmetics
This commit is contained in:
parent
be560907dd
commit
c2ed3538e4
@ -162,6 +162,10 @@ setup_toolchain() {
|
|||||||
export CXXFLAGS="$TARGET_CXXFLAGS"
|
export CXXFLAGS="$TARGET_CXXFLAGS"
|
||||||
export LDFLAGS="$TARGET_LDFLAGS"
|
export LDFLAGS="$TARGET_LDFLAGS"
|
||||||
export PKG_CONFIG_PATH="$TARGET_PKG_CONFIG_PATH"
|
export PKG_CONFIG_PATH="$TARGET_PKG_CONFIG_PATH"
|
||||||
|
|
||||||
|
# set CMAKE configfile for target
|
||||||
|
export CMAKE_CONF=$ROOT/$TOOLCHAIN/etc/cmake-$TARGET_NAME.conf
|
||||||
|
|
||||||
elif [ "$1" = host ]; then
|
elif [ "$1" = host ]; then
|
||||||
export AWK=$HOST_AWK
|
export AWK=$HOST_AWK
|
||||||
export CC=$HOST_CC
|
export CC=$HOST_CC
|
||||||
@ -178,6 +182,10 @@ setup_toolchain() {
|
|||||||
export CXXFLAGS="$HOST_CXXFLAGS"
|
export CXXFLAGS="$HOST_CXXFLAGS"
|
||||||
export LDFLAGS="$HOST_LDFLAGS"
|
export LDFLAGS="$HOST_LDFLAGS"
|
||||||
export PKG_CONFIG_PATH="$HOST_PKG_CONFIG_PATH"
|
export PKG_CONFIG_PATH="$HOST_PKG_CONFIG_PATH"
|
||||||
|
|
||||||
|
# set CMAKE configfile for host
|
||||||
|
export CMAKE_CONF=$ROOT/$TOOLCHAIN/etc/cmake-$HOST_NAME.conf
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
setup_toolchain target
|
setup_toolchain target
|
||||||
|
@ -2,9 +2,53 @@
|
|||||||
|
|
||||||
. config/options
|
. config/options
|
||||||
|
|
||||||
cp $PKG_BUILD/bin/cmake \
|
mkdir -p $ROOT/$TOOLCHAIN/bin
|
||||||
$PKG_BUILD/bin/cpack \
|
cp -P $PKG_BUILD/bin/cmake $ROOT/$TOOLCHAIN/bin
|
||||||
$PKG_BUILD/bin/ctest \
|
cp -P $PKG_BUILD/bin/cpack $ROOT/$TOOLCHAIN/bin
|
||||||
$ROOT/$TOOLCHAIN/bin
|
cp -P $PKG_BUILD/bin/ctest $ROOT/$TOOLCHAIN/bin
|
||||||
|
|
||||||
# $PKG_BUILD/bin/ccmake \
|
mkdir -p $ROOT/$TOOLCHAIN/etc
|
||||||
|
|
||||||
|
cat >$ROOT/$TOOLCHAIN/etc/cmake-$TARGET_NAME.conf <<EOF
|
||||||
|
# this one is important
|
||||||
|
SET(CMAKE_SYSTEM_NAME Linux)
|
||||||
|
#this one not so much
|
||||||
|
SET(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
|
||||||
|
# specify the cross compiler
|
||||||
|
SET(CMAKE_C_COMPILER $TARGET_CC)
|
||||||
|
SET(CMAKE_CXX_COMPILER $TARGET_CXX)
|
||||||
|
|
||||||
|
# where is the target environment
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH $SYSROOT_PREFIX)
|
||||||
|
|
||||||
|
# search for programs in the build host directories
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
|
||||||
|
# for libraries and headers in the target directories
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat >$ROOT/$TOOLCHAIN/etc/cmake-$HOST_NAME.conf <<EOF
|
||||||
|
# this one is important
|
||||||
|
SET(CMAKE_SYSTEM_NAME Linux)
|
||||||
|
#this one not so much
|
||||||
|
SET(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
|
||||||
|
# specify the host compiler
|
||||||
|
SET(CMAKE_C_COMPILER $HOST_CC)
|
||||||
|
SET(CMAKE_CXX_COMPILER $HOST_CXX)
|
||||||
|
|
||||||
|
# where is the target environment
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH $ROOT/$TOOLCHAIN)
|
||||||
|
|
||||||
|
# search for programs in the build host directories
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
|
||||||
|
|
||||||
|
# for libraries and headers in the target directories
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
|
||||||
|
|
||||||
|
EOF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user