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 . 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) 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 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: