Skip to content

Commit 8922780

Browse files
committed
Merge branch 'release-0.5.0'
2 parents 2643222 + 7c5b64f commit 8922780

File tree

122 files changed

+5917
-2352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+5917
-2352
lines changed

.circleci/config.yml

+86-7
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,103 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: heliconwave/circleci:latest
5+
- image: heliconwave/cplusplusdev:latest
66
steps:
77
- checkout
8+
- setup_remote_docker:
9+
docker_layer_caching: true
810
- run:
911
name: Print Container Metadata
1012
command: lsb_release -a
1113
- run:
1214
name: Build CMake Debug
13-
command: rm -rf build/ && mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . -- -j$(nproc)
15+
command: mkdir Debug && cd Debug/ && cmake -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . -- -j$(nproc)
1416
- run:
1517
name: Build CMake Release
16-
command: rm -rf build/ && mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && cmake --build . -- -j$(nproc)
18+
command: mkdir Release && cd Release/ && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=YES -DENABLE_TESTS=OFF .. && cmake --build . -- -j$(nproc)
1719
- run:
18-
name: Component Tests
19-
command: cd build && make component-tests
20+
name: Creating Artifacts
21+
command:
22+
cpack --version &&
23+
echo "include(\"Release/CPackConfig.cmake\")" > CPackConfig.cmake &&
24+
echo "set(CPACK_INSTALL_CMAKE_PROJECTS" >> CPackConfig.cmake &&
25+
echo " \"Debug;mpeg2ts;ALL;/\"" >> CPackConfig.cmake &&
26+
echo " \"Release;mpeg2ts;ALL;/\"" >> CPackConfig.cmake &&
27+
echo " )" >> CPackConfig.cmake &&
28+
cat CPackConfig.cmake &&
29+
cpack --config CPackConfig.cmake
30+
- store_artifacts:
31+
path: /root/project/mpeg2ts-0.5.0-Linux.tar.gz
32+
- persist_to_workspace:
33+
root: /root/project
34+
paths:
35+
- Debug
36+
- Release
37+
# build-webassembly:
38+
# docker:
39+
# - image: heliconwave/emscripten:latest
40+
# steps:
41+
# - checkout
42+
# - run:
43+
# name: Build CMake WebAssembly
44+
# 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)
45+
test-unit:
46+
docker:
47+
- image: heliconwave/cplusplus:latest
48+
working_directory: ~/project
49+
steps:
50+
- checkout
51+
- attach_workspace:
52+
at: /root/project
2053
- run:
2154
name: Run CTest
22-
command: cd build && make unit-tests
55+
command: pwd && ls -ltrha && cd Debug/ && make unit-tests
56+
test-component:
57+
docker:
58+
- image: heliconwave/cplusplus:latest
59+
working_directory: ~/project
60+
steps:
61+
- checkout
62+
- attach_workspace:
63+
at: /root/project
64+
- run:
65+
name: Component Tests
66+
command: cd Debug/ && make component-tests
67+
test-benchmark:
68+
docker:
69+
- image: heliconwave/cplusplus:latest
70+
steps:
71+
- checkout
72+
- attach_workspace:
73+
at: /root/project
74+
- run:
75+
name: Run micro benchmark
76+
command: cd Debug/ && make benchmark-tests
77+
test-memcheck:
78+
docker:
79+
- image: heliconwave/cplusplus:latest
80+
steps:
81+
- checkout
82+
- attach_workspace:
83+
at: /root/project
2384
- run:
2485
name: Run micro benchmark
25-
command: cd build && make benchmark-tests
86+
command: cd Debug/ && ctest -T memcheck
87+
workflows:
88+
version: 2
89+
build-test-and-deploy:
90+
jobs:
91+
- build
92+
# - build-webassembly
93+
- test-unit:
94+
requires:
95+
- build
96+
- test-component:
97+
requires:
98+
- build
99+
- test-benchmark:
100+
requires:
101+
- build
102+
- test-memcheck:
103+
requires:
104+
- build

.github/workflows/ccpp.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: C/C++ CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
name: building
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [macOS-latest, windows-latest]
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: check versions
15+
run: cmake --version
16+
- name: cmake configure
17+
run : mkdir build; cd build; cmake -DENABLE_COMPONENT_TESTS=OFF ..
18+
- name: cmake build
19+
run: cd build/; ls; pwd; cmake --build .

.vscode/cmake-kits.json

+21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
[
2+
{
3+
"name": "Linux-GCC-7.3.0-GTest",
4+
"cmakeSettings": {
5+
"ENABLE_TESTS": "ON",
6+
"BUILD_SHARED_LIBS": "OFF"
7+
},
8+
"compilers" : {
9+
"CXX": "/usr/bin/g++-7"
10+
}
11+
},
12+
{
13+
"name": "Linux-GCC-7.3.0-Release",
14+
"cmakeSettings": {
15+
"ENABLE_TESTS": "OFF",
16+
"BUILD_SHARED_LIBS": "ON",
17+
"DCMAKE_BUILD_TYPE": "Release"
18+
},
19+
"compilers" : {
20+
"CXX": "/usr/bin/g++-7"
21+
}
22+
},
223
{
324
"name": "Windows-SharedLib-VS2017-x64",
425
"cmakeSettings": {

3rd-party/CMakeLists.txt

+105-79
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
#*****************************************************************
2+
#
3+
# Copyright © 2017-2020 kohnech, lnwhome All rights reserved
4+
#
5+
# mpeg2ts - mpeg2ts 3rd-party
6+
#
7+
# This file is part of mpeg2ts (Mpeg2 Transport Stream Library).
8+
#
9+
# Unless you have obtained mpeg2ts under a different license,
10+
# this version of mpeg2ts is mpeg2ts|GPL.
11+
# Mpeg2ts|GPL is free software; you can redistribute it and/or
12+
# modify it under the terms of the GNU General Public License as
13+
# published by the Free Software Foundation; either version 2,
14+
# or (at your option) any later version.
15+
#
16+
# Mpeg2ts|GPL is distributed in the hope that it will be useful,
17+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
# GNU General Public License for more details.
20+
#
21+
# You should have received a copy of the GNU General Public License
22+
# along with mpeg2ts|GPL; see the file COPYING. If not, write to
23+
# the Free Software Foundation, 59 Temple Place - Suite 330,
24+
# Boston, MA 02111-1307, USA.
25+
#
26+
#*******************************************************************/
127
cmake_minimum_required(VERSION 3.0)
228
project(3rd-party)
329
set(PLOG_VERSION 1.1.4)
@@ -38,87 +64,87 @@ ExternalProject_Add(
3864
#-------------------------------------------------------------
3965
# Taken from https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project
4066
#-------------------------------------------------------------
41-
42-
if(NOT USE_DOCKER)
43-
message("NOT using Docker! Downloading & configuring google test...")
44-
45-
# Download and unpack googletest at configure time
46-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_googletest.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download/CMakeLists.txt)
47-
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
48-
RESULT_VARIABLE result
49-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download )
50-
if(result)
51-
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
52-
endif()
53-
execute_process(COMMAND ${CMAKE_COMMAND} --build .
54-
RESULT_VARIABLE result
55-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download )
56-
if(result)
57-
message(FATAL_ERROR "Build step for googletest failed: ${result}")
58-
endif()
59-
60-
# Prevent overriding the parent project's compiler/linker
61-
# settings on Windows
62-
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
63-
64-
# Add googletest directly to our build. This defines
65-
# the gtest and gtest_main targets.
66-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest-src
67-
${CMAKE_CURRENT_SOURCE_DIR}/googletest-build
68-
EXCLUDE_FROM_ALL)
69-
70-
# The gtest/gtest_main targets carry header search path
71-
# dependencies automatically when using CMake 2.8.11 or
72-
# later. Otherwise we have to add them here ourselves.
73-
if (CMAKE_VERSION VERSION_LESS 2.8.11)
74-
include_directories("${gtest_SOURCE_DIR}/include")
75-
endif()
76-
endif(NOT USE_DOCKER)
67+
if(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY)
68+
message("NOT using Docker! Downloading & configuring google test...")
69+
70+
# Download and unpack googletest at configure time
71+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_googletest.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download/CMakeLists.txt)
72+
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
73+
RESULT_VARIABLE result
74+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download
75+
)
76+
if(result)
77+
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
78+
endif()
79+
execute_process(COMMAND ${CMAKE_COMMAND} --build .
80+
RESULT_VARIABLE result
81+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest-download )
82+
if(result)
83+
message(FATAL_ERROR "Build step for googletest failed: ${result}")
84+
endif()
85+
86+
# Prevent overriding the parent project's compiler/linker
87+
# settings on Windows
88+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
89+
90+
# Add googletest directly to our build. This defines
91+
# the gtest and gtest_main targets.
92+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest-src
93+
${CMAKE_CURRENT_SOURCE_DIR}/googletest-build
94+
EXCLUDE_FROM_ALL)
95+
96+
# The gtest/gtest_main targets carry header search path
97+
# dependencies automatically when using CMake 2.8.11 or
98+
# later. Otherwise we have to add them here ourselves.
99+
if (CMAKE_VERSION VERSION_LESS 2.8.11)
100+
include_directories("${gtest_SOURCE_DIR}/include")
101+
endif()
102+
endif(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY)
77103

78104

79105
############ google benchmark
80106

81107

82-
if(NOT USE_DOCKER)
83-
message("NOT using Docker! Downloading & configuring google benchmark...")
84-
85-
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable GTest")
86-
# Build release version
87-
set(DCMAKE_BUILD_TYPE RELEASE)
88-
# If you want to self-test benchmark lib too, turn me ON
89-
#
90-
set(BENCHMARK_ENABLE_TESTING OFF)
91-
92-
# Download and unpack benchmark at configure time
93-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_benchmark.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download/CMakeLists.txt)
94-
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
95-
RESULT_VARIABLE result
96-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download )
97-
if(result)
98-
message(FATAL_ERROR "CMake step for benchmark failed: ${result}")
99-
endif()
100-
execute_process(COMMAND ${CMAKE_COMMAND} --build .
101-
RESULT_VARIABLE result
102-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download )
103-
if(result)
104-
message(FATAL_ERROR "Build step for benchmark failed: ${result}")
105-
endif()
106-
107-
108-
# Prevent overriding the parent project's compiler/linker
109-
# settings on Windows
110-
#set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
111-
112-
# Add benchmark directly to our build. This defines
113-
# the gtest and gtest_main targets.
114-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src
115-
${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build
116-
EXCLUDE_FROM_ALL)
117-
118-
# The gtest/gtest_main targets carry header search path
119-
# dependencies automatically when using CMake 2.8.11 or
120-
# later. Otherwise we have to add them here ourselves.
121-
if (CMAKE_VERSION VERSION_LESS 2.8.11)
122-
include_directories("${gtest_SOURCE_DIR}/include")
123-
endif()
124-
endif(NOT USE_DOCKER)
108+
if(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY)
109+
message("NOT using Docker! Downloading & configuring google benchmark...")
110+
111+
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Disable GTest")
112+
# Build release version
113+
set(DCMAKE_BUILD_TYPE RELEASE)
114+
# If you want to self-test benchmark lib too, turn me ON
115+
#
116+
set(BENCHMARK_ENABLE_TESTING OFF)
117+
118+
# Download and unpack benchmark at configure time
119+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists_benchmark.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download/CMakeLists.txt)
120+
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
121+
RESULT_VARIABLE result
122+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download )
123+
if(result)
124+
message(FATAL_ERROR "CMake step for benchmark failed: ${result}")
125+
endif()
126+
execute_process(COMMAND ${CMAKE_COMMAND} --build .
127+
RESULT_VARIABLE result
128+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/benchmark-download )
129+
if(result)
130+
message(FATAL_ERROR "Build step for benchmark failed: ${result}")
131+
endif()
132+
133+
134+
# Prevent overriding the parent project's compiler/linker
135+
# settings on Windows
136+
#set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
137+
138+
# Add benchmark directly to our build. This defines
139+
# the gtest and gtest_main targets.
140+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src
141+
${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build
142+
EXCLUDE_FROM_ALL)
143+
144+
# The gtest/gtest_main targets carry header search path
145+
# dependencies automatically when using CMake 2.8.11 or
146+
# later. Otherwise we have to add them here ourselves.
147+
if (CMAKE_VERSION VERSION_LESS 2.8.11)
148+
include_directories("${gtest_SOURCE_DIR}/include")
149+
endif()
150+
endif(NOT USE_DOCKER AND NOT ENABLE_WEBASSEMBLY)

3rd-party/CMakeLists_benchmark.txt.in

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ project(benchmark-download NONE)
44

55
include(ExternalProject)
66
ExternalProject_Add(benchmark
7-
GIT_REPOSITORY https://github.com/google/benchmark.git
8-
GIT_TAG master
9-
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src"
10-
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build"
11-
GIT_SHALLOW 1
12-
CONFIGURE_COMMAND ""
13-
BUILD_COMMAND ""
14-
INSTALL_COMMAND ""
15-
TEST_COMMAND ""
7+
GIT_REPOSITORY https://github.com/google/benchmark.git
8+
GIT_TAG master
9+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src"
10+
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build"
11+
GIT_SHALLOW 1
12+
CONFIGURE_COMMAND ""
13+
BUILD_COMMAND ""
14+
INSTALL_COMMAND ""
15+
TEST_COMMAND ""
1616
)

3rd-party/CMakeLists_googletest.txt.in

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ project(googletest-download NONE)
44

55
include(ExternalProject)
66
ExternalProject_Add(googletest
7-
GIT_REPOSITORY https://github.com/google/googletest.git
8-
GIT_TAG master
9-
GIT_SHALLOW 1
10-
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-src"
11-
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-build"
12-
CONFIGURE_COMMAND ""
13-
BUILD_COMMAND ""
14-
INSTALL_COMMAND ""
15-
TEST_COMMAND ""
7+
GIT_REPOSITORY https://github.com/google/googletest.git
8+
GIT_TAG master
9+
GIT_SHALLOW 1
10+
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-src"
11+
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-build"
12+
CONFIGURE_COMMAND ""
13+
BUILD_COMMAND ""
14+
INSTALL_COMMAND ""
15+
TEST_COMMAND ""
1616
)

0 commit comments

Comments
 (0)