Cross compile libconfig.
This commit is contained in:
parent
339466aecf
commit
0ad532315c
8
external/gtest/build_gtest.sh
vendored
8
external/gtest/build_gtest.sh
vendored
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#编译gtest库
|
#编译gtest库
|
||||||
platform=$1
|
platform=$1
|
||||||
CMAKE_SOURCE_DIR=$2
|
PLATFORM_PATH=$2
|
||||||
PLATFORM_SOURCE_DIR=$3
|
PLATFORM_SOURCE_DIR=$3
|
||||||
echo "Compile gtest, platform = $platform, platform source dir = $PLATFORM_SOURCE_DIR."
|
echo "Compile gtest, platform = $platform, platform source dir = $PLATFORM_SOURCE_DIR."
|
||||||
export ROOT_PATH=$PWD
|
export ROOT_PATH=$PWD
|
||||||
|
@ -18,12 +18,12 @@ if [ ! -f "./googletest-release-1.11.0/googlemock/lib/libgtest.a" ] || [ ! -f ".
|
||||||
case $platform in
|
case $platform in
|
||||||
"linux")
|
"linux")
|
||||||
echo "==Compile linux."
|
echo "==Compile linux."
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_SOURCE_DIR/build/cmake/toolchain/linux.toolchain.cmake .
|
cmake -DCMAKE_TOOLCHAIN_FILE=$PLATFORM_PATH/build/cmake/toolchain/linux.toolchain.cmake .
|
||||||
make
|
make
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "==Compile gtest v2."
|
echo "==Compile gtest v2. cmke file $PLATFORM_PATH"
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE=$PLATFORM_SOURCE_DIR/build/cmake/toolchain/linux.toolchain.cmake .
|
cmake -DCMAKE_TOOLCHAIN_FILE=$PLATFORM_PATH/build/cmake/toolchain/linux.toolchain.cmake .
|
||||||
make
|
make
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
9
external/libconfig/build_libconfig.sh
vendored
9
external/libconfig/build_libconfig.sh
vendored
|
@ -1,10 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#compile libconfig to a library
|
#compile libconfig to a library
|
||||||
platform=$1
|
platform=$1
|
||||||
CROSS_COMPILER_PATH=$2
|
COMPILE_HOST=$2
|
||||||
CROSS_COMPILER=$3
|
|
||||||
echo "Compile libconfig, platform = $platform."
|
echo "Compile libconfig, platform = $platform."
|
||||||
echo "CROSS_COMPILER = $CROSS_COMPILER"
|
echo "COMPILE_HOST = $COMPILE_HOST"
|
||||||
echo "Start to compile libconfig."
|
echo "Start to compile libconfig."
|
||||||
export ROOT_PATH=$PWD
|
export ROOT_PATH=$PWD
|
||||||
if [ ! -d "./libconfig-1.7.3" ];then
|
if [ ! -d "./libconfig-1.7.3" ];then
|
||||||
|
@ -21,8 +20,8 @@ if [ ! -f "./libconfig-1.7.3/lib/.libs/libconfig++.a" ] || [ ! -f "./libconfig-1
|
||||||
make
|
make
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "==Compile cross compile."
|
echo "==Compile cross compile. compiler = $COMPILE_HOST"
|
||||||
./configure --host=$CROSS_COMPILER --disable-cxx --enable-static=yes
|
./configure --host=$COMPILE_HOST --disable-cxx --enable-static=yes
|
||||||
make
|
make
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEST_LINUX_MOCK}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEST_LINUX_MOCK}")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEST_LINUX_MOCK}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEST_LINUX_MOCK}")
|
||||||
# Compile gtest for test code.
|
# Compile gtest for test code.
|
||||||
execute_process(COMMAND sh build_gtest.sh ${TARGET_PLATFORM} ${CMAKE_SOURCE_DIR_IPCSDK} ${PLATFORM_PATH} WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/gtest/)
|
execute_process(COMMAND sh build_gtest.sh ${TARGET_PLATFORM} ${PLATFORM_PATH} ${PLATFORM_PATH} WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/gtest/)
|
||||||
# add_subdirectory(test_utils)
|
# add_subdirectory(test_utils)
|
||||||
add_subdirectory(middleware)
|
add_subdirectory(middleware)
|
||||||
add_subdirectory(utils)
|
add_subdirectory(utils)
|
||||||
|
|
|
@ -46,10 +46,10 @@ endif()
|
||||||
# build libconfig before make libConfig.a
|
# build libconfig before make libConfig.a
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${EXTERNAL_SOURCE_PATH}/libconfig/libconfig-1.7.3/lib/.libs/libconfig.a
|
OUTPUT ${EXTERNAL_SOURCE_PATH}/libconfig/libconfig-1.7.3/lib/.libs/libconfig.a
|
||||||
COMMAND echo "Build libconfig-1.7.3. CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}"
|
COMMAND echo "Build libconfig-1.7.3. COMPILE_HOST = ${COMPILE_HOST}"
|
||||||
# COMMAND tar zxvf libconfig-1.7.3.tar.gz
|
# COMMAND tar zxvf libconfig-1.7.3.tar.gz
|
||||||
COMMAND sh build_libconfig.sh ${TARGET_PLATFORM} ${CROSS_COMPILER_PATH} ${CMAKE_C_COMPILER}
|
COMMAND sh build_libconfig.sh ${TARGET_PLATFORM} ${COMPILE_HOST}
|
||||||
WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/libconfig
|
WORKING_DIRECTORY ${EXTERNAL_SOURCE_PATH}/libconfig/
|
||||||
)
|
)
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
libconfig.a
|
libconfig.a
|
||||||
|
|
Loading…
Reference in New Issue
Block a user