提交 d3b45b62 authored 作者: 周尚's avatar 周尚

init

上级
流水线 #214 已取消 于阶段
before_script:
- echo "Before script section"
after_script:
- echo "After script section"
- yes | cp -a lib /usr/data/sharedFolders/
linux:
stage: build
tags:
- linux
script:
- echo "start make linux"
- find /usr/data/sharedFolders/lib/linux -name libAWSQLite* -delete
- sh run.sh linux
hisiv510:
stage: build
tags:
- hisiv510
script:
- echo "start make hisiv510"
- find /usr/data/sharedFolders/lib/hisiv510 -name libAWSQLite* -delete
- sh run.sh hisiv510
# himix200:
# stage: build
# tags:
# - himix200
# script:
# - echo "start make himix200"
# - find /usr/data/sharedFolders/lib/himix200 -name libAWSQLite* -delete
# - sh run.sh himix200
openwrt:
stage: build
tags:
- openwrt
script:
- echo "start make openwrt"
- find /usr/data/sharedFolders/lib/openwrt -name libAWSQLite* -delete
- sh run.sh openwrt
cmake_minimum_required(VERSION 3.0)
project(AW-SQLite)
if (CMAKE_BUILD_TYPE MATCHES "DEBUG")
add_definitions(-g -DDEBUG -rdynamic)
endif()
add_definitions(-D_GNU_SOURCE -std=c11 -Og)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(PROJECT_VERSION_MAJOR 2)
set(PROJECT_VERSION_MINOR 1)
set(PROJECT_VERSION_PATCH 0)
set(PROJECT_RELEASE_CANDIDATE 0)
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
if (NOT PROJECT_RELEASE_CANDIDATE STREQUAL "0")
set(PROJECT_VERSION ${PROJECT_VERSION}-rc${PROJECT_RELEASE_CANDIDATE})
endif()
set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if (${CMAKE_C_COMPILER} MATCHES "hisiv510")
set(PLATFORM "hisiv510")
elseif (${CMAKE_C_COMPILER} MATCHES "himix200")
set(PLATFORM "himix200")
link_directories(/root/lib)
elseif (${CMAKE_C_COMPILER} MATCHES "openwrt")
set(PLATFORM "openwrt")
else()
set(CMAKE_C_COMPILER cc)
set(PLATFORM "linux")
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/${PLATFORM})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib/${PLATFORM})
link_directories(lib/${PLATFORM} /usr/data/sharedFolders/lib/${PLATFORM})
include_directories(include)
aux_source_directory(src _src_dir)
add_library(AWSQLite SHARED ${_src_dir})
target_link_libraries(AWSQLite AWString sqlite3 dl pthread)
add_executable(tests test/tests.c)
target_link_libraries(tests AWSQLite sqlite3)
enable_testing()
add_test(NAME testlist
COMMAND ${PROJECT_SOURCE_DIR}/bin/${PLATFORM}/tests "-l")
add_test(NAME testsql
COMMAND ${PROJECT_SOURCE_DIR}/bin/${PLATFORM}/tests "-s")
set_target_properties(AWSQLite PROPERTIES VERSION ${PROJECT_VERSION})
#!/usr/bin/env bash
set -e
# NOTICE: rsync is required (both client and server)
# config
r_user=root
r_host=192.168.0.82
r_port=10010
r_path="/usr/data/zs/$(basename $(dirname $(realpath $0)))"
PROJECT_DIR=${PWD%/sh}/
cd ${PROJECT_DIR}
if [ -e .git ] && [ -e .gitignore ]; then
cmd="rsync -avzu -e 'ssh -p $r_port' $PROJECT_DIR \"$r_user@$r_host:$r_path\"
--exclude-from=.gitignore --exclude=.git --exclude=Doxyfile --exclude=API.org --exclude=README.org --exclude=.*"
else
cmd="rsync -avzu -e 'ssh -p $r_port' CMakeLists.txt include src lib test tests.db \"$r_user@$r_host:${r_path}\""
fi
echo $cmd
eval $cmd
#!/usr/bin/env bash
USAGE="Usage: $0 Platform (linux/hisiv510/openwrt/himix200)"
usage()
{
echo $USAGE
exit
}
# cross compile system
system[0]="linux"
system[1]="himix200"
system[2]="openwrt"
system[3]="hisiv510"
# projects depended on this lib
# set cmake args
CMAKE_C_COMPILER=
cmake_set_compiler()
{
case $1 in
hisiv510 )
CMAKE_C_COMPILER=arm-hisiv510-linux-gcc
;;
linux )
CMAKE_C_COMPILER=gcc
;;
openwrt )
CMAKE_C_COMPILER=mipsel-openwrt-linux-gcc
;;
himix200 )
CMAKE_C_COMPILER=arm-himix200-linux-gcc
;;
* )
usage
;;
esac
}
cmake_do_it()
{
cmd="find lib/$1 -name libAWString* -delete"
echo $cmd
eval $cmd
cmd="cmake -H. -Bbuild -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_BUILD_TYPE=DEBUG"
echo $cmd
eval $cmd
cmd="cmake --build build --clean-first"
echo $cmd
eval $cmd
}
# cmake_do_all ()
# {
# for sys in ${system[@]}
# do
# echo $sys
# cmake_set_compiler $sys
# cmake_do_it
# done
# }
# cmake_do_all
cmake_set_compiler $1
cmake_do_it $1
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论