From 93402309e96c915b6ad979ec0daa3b501ecd85e8 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Thu, 17 Jun 2021 20:01:42 +0200 Subject: added additional CMake variables Signed-off-by: Toni Uhlig --- sdkenv.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'sdkenv.sh') diff --git a/sdkenv.sh b/sdkenv.sh index 5cfdeebcef..3097ef3b53 100755 --- a/sdkenv.sh +++ b/sdkenv.sh @@ -23,7 +23,7 @@ echo "* libc......: ${LIBC}" TOOLCHAIN_DIR="$(realpath ${OWRT}/staging_dir/toolchain-${ARCH}_${CPU_TYPE}_gcc-${GCC_VER}_${LIBC}_*)" echo "* Toolchain.: ${TOOLCHAIN_DIR}" -export PATH="${TOOLCHAIN_DIR}/bin:${PATH}" +export PATH="${TOOLCHAIN_DIR}/bin:${OWRT}/staging_dir/host/bin:${OWRT}/staging_dir/host/usr/bin:${OWRT}/staging_dir/hostpkg/bin:${OWRT}/staging_dir/hostpkg/usr/bin:${PATH}" export STAGING_DIR="${OWRT}/staging_dir" TARGET_DIR="$(realpath ${STAGING_DIR}/target-${ARCH}_${CPU_TYPE}*)" echo "* Target dir: ${TARGET_DIR}" @@ -38,6 +38,23 @@ export PKG_CONFIG="${STAGING_DIR}/host/bin/pkg-config.real" export PKG_CONFIG_PATH="${TARGET_DIR}/usr/lib/pkgconfig" export PKG_CONFIG_LIBDIR="${TARGET_DIR}/usr/lib/pkgconfig" +# CMake variables +export CMAKE_C_COMPILER_AR="${HOST}-ar" +export CMAKE_C_COMPILER_RANLIB="${HOST}-ranlib" +export CMAKE_LINKER="${HOST}-ld" +export CMAKE_NM="${HOST}-nm" +export CMAKE_OBJCOPY="${HOST}-objcopy" +export CMAKE_OBJDUMP="${HOST}-objdump" +export CMAKE_RANLIB="${HOST}-ranlib" +export CMAKE_STRIP="${HOST}-strip" + +export CMAKE_FIND_ROOT_PATH="${OWRT} ${TARGET_DIR} ${TOOLCHAIN_DIR}" +# search for programs in the build host directories +export CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER +# for libraries and headers in the target directories +export CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY +export CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY + # set some optional CGO vars for xcompile export CGO_ENABLED=1 export GO_EXTLINK_ENABLED=1 -- cgit v1.2.3