Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: glynos/url
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: cpp-netlib/url
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 2 commits
  • 11 files changed
  • 2 contributors

Commits on Aug 6, 2022

  1. Try to use a more recent version of cmake (#163)

    * Try the latest version of CMake for Github actions: 3.24.0
    
    * Try another version of CMake for Github actions: 3.18.0
    
    * Try another version of CMake for Github actions: 3.19
    
    * Try another version of CMake for Github actions: 3.19
    
    * Revert "Try another version of CMake for Github actions: 3.19"
    
    This reverts commit d505382.
    
    * Revert "Try another version of CMake for Github actions: 3.19"
    
    This reverts commit 4abd471.
    
    * Added GCC 12 support in Gitlab Actions
    
    * Don't try GCC 12 yet
    glynos authored Aug 6, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ecdb4eb View commit details

Commits on Dec 9, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8c03e21 View commit details
Showing with 387 additions and 55 deletions.
  1. +67 −26 .github/workflows/skyr-url-ci.yml
  2. +44 −21 CMakeLists.txt
  3. +1 −1 README.md
  4. +24 −0 cmake/CPM.cmake
  5. +95 −0 cmake/skyr-url-env.cmake
  6. +133 −0 cmake/skyr-url-flags.cmake
  7. +20 −0 cmake/skyr-url-options.cmake
  8. +1 −1 src/CMakeLists.txt
  9. +2 −0 tests/CMakeLists.txt
  10. +0 −3 tests/v1/CMakeLists.txt
  11. +0 −3 tests/v2/CMakeLists.txt
93 changes: 67 additions & 26 deletions .github/workflows/skyr-url-ci.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ name: skyr-url CI
on: [ push, pull_request ]

env:
CMAKE_VERSION: 3.17.3
CMAKE_VERSION: 3.21.7
NINJA_VERSION: 1.11.0

jobs:
@@ -61,17 +61,33 @@ jobs:
cxx_standard: 20,
}

# # GCC-12
# - {
# name: "Linux GCC 12 Debug (C++20)", artifact: "Linux.tar.xz",
# os: ubuntu-latest,
# build_type: Debug,
# cc: "gcc-12", cxx: "g++-12",
# cxx_standard: 20,
# }
# - {
# name: "Linux GCC 12 Release (C++20)", artifact: "Linux.tar.xz",
# os: ubuntu-latest,
# build_type: RelWithDebInfo,
# cc: "gcc-12", cxx: "g++-12",
# cxx_standard: 20,
# }

# Clang-10
- {
name: "Linux Clang 10 Debug (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
os: ubuntu-20.04,
build_type: Debug,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 20
}
- {
name: "Linux Clang 10 Release (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
os: ubuntu-20.04,
build_type: RelWithDebInfo,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 20,
@@ -80,14 +96,14 @@ jobs:
# Clang-11
- {
name: "Linux Clang 11 Debug (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
os: ubuntu-20.04,
build_type: Debug,
cc: "clang-11", cxx: "clang++-11",
cxx_standard: 20,
}
- {
name: "Linux Clang 11 Release (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
os: ubuntu-20.04,
build_type: RelWithDebInfo,
cc: "clang-11", cxx: "clang++-11",
cxx_standard: 20,
@@ -96,14 +112,14 @@ jobs:
# Clang-12
- {
name: "Linux Clang 12 Debug (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
os: ubuntu-20.04,
build_type: Debug,
cc: "clang-12", cxx: "clang++-12",
cxx_standard: 20,
}
- {
name: "Linux Clang 12 Release (C++20)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
os: ubuntu-20.04,
build_type: RelWithDebInfo,
cc: "clang-12", cxx: "clang++-12",
cxx_standard: 20,
@@ -222,16 +238,16 @@ jobs:
if ("${{ runner.os }}" STREQUAL "Windows")
set(ninja_suffix "win.zip")
set(cmake_suffix "win64-x64.zip")
set(cmake_dir "cmake-${cmake_version}-win64-x64/bin")
set(cmake_suffix "windows-x86_64.zip")
set(cmake_dir "cmake-${cmake_version}-windows-x86_64/bin")
elseif ("${{ runner.os }}" STREQUAL "Linux")
set(ninja_suffix "linux.zip")
set(cmake_suffix "Linux-x86_64.tar.gz")
set(cmake_dir "cmake-${cmake_version}-Linux-x86_64/bin")
set(cmake_suffix "linux-x86_64.tar.gz")
set(cmake_dir "cmake-${cmake_version}-linux-x86_64/bin")
elseif ("${{ runner.os }}" STREQUAL "macOS")
set(ninja_suffix "mac.zip")
set(cmake_suffix "Darwin-x86_64.tar.gz")
set(cmake_dir "cmake-${cmake_version}-Darwin-x86_64/CMake.app/Contents/bin")
set(cmake_suffix "macos10.10-universal.tar.gz")
set(cmake_dir "cmake-${cmake_version}-macos10.10-universal/CMake.app/Contents/bin")
endif()
set(ninja_url "https://github.com/ninja-build/ninja/releases/download/v${ninja_version}/ninja-${ninja_suffix}")
@@ -251,6 +267,7 @@ jobs:
COMMAND chmod +x ${cmake_dir}/cmake
)
- name: Install GCC 7
id: install_gcc_7
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-7' )
@@ -278,14 +295,14 @@ jobs:
sudo apt-get update
sudo apt-get -y install g++-11
- name: Install GCC 12
id: install_gcc_12
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-12' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get update
sudo apt-get -y install g++-12
# - name: Install GCC 12
# id: install_gcc_12
# if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-12' )
# shell: bash
# working-directory: ${{ env.HOME }}
# run: |
# sudo apt-get update
# sudo apt-get -y install g++-12

- name: Install Clang 8
id: install_clang_8
@@ -315,6 +332,7 @@ jobs:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 11
sudo apt-get install -y libc++-11-dev libc++abi-11-dev
- name: Install Clang 12
id: install_clang_12
@@ -325,6 +343,7 @@ jobs:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 12
sudo apt-get install -y libc++-12-dev libc++abi-12-dev libunwind-12-dev
- name: Install Clang 14
id: install_clang_14
@@ -349,7 +368,7 @@ jobs:
git checkout -b master origin/master
export
./bootstrap-vcpkg.sh
./vcpkg install tl-expected range-v3 catch2 nlohmann-json fmt
./vcpkg install fmt
- name: Install vcpkg (MacOS)
id: vcpkg_macos
@@ -365,7 +384,7 @@ jobs:
git checkout -b master origin/master
export
./bootstrap-vcpkg.sh
./vcpkg install tl-expected range-v3 catch2 nlohmann-json fmt
./vcpkg install fmt
- name: Install vcpkg (Windows)
id: vcpkg_windows
@@ -375,8 +394,8 @@ jobs:
git clone https://github.com/microsoft/vcpkg.git ${Env:GITHUB_WORKSPACE}\vcpkg
cd ${Env:GITHUB_WORKSPACE}\vcpkg
.\bootstrap-vcpkg.bat
vcpkg install tl-expected range-v3 catch2 nlohmann-json fmt --triplet x64-windows
vcpkg integrate install
vcpkg install fmt --triplet x64-windows
- name: Configure
shell: cmake -P {0}
@@ -424,6 +443,27 @@ jobs:
set(BUILD_V2 ON)
endif()
set(USE_LLVM OFF)
if("${{ matrix.config.name }}" STREQUAL "macOS Clang Debug (C++17)" OR
"${{ matrix.config.name }}" STREQUAL "macOS Clang Release (C++17)" OR
"${{ matrix.config.name }}" STREQUAL "macOS Clang Debug (C++20)" OR
"${{ matrix.config.name }}" STREQUAL "macOS Clang Release (C++20)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 11 Debug (C++17)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 11 Release (C++17)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 12 Debug (C++17)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 12 Release (C++17)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 14 Debug (C++17)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 14 Release (C++17)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 11 Debug (C++20)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 11 Release (C++20)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 12 Debug (C++20)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 12 Release (C++20)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 14 Debug (C++20)" OR
"${{ matrix.config.name }}" STREQUAL "Linux Clang 14 Release (C++20)"
)
set(USE_LLVM ON)
endif()
execute_process(
COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/cmake
-S .
@@ -435,8 +475,9 @@ jobs:
-D skyr_BUILD_DOCS=OFF
-D skyr_BUILD_EXAMPLES=OFF
-D skyr_BUILD_V2=${BUILD_V2}
-D skyr_BUILD_WITH_LLVM_LIBCXX=${USE_LLVM}
-D SKY_VERBOSE_BUILD=ON
-D CMAKE_BUILD_TYPE=${{ matrix.config.build_type }}
-D CMAKE_TOOLCHAIN_FILE=$ENV{GITHUB_WORKSPACE}/vcpkg/scripts/buildsystems/vcpkg.cmake
-D CMAKE_INSTALL_PREFIX=$ENV{GITHUB_WORKSPACE}/install
RESULT_VARIABLE result
)
65 changes: 44 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -4,21 +4,25 @@
# http://www.boost.org/LICENSE_1_0.txt)


cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.21)

get_directory_property(skyr_is_subproject PARENT_DIRECTORY)

if(NOT skyr_is_subproject)
set(skyr_IS_TOP_LEVEL_PROJECT YES)
else()
set(skyr_IS_TOP_LEVEL_PROJECT NO)
endif()

project(
skyr-url
VERSION 2.0.0
VERSION 2.0.1
HOMEPAGE_URL https://cpp-netlib.github.io/url
DESCRIPTION "A C++ library that implements the WhatWG URL specification"
LANGUAGES CXX
)

if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(skyr_IS_TOP_LEVEL_PROJECT YES)
else()
set(skyr_IS_TOP_LEVEL_PROJECT NO)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

option(skyr_BUILD_TESTS "Build the URL tests." ON)
option(skyr_BUILD_DOCS "Build the URL documentation." OFF)
@@ -35,23 +39,41 @@ option(skyr_BUILD_V1 "Build v1" ON)
option(skyr_BUILD_V2 "Build v2, which uses C++20 features" OFF)

if (skyr_IS_TOP_LEVEL_PROJECT)
set(CMAKE_VERBOSE_MAKEFILE true)
set(CMAKE_CXX_STANDARD 17)
if (skyr_BUILD_V2)
if(skyr_BUILD_V2)
set(CMAKE_CXX_STANDARD 20)
else()
set(CMAKE_CXX_STANDARD 17)
endif()

set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

find_package(tl-expected CONFIG REQUIRED)
find_package(range-v3 CONFIG REQUIRED)
include(skyr-url-options)
include(skyr-url-env)
include(skyr-url-flags)

include(cmake/CPM.cmake)
CPMAddPackage(
NAME expected
GITHUB_REPOSITORY TartanLlama/expected
GIT_TAG v1.1.0
OPTIONS "EXPECTED_BUILD_TESTS OFF" #pulls is super old catch2
)
CPMAddPackage("gh:ericniebler/range-v3#0.12.0")
CPMAddPackage("gh:fmtlib/fmt#10.1.1")


if (skyr_ENABLE_JSON_FUNCTIONS)
find_package(nlohmann_json CONFIG REQUIRED)
CPMAddPackage(
NAME json
GITHUB_REPOSITORY nlohmann/json
GIT_TAG v3.11.3
OPTIONS "JSON_Install ON"
)
endif()

if (skyr_USE_STATIC_CRT AND ${CMAKE_CXX_COMPILER_ID} MATCHES MSVC)
if (skyr_USE_STATIC_CRT AND (SKY_CXX_COMPILER_CLANGCL OR SKY_CXX_COMPILER_MSVC))
include(${PROJECT_SOURCE_DIR}/cmake/skyr-url-functions.cmake)
skyr_replace_dynamic_msvcrt_linker_flags()
endif()
@@ -61,30 +83,31 @@ set(warnings_as_errors $<BOOL:${skyr_WARNINGS_AS_ERRORS}>)
set(no_exceptions $<BOOL:${skyr_BUILD_WITHOUT_EXCEPTIONS}>)
set(no_rtti $<BOOL:${skyr_BUILD_WITHOUT_RTTI}>)

set(gnu $<CXX_COMPILER_ID:GNU>)
set(clang $<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>)
set(gnu $<BOOL:${SKY_CXX_COMPILER_GCC}>)
set(clang $<BOOL:${SKY_CXX_COMPILER_CLANG}>)
set(libcxx $<AND:${clang},$<BOOL:${skyr_BUILD_WITH_LLVM_LIBCXX}>>)
set(clang_with_gnu_stdlib $<AND:$<CXX_COMPILER_ID:Clang>,$<NOT:$<BOOL:${WIN32}>>,$<NOT:$<BOOL:${skyr_BUILD_WITH_LLVM_LIBCXX}>>>)
set(msvc $<CXX_COMPILER_ID:MSVC>)
set(clang_with_gnu_stdlib $<AND:${clang},$<NOT:$<BOOL:${skyr_BUILD_WITH_LLVM_LIBCXX}>>>)
set(msvc $<BOOL:${SKY_CXX_COMPILER_MSVC}>)

add_subdirectory(src)

# Testing
if (skyr_BUILD_TESTS)
message(STATUS "Configuring tests")
message(STATUS "[skyr-url] Configuring tests")
CPMAddPackage("gh:catchorg/Catch2@3.4.0")
enable_testing()
add_subdirectory(tests)
endif()

# Documentation
if (skyr_BUILD_DOCS)
message(STATUS "Configuring documentation")
message(STATUS "[skyr-url] Configuring documentation")
add_subdirectory(docs)
endif()

# Examples
if (skyr_BUILD_EXAMPLES)
message(STATUS "Configuring examples")
message(STATUS "[skyr-url] Configuring examples")
add_subdirectory(examples)
endif()

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
[![GitHub Actions Status](
https://github.com/cpp-netlib/url/workflows/skyr-url%20CI/badge.svg?branch=main)](
https://github.com/cpp-netlib/url/actions?query=workflow%3A%22skyr-url+CI%22)

## Notice

I've changed the name of the default branch from `master` to `main`. Please make future
24 changes: 24 additions & 0 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: MIT
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set(CPM_DOWNLOAD_VERSION 0.38.7)
set(CPM_HASH_SUM "83e5eb71b2bbb8b1f2ad38f1950287a057624e385c238f6087f94cdfc44af9c5")

if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()

# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)

file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
)

include(${CPM_DOWNLOAD_LOCATION})
Loading