Skip to content

Commit 4961a30

Browse files
authored
Update CI scripts (#41)
* Updated Travis script * Simplified build scripts and updated Travis configuration. * Fixed warning when building with optimizations using GCC * Updated .travis.yml and CMakeLists.txt to make CI work * Fixed bug in build script when using LLVM libcxx and clang * Updated appveyor.yml
1 parent 14bdfec commit 4961a30

File tree

10 files changed

+80
-89
lines changed

10 files changed

+80
-89
lines changed

.appveyor.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ configuration:
99
- Debug
1010
- Release
1111

12+
environment:
13+
matrix:
14+
- SHARED_LIB: OFF
15+
1216
install:
1317
- cd C:\Tools\vcpkg
1418
- git pull
@@ -22,7 +26,7 @@ build_script:
2226
- git submodule update
2327
- mkdir build
2428
- cd build
25-
- cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=C:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake
29+
- cmake -B . -A x64 -DCMAKE_TOOLCHAIN_FILE=C:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake -DBUILD_SHARED_LIBS=%SHARED_LIB% ..
2630
- cmake --build .
2731
- ctest
2832

.travis.yml

Lines changed: 56 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,43 @@
11
sudo: false
22

33
language: c++
4-
54
dist: bionic
65

6+
compiler:
7+
- gcc
8+
- clang
9+
os:
10+
- linux
11+
712
env:
813
global:
914
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps_"
1015
- INSTALL_DIR="${TRAVIS_BUILD_DIR}/install"
16+
jobs:
17+
- SHARED_LIB=OFF BUILD_TYPE=Debug
18+
- SHARED_LIB=OFF BUILD_TYPE=Release
19+
- SHARED_LIB=ON BUILD_TYPE=Debug
20+
- SHARED_LIB=ON BUILD_TYPE=Release
1121

12-
matrix:
13-
include:
14-
- os: linux
15-
compiler: gcc
16-
addons: &gcc8
17-
apt:
18-
sources: ['ubuntu-toolchain-r-test']
19-
packages: ['g++-8']
20-
env: [COMPILER='g++-8', VCPKG_TRIPLET='x64-linux', BUILD_WITH_LLVM_LIBCXX='OFF']
21-
22-
- os: linux
23-
compiler: gcc
24-
addons: &gcc9
25-
apt:
26-
sources: ['ubuntu-toolchain-r-test']
27-
packages: ['g++-9']
28-
env: [COMPILER='g++-9', VCPKG_TRIPLET='x64-linux', BUILD_WITH_LLVM_LIBCXX='OFF']
29-
30-
- os: linux
31-
compiler: clang
32-
addons: &clang7
33-
apt:
34-
sources: ['llvm-toolchain-bionic-7']
35-
packages: ['clang++-7', 'libc++-7-dev', 'libc++abi-7-dev']
36-
env: [COMPILER='clang++-7', VCPKG_TRIPLET='x64-linux', BUILD_WITH_LLVM_LIBCXX='ON']
37-
38-
- os: linux
39-
compiler: clang
40-
addons: &clang8
41-
apt:
42-
sources: ['llvm-toolchain-bionic-8']
43-
packages: ['clang++-8', 'libc++-8-dev', 'libc++abi-8-dev']
44-
env: [COMPILER='clang++-8', VCPKG_TRIPLET='x64-linux', BUILD_WITH_LLVM_LIBCXX='ON']
45-
46-
- os: linux
47-
compiler: clang
48-
addons: &clang9
49-
apt:
50-
sources: ['llvm-toolchain-bionic-9']
51-
packages: ['clang++-9', 'libc++-9-dev', 'libc++abi-9-dev']
52-
env: [COMPILER='clang++-9', VCPKG_TRIPLET='x64-linux', BUILD_WITH_LLVM_LIBCXX='ON']
53-
54-
# # 3/ OSX Clang Builds
55-
# - os: osx
56-
# osx_image: xcode10
57-
# compiler: clang
58-
# env: [COMPILER='clang', VCPKG_TRIPLET='x64-osx', BUILD_WITH_LLVM_LIBCXX='ON']
22+
addons:
23+
apt:
24+
sources:
25+
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
26+
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
27+
- sourceline: 'ppa:ubuntu-toolchain-r/test'
28+
packages:
29+
- clang-9
30+
- cmake
31+
- gcc-9
32+
- g++-9
33+
- ninja-build
34+
homebrew:
35+
packages:
36+
- cmake
37+
- gcc@9
38+
- llvm@9
39+
- ninja
40+
update: true
5941

6042
before_install:
6143
- echo ${DEPS_DIR}
@@ -67,37 +49,44 @@ before_install:
6749
CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0-Linux-x86_64.tar.gz"
6850
mkdir cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
6951
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
70-
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
71-
which cmake || brew install cmake
72-
fi
73-
- |
74-
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
7552
which ninja || sudo apt-get install ninja-build
7653
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
54+
which cmake || brew install cmake
7755
which ninja || brew install ninja
7856
fi
7957
- popd
8058
- echo ${INSTALL_DIR}
8159
- mkdir -p ${INSTALL_DIR}
82-
- |
83-
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
84-
brew install gcc
85-
brew upgrade gcc
86-
export CXX=`which g++`
87-
else
88-
export CXX=${COMPILER}
89-
fi
9060
- echo ${CXX}
9161
- ${CXX} --version
9262

9363
install:
64+
# The following Homebrew packages aren't linked by default, and need to be
65+
# prepended to the path explicitly.
66+
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
67+
export PATH="$(brew --prefix llvm)/bin:$PATH";
68+
fi
69+
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
70+
- if [ "$CXX" = "g++" ]; then export CXX="g++-9" CC="gcc-9"; fi
71+
# /usr/bin/clang points to an older compiler on both Linux and macOS.
72+
#
73+
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
74+
# below don't work on macOS. Fortunately, the path change above makes the
75+
# default values (clang and clang++) resolve to the correct compiler on macOS.
76+
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
77+
if [ "$CXX" = "clang++" ]; then export CXX="clang++-9" CC="clang-9"; fi;
78+
fi
79+
- echo ${CC}
80+
- echo ${CXX}
81+
- ${CXX} --version
82+
- cmake --version
83+
# Update dependencies directory
9484
- mkdir -p ${DEPS_DIR}/vcpkg
9585
- pushd ${DEPS_DIR}/vcpkg
9686
- git init
9787
- git remote add origin https://github.com/Microsoft/vcpkg.git
9888
- git fetch origin master
9989
- git checkout -b master origin/master
100-
- ${CXX} --version
10190
- export
10291
- ./bootstrap-vcpkg.sh
10392
- ./vcpkg install tl-expected catch2 nlohmann-json
@@ -108,24 +97,24 @@ cache:
10897
- ${DEPS_DIR}/vcpkg/installed
10998

11099
before_script:
111-
- export CXX=${COMPILER}
112100
- mkdir _build
113101
- cmake
114102
-B_build
115103
-GNinja
104+
-DSkyr_WARNINGS_AS_ERRORS=OFF
116105
-DSkyr_BUILD_TESTS=ON
117106
-DSkyr_BUILD_DOCS=OFF
118107
-DSkyr_BUILD_EXAMPLES=OFF
119-
-DSkyr_BUILD_WITH_LLVM_LIBCXX=${BUILD_WITH_LLVM_LIBCXX}
108+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
109+
-DBUILD_SHARED_LIBS=${SHARED_LIB}
120110
-DCMAKE_TOOLCHAIN_FILE=${DEPS_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
121111
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
122112
.
123113

124114
script:
125115
- pushd _build
126-
- ninja
127-
- ninja test
128-
- ninja install
116+
- cmake --build . --target install -- -v
117+
- ctest
129118
- popd
130119

131120
after_failure:

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.4.4] - 2020-03-28
8+
9+
## Fixed
10+
11+
- Minor fix to the parser (#37)
12+
13+
## Updated
14+
15+
- Updated the coverage of the web platform tests (#39)
16+
717
## [1.4.3] - 2020-03-18
818

919
### Fixed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.14)
88

99
project(
1010
Skyr
11-
VERSION 1.4.3
11+
VERSION 1.4.4
1212
HOMEPAGE_URL https://cpp-netlib.github.io/url
1313
DESCRIPTION "A C++ library that implements the WhatWG URL specification"
1414
LANGUAGES CXX
@@ -22,7 +22,6 @@ option(Skyr_FULL_WARNINGS "Build the library with all warnings turned on." ON)
2222
option(Skyr_WARNINGS_AS_ERRORS "Treat warnings as errors." ON)
2323
option(Skyr_BUILD_WITHOUT_EXCEPTIONS "Build without exceptions." OFF)
2424
option(Skyr_USE_STATIC_CRT "Use static C Runtime library (/MT or MTd)." ON)
25-
option(Skyr_BUILD_FILESYSTEM_PATH_FUNCTIONS "Build the filesystem path functions" ON)
2625
option(Skyr_BUILD_WITH_LLVM_LIBCXX "Instruct Clang to use LLVM's implementation of C++ standard library" OFF)
2726

2827
set(Skyr_WPT_TAG "merge_pr_22329" CACHE STRING "The Git tag for the WPT test data" )

include/skyr/unicode/ranges/views/u16_view.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class view_u16_range {
180180
///
181181
/// \return
182182
[[nodiscard]] constexpr size_type size() const noexcept {
183-
return std::distance(begin(), end());
183+
return static_cast<size_type>(end() - begin());
184184
}
185185

186186
private:

include/skyr/unicode/ranges/views/u8_view.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class view_u8_range {
186186

187187
///
188188
/// \return
189-
[[nodiscard]] size_type size() const noexcept {
189+
[[nodiscard]] constexpr size_type size() const noexcept {
190190
return static_cast<size_type>(std::distance(begin(), end()));
191191
}
192192

include/skyr/version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#define SKYR_VERSION_MAJOR 1
1515
#define SKYR_VERSION_MINOR 4
16-
#define SKYR_VERSION_PATCH 3
16+
#define SKYR_VERSION_PATCH 4
1717

1818
#define SKYR_VERSION_STRING \
1919
SKYR_PREPROCESSOR_TO_STRING(SKYR_VERSION_MAJOR) "." \

src/CMakeLists.txt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ set(Skyr_SRCS
2828
url/url.cpp
2929
url/url_error.cpp
3030
url/url_search_parameters.cpp
31+
url/filesystem.cpp
3132
url/percent_encoding/errors.cpp
3233

3334
${Skyr_SOURCE_DIR}/include/skyr/config.hpp
@@ -56,24 +57,18 @@ set(Skyr_SRCS
5657
${Skyr_SOURCE_DIR}/include/skyr/url/url_serialize.hpp
5758
${Skyr_SOURCE_DIR}/include/skyr/url/url_error.hpp
5859
${Skyr_SOURCE_DIR}/include/skyr/url/url_search_parameters.hpp
60+
${Skyr_SOURCE_DIR}/include/skyr/url/filesystem.hpp
5961
${Skyr_SOURCE_DIR}/include/skyr/url.hpp)
6062

61-
if (Skyr_BUILD_FILESYSTEM_PATH_FUNCTIONS)
62-
LIST(APPEND Skyr_SRCS url/filesystem.cpp)
63-
LIST(APPEND Skyr_SRCS ${Skyr_SOURCE_DIR}/include/skyr/url/filesystem.hpp)
64-
endif()
65-
6663
add_library(skyr-url ${Skyr_SRCS})
6764

6865
target_link_libraries(skyr-url PUBLIC tl::expected)
6966
if(${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
70-
if (NOT Skyr_DISABLE_LIBCXX)
67+
if (Skyr_BUILD_WITH_LLVM_LIBCXX)
7168
target_link_libraries(skyr-url PUBLIC "c++")
7269
endif()
7370
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
74-
if (Skyr_BUILD_FILESYSTEM_PATH_FUNCTIONS)
75-
target_link_libraries(skyr-url PUBLIC "stdc++fs")
76-
endif()
71+
target_link_libraries(skyr-url PUBLIC "stdc++fs")
7772
endif()
7873

7974
set_target_properties(skyr-url PROPERTIES

tests/url/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,9 @@ set(
1919
ipv4_address_tests.cpp
2020
ipv6_address_tests.cpp
2121
url_literal_tests.cpp
22+
filesystem_path_tests.cpp
2223
)
2324

24-
if (Skyr_BUILD_FILESYSTEM_PATH_FUNCTIONS)
25-
LIST(APPEND
26-
URL_TESTS
27-
filesystem_path_tests.cpp)
28-
endif()
29-
3025
if (NOT Skyr_BUILD_WITHOUT_EXCEPTIONS)
3126
LIST(APPEND URL_TESTS
3227
url_tests_with_exceptions.cpp

tests/url/wpt/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ FetchContent_Declare(
1111
GIT_TAG ${Skyr_WPT_TAG}
1212
)
1313
FetchContent_MakeAvailable(wpt)
14-
message(STATUS "${wpt_SOURCE_DIR}")
1514

1615
SET(WPT_TESTS
1716
url_web_platform_tests.cpp

0 commit comments

Comments
 (0)