Skip to content

Commit

Permalink
Cleanup, pin dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrilRBS authored Sep 16, 2024
1 parent 7ee12be commit 45111c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
13 changes: 4 additions & 9 deletions recipes/melon/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
import os
Expand Down Expand Up @@ -34,15 +34,12 @@ def _compilers_minimum_version(self):
"Visual Studio": "17",
}

def export_sources(self):
export_conandata_patches(self)

def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
self.requires("range-v3/[>=0.11.0]")
self.requires("fmt/[>=10.0.0]")
self.requires("range-v3/0.12.0")
self.requires("fmt/10.2.1")

def package_id(self):
self.info.clear()
Expand All @@ -59,10 +56,8 @@ def validate(self):
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

# Not mandatory when there is no patch, but will suppress warning message about missing build() method
def build(self):
# The attribute no_copy_source should not be used when applying patches in build
apply_conandata_patches(self)
pass

def package(self):
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
Expand Down
5 changes: 1 addition & 4 deletions recipes/melon/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
cmake_minimum_required(VERSION 3.15)
# project(test_package LANGUAGES C) # if the project is pure C
project(test_package LANGUAGES CXX) # if the project uses c++
project(test_package LANGUAGES CXX)

find_package(melon REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
# don't link to ${CONAN_LIBS} or CONAN_PKG::package
target_link_libraries(${PROJECT_NAME} PRIVATE melon::melon)
# In case the target project need a specific C++ standard
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
2 changes: 1 addition & 1 deletion recipes/melon/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ int main(int argc, char *argv[])
if (std::ranges::find(path, 8u) == path.end()) return EXIT_FAILURE;

return EXIT_SUCCESS;
}
}

0 comments on commit 45111c2

Please sign in to comment.