Skip to content

Commit

Permalink
Merge branch 'release-0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
kohnech committed Dec 30, 2019
2 parents 2643222 + 7c5b64f commit 8922780
Show file tree
Hide file tree
Showing 122 changed files with 5,917 additions and 2,352 deletions.
93 changes: 86 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,103 @@ version: 2
jobs:
build:
docker:
- image: heliconwave/circleci:latest
- image: heliconwave/cplusplusdev:latest
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Print Container Metadata
command: lsb_release -a
- run:
name: Build CMake Debug
command: rm -rf build/ && mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . -- -j$(nproc)
command: mkdir Debug && cd Debug/ && cmake -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . -- -j$(nproc)
- run:
name: Build CMake Release
command: rm -rf build/ && mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build . -- -j$(nproc)
command: mkdir Release && cd Release/ && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=YES -DENABLE_TESTS=OFF .. && cmake --build . -- -j$(nproc)
- run:
name: Component Tests
command: cd build && make component-tests
name: Creating Artifacts
command:
cpack --version &&
echo "include(\"Release/CPackConfig.cmake\")" > CPackConfig.cmake &&
echo "set(CPACK_INSTALL_CMAKE_PROJECTS" >> CPackConfig.cmake &&
echo " \"Debug;mpeg2ts;ALL;/\"" >> CPackConfig.cmake &&
echo " \"Release;mpeg2ts;ALL;/\"" >> CPackConfig.cmake &&
echo " )" >> CPackConfig.cmake &&
cat CPackConfig.cmake &&
cpack --config CPackConfig.cmake
- store_artifacts:
path: /root/project/mpeg2ts-0.5.0-Linux.tar.gz
- persist_to_workspace:
root: /root/project
paths:
- Debug
- Release
# build-webassembly:
# docker:
# - image: heliconwave/emscripten:latest
# steps:
# - checkout
# - run:
# name: Build CMake WebAssembly
# command: cd /root/project && em++ --version && pwd && rm -rf build/ && mkdir build && cd build/ && emcmake cmake -DCMAKE_CXX_STANDARD=11 -DENABLE_TESTS=OFF -DENABLE_WEBASSEMBLY=ON .. && cmake --build . -- -j$(nproc)
test-unit:
docker:
- image: heliconwave/cplusplus:latest
working_directory: ~/project
steps:
- checkout
- attach_workspace:
at: /root/project
- run:
name: Run CTest
command: cd build && make unit-tests
command: pwd && ls -ltrha && cd Debug/ && make unit-tests
test-component:
docker:
- image: heliconwave/cplusplus:latest
working_directory: ~/project
steps:
- checkout
- attach_workspace:
at: /root/project
- run:
name: Component Tests
command: cd Debug/ && make component-tests
test-benchmark:
docker:
- image: heliconwave/cplusplus:latest
steps:
- checkout
- attach_workspace:
at: /root/project
- run:
name: Run micro benchmark
command: cd Debug/ && make benchmark-tests
test-memcheck:
docker:
- image: heliconwave/cplusplus:latest
steps:
- checkout
- attach_workspace:
at: /root/project
- run:
name: Run micro benchmark
command: cd build && make benchmark-tests
command: cd Debug/ && ctest -T memcheck
workflows:
version: 2
build-test-and-deploy:
jobs:
- build
# - build-webassembly
- test-unit:
requires:
- build
- test-component:
requires:
- build
- test-benchmark:
requires:
- build
- test-memcheck:
requires:
- build
19 changes: 19 additions & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: C/C++ CI

on: [push]

jobs:
build:
name: building
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: check versions
run: cmake --version
- name: cmake configure
run : mkdir build; cd build; cmake -DENABLE_COMPONENT_TESTS=OFF ..
- name: cmake build
run: cd build/; ls; pwd; cmake --build .
21 changes: 21 additions & 0 deletions .vscode/cmake-kits.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
[
{
"name": "Linux-GCC-7.3.0-GTest",
"cmakeSettings": {
"ENABLE_TESTS": "ON",
"BUILD_SHARED_LIBS": "OFF"
},
"compilers" : {
"CXX": "/usr/bin/g++-7"
}
},
{
"name": "Linux-GCC-7.3.0-Release",
"cmakeSettings": {
"ENABLE_TESTS": "OFF",
"BUILD_SHARED_LIBS": "ON",
"DCMAKE_BUILD_TYPE": "Release"
},
"compilers" : {
"CXX": "/usr/bin/g++-7"
}
},
{
"name": "Windows-SharedLib-VS2017-x64",
"cmakeSettings": {
Expand Down
184 changes: 105 additions & 79 deletions 3rd-party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
#*****************************************************************
#
# Copyright © 2017-2020 kohnech, lnwhome All rights reserved
#
# mpeg2ts - mpeg2ts 3rd-party
#
# This file is part of mpeg2ts (Mpeg2 Transport Stream Library).
#
# Unless you have obtained mpeg2ts under a different license,
# this version of mpeg2ts is mpeg2ts|GPL.
# Mpeg2ts|GPL is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
#
# Mpeg2ts|GPL is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mpeg2ts|GPL; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
#*******************************************************************/
cmake_minimum_required(VERSION 3.0)
project(3rd-party)
set(PLOG_VERSION 1.1.4)
Expand Down Expand Up @@ -38,87 +64,87 @@ ExternalProject_Add(
#-------------------------------------------------------------
# Taken from https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project
#-------------------------------------------------------------

if(NOT USE_DOCKER)
message("NOT using Docker! Downloading & configuring google test...")

# Download and unpack googletest at configure time
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_googletest.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download )
if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download )
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()

# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

# Add googletest directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest-src
${CMAKE_CURRENT_SOURCE_DIR}/googletest-build
EXCLUDE_FROM_ALL)

# The gtest/gtest_main targets carry header search path
# dependencies automatically when using CMake 2.8.11 or
# later. Otherwise we have to add them here ourselves.
if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include")
endif()
endif(NOT USE_DOCKER)
if(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY)
message("NOT using Docker! Downloading & configuring google test...")

# Download and unpack googletest at configure time
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_googletest.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download
)
if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download )
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()

# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

# Add googletest directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest-src
${CMAKE_CURRENT_SOURCE_DIR}/googletest-build
EXCLUDE_FROM_ALL)

# The gtest/gtest_main targets carry header search path
# dependencies automatically when using CMake 2.8.11 or
# later. Otherwise we have to add them here ourselves.
if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include")
endif()
endif(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY)


############ google benchmark


if(NOT USE_DOCKER)
message("NOT using Docker! Downloading & configuring google benchmark...")

set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable GTest")
# Build release version
set(DCMAKE_BUILD_TYPE RELEASE)
# If you want to self-test benchmark lib too, turn me ON
#
set(BENCHMARK_ENABLE_TESTING OFF)

# Download and unpack benchmark at configure time
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_benchmark.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download )
if(result)
message(FATAL_ERROR "CMake step for benchmark failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download )
if(result)
message(FATAL_ERROR "Build step for benchmark failed: ${result}")
endif()


# Prevent overriding the parent project's compiler/linker
# settings on Windows
#set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

# Add benchmark directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src
${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build
EXCLUDE_FROM_ALL)

# The gtest/gtest_main targets carry header search path
# dependencies automatically when using CMake 2.8.11 or
# later. Otherwise we have to add them here ourselves.
if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include")
endif()
endif(NOT USE_DOCKER)
if(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY)
message("NOT using Docker! Downloading & configuring google benchmark...")

set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable GTest")
# Build release version
set(DCMAKE_BUILD_TYPE RELEASE)
# If you want to self-test benchmark lib too, turn me ON
#
set(BENCHMARK_ENABLE_TESTING OFF)

# Download and unpack benchmark at configure time
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_benchmark.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download )
if(result)
message(FATAL_ERROR "CMake step for benchmark failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download )
if(result)
message(FATAL_ERROR "Build step for benchmark failed: ${result}")
endif()


# Prevent overriding the parent project's compiler/linker
# settings on Windows
#set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

# Add benchmark directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src
${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build
EXCLUDE_FROM_ALL)

# The gtest/gtest_main targets carry header search path
# dependencies automatically when using CMake 2.8.11 or
# later. Otherwise we have to add them here ourselves.
if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include")
endif()
endif(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY)
18 changes: 9 additions & 9 deletions 3rd-party/CMakeLists_benchmark.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ project(benchmark-download NONE)

include(ExternalProject)
ExternalProject_Add(benchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG master
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src"
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build"
GIT_SHALLOW 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG master
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src"
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build"
GIT_SHALLOW 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
18 changes: 9 additions & 9 deletions 3rd-party/CMakeLists_googletest.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ project(googletest-download NONE)

include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
GIT_SHALLOW 1
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-src"
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
GIT_SHALLOW 1
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-src"
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
Loading

0 comments on commit 8922780

Please sign in to comment.