From e2d87db3ff8c9ab8c3c139aba4998e641d5f1e09 Mon Sep 17 00:00:00 2001 From: Ivo Hedtke Date: Wed, 9 Aug 2023 17:21:35 +0200 Subject: [PATCH 1/4] Set minimum CMake version to 3.15.7 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbdfaacf..e2312f80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.15.7) project(ScipPP LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) From 3880a326d2c6ad60e1a63d691c87dd7616615194 Mon Sep 17 00:00:00 2001 From: Ivo Hedtke Date: Wed, 9 Aug 2023 17:25:37 +0200 Subject: [PATCH 2/4] Add missing attributes to conanfile.py --- conanfile.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index 8f4eae40..c77c2002 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,6 +1,9 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.scm import Git +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.scm import Git, Version class ScipPlusPlus(ConanFile): @@ -8,14 +11,55 @@ class ScipPlusPlus(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps" exports_sources = "CMakeLists.txt", "source/*", "include/*" + description = "SCIP++ is a C++ wrapper for SCIP's C interface" + package_type = "library" + topics = ("mip", "solver", "linear", "programming") + license = "Apache-2.0" + homepage = "https://github.com/scipopt/SCIPpp" options = { - "with_tests": [True, False] + "with_tests": [True, False], + "shared": [True, False], + "fPIC": [True, False] } default_options = { "with_tests": False, + "shared": False, + "fPIC": True } _full_version: str = None + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + "msvc": "192" + } + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 192) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + def set_version(self): git = Git(self, folder=self.recipe_folder) try: From 310bef8e4a7f4c8fac3cf2e07b15fe675ba5ddd4 Mon Sep 17 00:00:00 2001 From: Ivo Hedtke Date: Thu, 10 Aug 2023 14:18:17 +0200 Subject: [PATCH 3/4] Update changelog --- changelog.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/changelog.md b/changelog.md index 2fe3cf32..c26c91ad 100644 --- a/changelog.md +++ b/changelog.md @@ -4,10 +4,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - [Doc:Unreleased] +## [1.0.1] - 2023-08-10 + +### Added + +- [PR6](https://github.com/scipopt/SCIPpp/pull/6) + Added attributes `description`, `package_type`, `topics`, `license`, and `homepage` to `conanfile.py`. + +### Fixed + +- [PR6](https://github.com/scipopt/SCIPpp/pull/6) + Downgraded minimum CMake version from 3.16 to 3.15.7 + ## [1.0.0] - 2023-08-09 Initial release [Doc:Unreleased]: https://scipopt.github.io/SCIPpp/ [Unreleased]: https://github.com/scipopt/SCIPpp +[1.0.1]: https://github.com/scipopt/SCIPpp/releases/tag/1.0.1 [1.0.0]: https://github.com/scipopt/SCIPpp/releases/tag/1.0.0 From 5bf0534e4fc9c4b66567af57e3cd09135a5aeb16 Mon Sep 17 00:00:00 2001 From: Ivo Hedtke Date: Thu, 10 Aug 2023 14:44:14 +0200 Subject: [PATCH 4/4] Set compiler.cppstd=17 on Windows --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 19202937..211a15e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,7 @@ jobs: - name: Run Conan Install run: | conan profile detect + powershell -Command "(gc $(conan profile path default)) -replace 'compiler.cppstd=14', 'compiler.cppstd=17' | Out-File -encoding ASCII $(conan profile path default)" conan install -of . -o with_tests=True . - name: Run CMake run: cmake --preset conan-default .