forked from TartanLlama/optional
Do CMake properly
This commit is contained in:
@ -3,6 +3,7 @@ os:
|
||||
- Visual Studio 2017
|
||||
|
||||
build_script:
|
||||
- git submodule update --init --recursive
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ..
|
||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "cmake/tl-cmake"]
|
||||
path = cmake/tl-cmake
|
||||
url = https://github.com/TartanLlama/tl-cmake.git
|
@ -1,12 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
|
||||
project(optional)
|
||||
project(tl-optional VERSION 1.0.0 LANGUAGES CXX)
|
||||
|
||||
option(OPTIONAL_ENABLE_TESTS "Enable tests." ON)
|
||||
|
||||
add_library(optional INTERFACE)
|
||||
target_sources(optional INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/tl/optional.hpp)
|
||||
target_include_directories(optional INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/tl)
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/tl-cmake" ${CMAKE_MODULE_PATH})
|
||||
include(add-tl)
|
||||
|
||||
tl_add_library(optional SOURCES
|
||||
include/tl/optional.hpp)
|
||||
|
||||
if(OPTIONAL_ENABLE_TESTS)
|
||||
# Prepare "Catch" library for other executables
|
||||
|
1
cmake/tl-cmake
Submodule
1
cmake/tl-cmake
Submodule
Submodule cmake/tl-cmake added at 576e25feab
3
cmake/tl-optional-config.cmake.in
Normal file
3
cmake/tl-optional-config.cmake.in
Normal file
@ -0,0 +1,3 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/tl-optional-targets.cmake")
|
@ -15,8 +15,9 @@
|
||||
#ifndef TL_OPTIONAL_HPP
|
||||
#define TL_OPTIONAL_HPP
|
||||
|
||||
#define TL_OPTIONAL_VERSION_MAJOR 0
|
||||
#define TL_OPTIONAL_VERSION_MINOR 5
|
||||
#define TL_OPTIONAL_VERSION_MAJOR 1
|
||||
#define TL_OPTIONAL_VERSION_MINOR 0
|
||||
#define TL_OPTIONAL_VERSION_PATCH 0
|
||||
|
||||
#include <exception>
|
||||
#include <functional>
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
TEST_CASE("Assignment value", "[assignment.value]") {
|
||||
tl::optional<int> o1 = 42;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
// Old versions of GCC don't have the correct trait names. Could fix them up if needs be.
|
||||
#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
#define TOKENPASTE(x, y) x##y
|
||||
#define TOKENPASTE2(x, y) TOKENPASTE(x, y)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
#include <vector>
|
||||
|
||||
struct foo {
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
#include <utility>
|
||||
#include <tuple>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
#include <string>
|
||||
|
||||
#define TOKENPASTE(x, y) x##y
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
TEST_CASE("Hashing", "[hash]") {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
struct foo{
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
TEST_CASE("Noexcept", "[noexcept]") {
|
||||
tl::optional<int> o1{4};
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
TEST_CASE("Nullopt", "[nullopt]") {
|
||||
tl::optional<int> o1 = tl::nullopt;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
struct move_detector {
|
||||
move_detector() = default;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "catch.hpp"
|
||||
#include "optional.hpp"
|
||||
#include <tl/optional.hpp>
|
||||
|
||||
TEST_CASE("Relational ops", "[relops]") {
|
||||
tl::optional<int> o1{4};
|
||||
|
Reference in New Issue
Block a user