Browse Source

nicer build

master
Arwed Mett 3 years ago
parent
commit
fdff422ab9
Signed by: Pfeifenjoy GPG Key ID: 86943827297DA9FC
  1. 72
      .core.yml
  2. 7
      CMakeLists.txt
  3. 9
      Dockerfile

72
.core.yml

@ -4,46 +4,46 @@ name: default
steps:
- name: build
image: pfeifenjoy/logging.h
commands:
- mkdir build
- cd build
- cmake ..
- cmake --build .
- cd ..
image: pfeifenjoy/logging.h
commands:
- mkdir build
- cd build
- cmake ..
- cmake --build .
- cd ..
- name: test
image: pfeifenjoy/logging.h
commands:
- cd build
- ctest --verbose .
- cd ..
image: pfeifenjoy/logging.h
commands:
- cd build
- ctest --verbose .
- cd ..
- name: memcheck
image: pfeifenjoy/logging.h
commands:
- valgrind --leak-check=yes --error-exitcode=1 ./build/example
image: pfeifenjoy/logging.h
commands:
- valgrind --leak-check=yes --error-exitcode=1 ./build/example
- name: package
image: pfeifenjoy/logging.h
commands:
- cd build
- cpack .
- cd ..
- name: linux
image: pfeifenjoy/logging.h
commands:
- cmake --config Release -H. -Bbuild/linux64
- cmake --build build/linux64 --target package
- name: gitea_release
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_token
base_url: https://gitea.metthub.de
files: build/logging.h-*
checksum:
- md5
- sha1
- sha256
- sha512
- adler32
- crc32
when:
event: tag
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_token
base_url: https://gitea.metthub.de
files:
- build/linux64/logging.h-*
checksum:
- md5
- sha1
- sha256
- sha512
- adler32
- crc32
when:
event: tag

7
CMakeLists.txt

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.5)
project(logging.h LANGUAGES C)
message(STATUS ${CMAKE_SYSTEM_NAME})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
include(git)
@ -11,8 +12,10 @@ target_include_directories(Logging PUBLIC
$<INSTALL_INTERFACE:include>
)
add_executable(example example/main.c)
target_link_libraries(example Logging)
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_executable(example example/main.c)
target_link_libraries(example Logging)
endif()
#Install
install(TARGETS Logging EXPORT LoggingTargets

9
Dockerfile

@ -1,3 +1,8 @@
FROM gcc
FROM debian
WORKDIR /
RUN apt update
RUN apt -y install cmake valgrind git rpm
RUN apt -y install gcc
RUN apt -y install cmake
RUN apt -y install valgrind
RUN mkdir /working-dir
WORKDIR /working-dir
Loading…
Cancel
Save