Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp-validator: add version 2.1.1 #23978

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
3 changes: 3 additions & 0 deletions recipes/cpp-validator/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.1.1":
url: "https://github.com/evgeniums/cpp-validator/archive/refs/tags/v2.1.1.tar.gz"
sha256: "3a9e63c529a9b69092597077111b81fd7f0ab7ffa1a80b0f15fb24270cb9acdc"
"2.0.3":
url: "https://github.com/evgeniums/cpp-validator/archive/refs/tags/v2.0.3.tar.gz"
sha256: "0afc607377518edd6adc1612962ed5d5808d96e5b40944d9ce7e91a1aa9ab1d8"
5 changes: 4 additions & 1 deletion recipes/cpp-validator/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ class CPPValidatorConan(ConanFile):
def _min_cppstd(self):
# cpp-validator rquires C++17 on MSVC
# https://github.com/evgeniums/cpp-validator/blob/v2.0.3/CMakeLists.txt#L241
return "17" if is_msvc(self) else "14"
if is_msvc(self) or Version(self.version) >= "2.1.1":
return "17"
else:
return "14"

@property
def _compilers_minimum_version(self):
Expand Down
7 changes: 5 additions & 2 deletions recipes/cpp-validator/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ project(test_package LANGUAGES CXX)
find_package(cpp-validator REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} cpp-validator::cpp-validator)
if(MSVC)
target_link_libraries(${PROJECT_NAME} PRIVATE cpp-validator::cpp-validator)
if(MSVC OR cpp-validator_VERSION VERSION_GREATER_EQUAL "2.1.1")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
else()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
endif()
if(cpp-validator_VERSION VERSION_LESS "2.1.1")
target_compile_definitions(${PROJECT_NAME} PRIVATE CPP_VALIDATOR_2_0)
endif()
6 changes: 6 additions & 0 deletions recipes/cpp-validator/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#include <iostream>

#ifdef CPP_VALIDATOR_2_0
#include "dracosha/validator/validator.hpp"
#include "dracosha/validator/validate.hpp"
using namespace DRACOSHA_VALIDATOR_NAMESPACE;
#else
#include "hatn/validator/validator.hpp"
#include "hatn/validator/validate.hpp"
using namespace HATN_VALIDATOR_NAMESPACE;
#endif

int main()
{
Expand Down
2 changes: 2 additions & 0 deletions recipes/cpp-validator/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"2.1.1":
folder: all
"2.0.3":
folder: all
Loading