Skip to content
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

Make Editable #97

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ include (cmake/Flags.cmake)

set(CMAKE_CXX_STANDARD 20)

if (NOT BUILD_TESTING STREQUAL OFF)
set(ENABLE_TESTING ON)
enable_testing()
find_package(GTest QUIET REQUIRED)
endif()
enable_testing()
find_package(GTest QUIET REQUIRED)

if (DEFINED BUILD_COVERAGE)
if (${BUILD_COVERAGE})
Expand Down
26 changes: 17 additions & 9 deletions 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.cmake import CMakeToolchain, CMakeDeps, CMake, cmake_layout
from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake
from conan.tools.files import copy
from conan.tools.files import copy
from os.path import join
Expand All @@ -10,7 +10,7 @@

class NuRaftMesgConan(ConanFile):
name = "nuraft_mesg"
version = "3.5.9"
version = "3.5.10"

homepage = "https://github.com/eBay/nuraft_mesg"
description = "A gRPC service for NuRAFT"
Expand Down Expand Up @@ -59,18 +59,28 @@ def configure(self):
raise ConanInvalidConfiguration("Coverage/Sanitizer requires Testing!")

def build_requirements(self):
if not self.conf.get("tools.build:skip_test", default=False):
self.test_requires("lz4/[>=1.9]")
self.test_requires("gtest/1.14.0")
self.test_requires("jungle/cci.20221201")
self.test_requires("lz4/[>=1.9]")
self.test_requires("gtest/1.14.0")
self.test_requires("jungle/cci.20221201")

def requirements(self):
self.requires("boost/1.83.0", transitive_headers=True)
self.requires("sisl/[^12.2]@oss/master", transitive_headers=True)
self.requires("nuraft/2.4.2", transitive_headers=True)

def layout(self):
cmake_layout(self)
self.folders.source = "."
self.folders.build = join("build", str(self.settings.build_type))
self.folders.generators = join(self.folders.build, "generators")

self.cpp.source.includedirs = ["include"]

self.cpp.build.components["proto"].libdirs = ["src/proto"]

self.cpp.package.components["proto"].libs = ["nuraft_mesg_proto"]
self.cpp.package.components["proto"].set_property("pkg_config_name", "libnuraft_mesg_proto")
self.cpp.package.includedirs = ["include"] # includedirs is already set to 'include' by
self.cpp.package.libdirs = ["lib"]

def generate(self):
# This generates "conan_toolchain.cmake" in self.generators_folder
Expand Down Expand Up @@ -109,8 +119,6 @@ def package(self):
copy(self, "*.so*", self.build_folder, lib_dir, keep_path=False)

def package_info(self):
self.cpp_info.components["proto"].libs = ["nuraft_mesg_proto"]
self.cpp_info.components["proto"].set_property("pkg_config_name", "libnuraft_mesg_proto")
self.cpp_info.components["proto"].requires.extend([
"nuraft::nuraft",
"boost::boost",
Expand Down
6 changes: 1 addition & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,4 @@ add_subdirectory (proto)
add_subdirectory (flatb)

add_subdirectory (lib)
if(DEFINED ENABLE_TESTING)
if(${ENABLE_TESTING})
add_subdirectory(tests)
endif()
endif()
add_subdirectory(tests)
Loading