Skip to content
Snippets Groups Projects
Commit 9353dfcb authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

git subrepo pull (merge) packages/rang

subrepo:
  subdir:   "packages/rang"
  merged:   "a083cae9d"
upstream:
  origin:   "git@github.com:agauniyal/rang.git"
  branch:   "master"
  commit:   "a083cae9d"
git-subrepo:
  version:  "0.4.3"
  origin:   "git@github.com:ingydotnet/git-subrepo.git"
  commit:   "2f68596"
parent ad4a3f02
No related branches found
No related tags found
1 merge request!120git subrepo clone (merge) --branch=main git@github.com:taocpp/PEGTL.git packages/PEGTL
......@@ -6,7 +6,7 @@
[subrepo]
remote = git@github.com:agauniyal/rang.git
branch = master
commit = cabe04d6d6b05356fa8f9741704924788f0dd762
parent = 61d96553d759fb36c6592e9b2b41a4af8acc45f1
cmdver = 0.4.0
commit = a083cae9d64edd66d0ecdd4ddebac20d090c8693
parent = d97199d99e580797e39a626ad2ac6d87c125bcb5
cmdver = 0.4.3
method = merge
dist: trusty
sudo: false
group: travis_latest
language: c++
env:
global:
- COMPILER=g++
addons:
apt:
sources: &apt_sources
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- llvm-toolchain-precise-3.6
- llvm-toolchain-precise-3.7
- llvm-toolchain-precise-3.8
- llvm-toolchain-trusty-3.9
- llvm-toolchain-trusty-4.0
- llvm-toolchain-trusty-5.0
compiler: clang
os: linux
matrix:
fast_finish: true
include:
- env: COMPILER=g++-5
compiler: gcc
addons: &gcc5
apt:
packages: ["g++-5", "python3-pip", "lcov"]
sources: *apt_sources
- env: COMPILER=g++-6
compiler: gcc
addons: &gcc6
apt:
packages: ["g++-6", "python3-pip", "lcov"]
sources: *apt_sources
- env: COMPILER=g++-7
compiler: gcc
addons: &gcc7
apt:
packages: ["g++-7", "python3-pip", "lcov"]
sources: *apt_sources
- env: COMPILER=clang++-3.5
compiler: clang
addons: &clang35
apt:
packages: ["clang-3.5", "g++-7", "python3-pip", "lcov"]
sources: *apt_sources
- env: COMPILER=clang++-3.6
compiler: clang
addons: &clang36
apt:
packages: ["clang-3.6", "g++-7", "python3-pip", "lcov"]
sources: *apt_sources
- env: COMPILER=clang++-3.7
compiler: clang
addons: &clang37
apt:
packages: ["clang-3.7", "g++-7", "python3-pip", "lcov"]
sources: *apt_sources
- env: COMPILER=clang++-3.8
compiler: clang
addons: &clang38
apt:
packages: ["clang-3.8", "g++-7", "python3-pip", "lcov"]
sources: *apt_sources
- env: COMPILER=clang++-3.9
compiler: clang
addons: &clang39
apt:
packages: ["clang-3.9", "g++-7", "python3-pip", "lcov"]
sources: *apt_sources
- env: COMPILER=clang++-4.0
compiler: clang
addons: &clang40
apt:
packages: ["clang-4.0", "g++-7", "python3-pip", "lcov"]
sources: *apt_sources
- env: COMPILER=clang++-5.0
compiler: clang
addons: &clang50
apt:
packages: ["clang-5.0", "g++-7", "python3-pip", "lcov"]
sources: *apt_sources
allow_failures:
- env: COMPILER=clang++-3.7
compiler: clang
- env: COMPILER=clang++-3.9
compiler: clang
install:
- wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip && unzip -q ninja-linux.zip -d build-ninja
- wget https://github.com/danmar/cppcheck/releases/download/1.81/cppcheck-1.81.zip && unzip -q cppcheck-1.81.zip
- cd cppcheck-1.81/ && make SRCDIR=build CFGDIR=cfg CXXFLAGS="-O1 -DNDEBUG" -j2 && cd ..
- pip3 install --user meson
- pip3 install --user conan
- conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
- export PATH="`pwd`/build-ninja:${PATH}"
- export PATH="`pwd`/cppcheck-1.81/:${PATH}"
- export PATH="~/.local/bin:${PATH}"
before_script:
- export CXX=$COMPILER
- mkdir debug && cd debug
- conan install ..
- conan build ..
- meson configure -Dbuildtype=debug
- meson configure -Dwarning_level=3
- if [[ "${COMPILER}" == clang++* ]]; then meson configure -Db_sanitize="address,undefined"; fi;
- meson configure -Db_coverage=true
- ninja
- cd ..
- mkdir release-sanitize && cd release-sanitize
- conan install ..
- conan build ..
- meson configure -Dbuildtype=release
- meson configure -Dwarning_level=3
- if [[ "${COMPILER}" == clang* ]]; then meson configure -Db_sanitize="address,undefined"; fi;
- ninja
- cd ..
- mkdir release && cd release
- conan install ..
- conan build ..
- meson configure -Dbuildtype=release
- meson configure -Dwarning_level=3
- ninja
- cd ..
script:
- cd release && ./test/mainTest && ./test/colorTest && ./test/envTermMissing
- ninja cppcheck && cd ..
after_success:
- cd debug && ./test/mainTest && ./test/colorTest && ./test/envTermMissing
- bash <(curl -s https://codecov.io/bash)
- cd .. && cd release-sanitize && ./test/mainTest && ./test/colorTest && ./test/envTermMissing
notifications:
email: false
cmake_minimum_required (VERSION 2.8)
project (rang)
cmake_minimum_required(VERSION 3.1)
include_directories(include)
install(FILES ${PROJECT_SOURCE_DIR}/include/rang.hpp DESTINATION include)
project(rang
VERSION 3.2.0
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(cmake/CMakeUtilities.cmake)
include(GNUInstallDirs)
set_verbose(RANG_INC_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE STRING
"Installation directory for include files, a relative path that "
"will be joined with ${CMAKE_INSTALL_PREFIX} or an absolute path.")
set(RANG_HEADERS include/rang.hpp)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(rang INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${RANG_INC_DIR}>
)
include(CMakePackageConfigHelpers)
set_verbose(RANG_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/rang CACHE STRING
"Installation directory for cmake files, a relative path that "
"will be joined with ${CMAKE_INSTALL_PREFIX} or an absolute "
"path.")
set(version_config ${PROJECT_BINARY_DIR}/rang-config-version.cmake)
set(project_config ${PROJECT_BINARY_DIR}/rang-config.cmake)
set(pkgconfig ${PROJECT_BINARY_DIR}/rang.pc)
set(targets_export_name rang-targets)
set_verbose(RANG_PKGCONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig CACHE PATH
"Installation directory for pkgconfig (.pc) files, a relative "
"path that will be joined with ${CMAKE_INSTALL_PREFIX} or an "
"absolute path.")
write_basic_package_version_file(
${version_config}
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)
join_paths(includedir_for_pc_file "\${prefix}" "${RANG_INC_DIR}")
# Configure the PkgConfig
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/rang.pc.in"
"${pkgconfig}"
@ONLY
)
# Configuring the CMake Installer Helper
configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/rang-config.cmake.in
${project_config}
INSTALL_DESTINATION ${RANG_CMAKE_DIR}
)
set(INSTALL_TARGETS rang)
# Install the library and headers.
install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# Use a namespace because CMake provides better diagnostics for namespaced
# imported targets.
export(TARGETS ${INSTALL_TARGETS} NAMESPACE rang::
FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake
)
# Install version, config and target files.
install(
FILES ${project_config} ${version_config}
DESTINATION ${RANG_CMAKE_DIR}
)
install(EXPORT ${targets_export_name}
DESTINATION ${RANG_CMAKE_DIR}
NAMESPACE rang::)
install(FILES ${RANG_HEADERS} DESTINATION "${RANG_INC_DIR}")
install(FILES "${pkgconfig}" DESTINATION "${RANG_PKGCONFIG_DIR}")
# This module provides function for joining paths
# known from from most languages
#
# Original license:
# SPDX-License-Identifier: (MIT OR CC0-1.0)
# Explicit permission given to distribute this module under
# the terms of the project as described in /LICENSE.rst.
# Copyright 2020 Jan Tojnar
# https://github.com/jtojnar/cmake-snips
#
# Modelled after Python’s os.path.join
# https://docs.python.org/3.7/library/os.path.html#os.path.join
# Windows not supported
function(join_paths joined_path first_path_segment)
set(temp_path "${first_path_segment}")
foreach(current_segment IN LISTS ARGN)
if(NOT ("${current_segment}" STREQUAL ""))
if(IS_ABSOLUTE "${current_segment}")
set(temp_path "${current_segment}")
else()
set(temp_path "${temp_path}/${current_segment}")
endif()
endif()
endforeach()
set(${joined_path} "${temp_path}" PARENT_SCOPE)
endfunction()
# Joins arguments and places the results in ${result_var}.
function(join result_var)
set(result "")
foreach (arg ${ARGN})
set(result "${result}${arg}")
endforeach ()
set(${result_var} "${result}" PARENT_SCOPE)
endfunction()
function(enable_module target)
if (MSVC)
set(BMI ${CMAKE_CURRENT_BINARY_DIR}/${target}.ifc)
target_compile_options(${target}
PRIVATE /interface /ifcOutput ${BMI}
INTERFACE /reference fmt=${BMI})
endif ()
set_target_properties(${target} PROPERTIES ADDITIONAL_CLEAN_FILES ${BMI})
set_source_files_properties(${BMI} PROPERTIES GENERATED ON)
endfunction()
function(set_verbose)
# cmake_parse_arguments is broken in CMake 3.4 (cannot parse CACHE) so use
# list instead.
list(GET ARGN 0 var)
list(REMOVE_AT ARGN 0)
list(GET ARGN 0 val)
list(REMOVE_AT ARGN 0)
list(REMOVE_AT ARGN 0)
list(GET ARGN 0 type)
list(REMOVE_AT ARGN 0)
join(doc ${ARGN})
set(${var} ${val} CACHE ${type} ${doc})
endfunction()
\ No newline at end of file
@PACKAGE_INIT@
include(${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake)
check_required_components(rang)
\ No newline at end of file
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
includedir=@includedir_for_pc_file@
Name: rang
Description: A Minimal, Header only Modern c++ library for terminal goodies
Version: @PROJECT_VERSION@
Cflags: -I${includedir}
......@@ -3,7 +3,7 @@ from conans import ConanFile, Meson
class RangConan(ConanFile):
name = "rang"
version = "3.1.0"
version = "3.2.0"
license = "The Unlicense"
url = "https://github.com/agauniyal/rang"
description = "A Minimal, Header only Modern c++ library for colors in your terminal"
......
project('rang', 'cpp', version : '3.1.0',
project('rang', 'cpp', version : '3.2.0',
default_options : ['cpp_std=c++11'])
inc = include_directories('include')
......
cmake_minimum_required(VERSION 2.8.12)
project(rang-test)
set(CMAKE_CXX_STANDARD 11 )
set(CMAKE_CXX_STANDARD_REQUIRED ON )
set(CMAKE_CXX_EXTENSIONS OFF)
function(rang_add_test file_name)
add_executable("${file_name}" "${file_name}.cpp")
target_link_libraries("${file_name}" rang)
endfunction()
# simple tests #################################################################
rang_add_test(colorTest)
rang_add_test(envTermMissing)
# test that uses doctest #######################################################
set(doctest_DIR "" CACHE PATH "Directory containing doctestConfig.cmake")
find_package(doctest)
if (${doctest_FOUND} EQUAL 1)
add_executable(all_rang_tests "test.cpp")
target_link_libraries(all_rang_tests rang doctest::doctest)
enable_testing()
# cd build_dir && ctest --test-command all_tests
add_test(NAME all_tests COMMAND "$<TARGET_FILE:all_rang_tests>")
endif()
project('rang', 'cpp', version : '3.1.0',
project('rang', 'cpp', version : '3.2.0',
default_options : ['cpp_std=c++11'])
inc = include_directories('include')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment