Skip to content

Commit

Permalink
Make Editable
Browse files Browse the repository at this point in the history
  • Loading branch information
szmyd committed Aug 12, 2024
1 parent 95841f1 commit 7aa82b2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
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
37 changes: 22 additions & 15 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,33 @@ 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.components["proto"].requires.extend([
"nuraft::nuraft",
"boost::boost",
"sisl::sisl"
])
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,14 +124,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",
"sisl::sisl"
])

for component in self.cpp_info.components.values():
if self.options.get_safe("sanitize"):
component.sharedlinkflags.append("-fsanitize=address")
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)

0 comments on commit 7aa82b2

Please sign in to comment.