Skip to content

Commit

Permalink
embag: set min cxx_standard to 11
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed May 15, 2023
1 parent 2270ca3 commit 0a283f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions recipes/embag/all/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set_target_properties(embag PROPERTIES
# embag does not export any symbols otherwise
WINDOWS_EXPORT_ALL_SYMBOLS ON
)
target_compile_features(embag PUBLIC cxx_std_11)
target_link_libraries(embag PUBLIC
Boost::iostreams
Boost::headers
Expand Down
15 changes: 10 additions & 5 deletions recipes/embag/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import os

from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import (
get,
copy,
rm,
)
from conan.tools.files import get, copy, rm

required_conan_version = ">=1.53.0"

Expand All @@ -29,6 +26,10 @@ class EmbagConan(ConanFile):
"fPIC": True,
}

@property
def _min_cppstd(self):
return 11

def export_sources(self):
copy(
self,
Expand All @@ -53,6 +54,10 @@ def requirements(self):
self.requires("lz4/1.9.4", transitive_headers=True, transitive_libs=True)
self.requires("bzip2/1.0.8", transitive_headers=True, transitive_libs=True)

def validate(self):
if self.settings.compiler.cppstd:
check_min_cppstd(self, self._min_cppstd)

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

Expand Down
1 change: 1 addition & 0 deletions recipes/embag/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ find_package(embag REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE embag::embag)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)

0 comments on commit 0a283f1

Please sign in to comment.