Skip to content

Commit

Permalink
Remove hardcoded mincppstd
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrilRBS committed Jun 6, 2024
1 parent cfee455 commit 51ca004
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions recipes/laszip/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ patches:
"3.4.4":
- patch_file: "patches/0003-no-build-laszip-api.patch"

Check warning on line 13 in recipes/laszip/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/0003-no- ... ^ (line: 13)
- patch_file: "patches/0004-no-rpath-and-relocatable-macos.patch"

Check warning on line 14 in recipes/laszip/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/0004-no- ... ^ (line: 14)
- patch_file: "patches/0003-3.4.4-remove-cppstd-hardcode.patch"
patch_type: "conan"
patch_description: "Let Conan set the cppstd, instead of forcing it (In this version it's incorreclty set to C++17 instead of the supported C++14)"
10 changes: 9 additions & 1 deletion recipes/laszip/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conan import ConanFile
from conan.tools.build import stdcpp_library
from conan.tools.build import stdcpp_library, check_min_cppstd
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
from conan.tools.scm import Version
Expand Down Expand Up @@ -27,6 +27,10 @@ class LaszipConan(ConanFile):
"fPIC": True,
}

@property
def _min_cppstd(self):
return 14

def export_sources(self):
export_conandata_patches(self)

Expand All @@ -39,6 +43,10 @@ def configure(self):
self.license = "Apache-2.0"
if self.options.shared:
self.options.rm_safe("fPIC")

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

def layout(self):
cmake_layout(self, src_folder="src")
Expand Down
12 changes: 12 additions & 0 deletions recipes/laszip/all/patches/0003-3.4.4-remove-cppstd-hardcode.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b0a02b..a9cc6b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.10)

project(LASZIP CXX C)
-set(CMAKE_CXX_STANDARD 17)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

set(ROOT_DIR "${PROJECT_SOURCE_DIR}")

0 comments on commit 51ca004

Please sign in to comment.