Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from conans import ConanFile


class ScopeguardConan(ConanFile):
name = "scope_guard"
version = "0.2.4-dev.1"
license = "The Unlicense"
author = "Ricardo Abreu ricab@ricabhome.org"
url = "https://github.com/ricab/scope_guard"
homepage = "https://ricab.github.io/scope_guard/"
description = "A modern C++ scope guard that is easy to use but hard to misuse."
topics = ("scope guard", "RAII", "resource management", "idioms",
"header-only", "single-file")
exports_sources = "scope_guard.hpp"
no_copy_source = True

def package(self):
self.copy("scope_guard.hpp", dst="include")
10 changes: 10 additions & 0 deletions test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.10)
project(PackageTest CXX)

set(CMAKE_CXX_STANDARD 17)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_executable(example example.cpp)
target_link_libraries(example ${CONAN_LIBS})
18 changes: 18 additions & 0 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os

from conans import ConanFile, CMake, tools


class ScopeguardTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self.settings):
os.chdir("bin")
self.run(".%sexample" % os.sep)
7 changes: 7 additions & 0 deletions test_package/example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <iostream>

#include <scope_guard.hpp>

int main() {
auto guard = sg::make_scope_guard([]() noexcept { return; });
}