-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
sdbus-cpp/0.8.3 #4148
sdbus-cpp/0.8.3 #4148
Conversation
recipes/sdbus-cpp/all/conanfile.py
Outdated
tools.check_min_cppstd(self, "17") | ||
|
||
def build_requirements(self): | ||
self.build_requires("cmake/3.19.1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually don't require CMake as this is one of very few dependencies we pre-require. Exceptions can be made when the CMake version required is very recent or only supports a specific old versions or something like that.
This projects seems to be fine with CMake >= 3.13.0 so I would argue that it should be removed here
Failure in build 1 (
|
Failure in build 2 (
|
recipes/sdbus-cpp/all/conanfile.py
Outdated
raise ConanInvalidConfiguration("Only Linux supported") | ||
if self.options.shared: | ||
del self.options.fPIC | ||
tools.check_min_cppstd(self, "17") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs an if check and some boilerplate
You can copy this conan-io/conan#8002 (comment)
recipes/sdbus-cpp/all/conanfile.py
Outdated
self._cmake.definitions["BUILD_TESTS"] = False | ||
self._cmake.definitions["BUILD_LIBSYSTEMD"] = False | ||
self._cmake.configure(source_folder=self._source_subfolder, | ||
build_folder=self._build_subfolder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you are missing the cmake wrapper which is required to inject the right flags
conan_basic_setup() | ||
|
||
add_executable(example example.cpp) | ||
target_link_libraries(example ${CONAN_LIBS}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to test the cmake components you added
1cc1fb3
to
898c339
Compare
All green in build 3 (
|
recipes/sdbus-cpp/all/conanfile.py
Outdated
def configure(self): | ||
if self.settings.os != "Linux": | ||
raise ConanInvalidConfiguration("Only Linux supported") | ||
if self.options.shared: | ||
del self.options.fPIC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def configure(self): | |
if self.settings.os != "Linux": | |
raise ConanInvalidConfiguration("Only Linux supported") | |
if self.options.shared: | |
del self.options.fPIC | |
def configure(self): | |
if self.options.shared: | |
del self.options.fPIC | |
def validate(self): | |
if self.settings.os != "Linux": | |
raise ConanInvalidConfiguration("Only Linux supported") |
https://blog.conan.io/2020/12/14/New-conan-release-1-32.html
recipes/sdbus-cpp/all/conanfile.py
Outdated
self._cmake.configure() | ||
return self._cmake | ||
|
||
def fix_tools_cmake(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def fix_tools_cmake(self): | |
def _patch_sources(self): |
Any custom method should be declared as protected to avoid future name collisions.
_patch_sources is no official name or a pattern, but it's the most popular in CCI.
recipes/sdbus-cpp/all/conanfile.py
Outdated
# FIXME: remove after | ||
# https://github.com/Kistler-Group/sdbus-cpp/pull/136 | ||
self.fix_tools_cmake() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# FIXME: remove after | |
# https://github.com/Kistler-Group/sdbus-cpp/pull/136 | |
self.fix_tools_cmake() | |
# FIXME: remove after https://github.com/Kistler-Group/sdbus-cpp/pull/136 | |
self._patch_sources() |
Try to keep fixme, todo, xxx as single line. It's printed as warning on output, it's easier to be visualized.
self.cpp_info.components["sdbus-c++"].names["cmake_find_package_multi"] = "sdbus-c++" | ||
self.cpp_info.components["sdbus-c++"].names["pkg_config"] = "sdbus-c++" | ||
if self.options.with_code_gen: | ||
bin_path = os.path.join(self.package_folder, "bin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bin_path = os.path.join(self.package_folder, "bin") | |
bin_path = os.path.join(self.package_folder, "bin") | |
self.output.info("Appending PATH env var with : {}".format(bin_path)) |
That's a common pattern when adding something to PATH.
All green in build 4 (
|
Co-authored-by: Uilian Ries <[email protected]>
Specify library name and version: sdbus-cpp/0.8.3
conan-center hook activated.