Skip to content

Commit 2f2ed56

Browse files
authored
📌 Cleanup some of the code & dependencies (#31)
1 parent 1b66921 commit 2f2ed56

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
cmake_minimum_required(VERSION 3.30)
15+
cmake_minimum_required(VERSION 4.0)
1616

1717
# Generate compile commands for anyone using our libraries.
1818
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
@@ -57,6 +57,8 @@ install(
5757
if(CMAKE_CROSSCOMPILING)
5858
message(STATUS "Cross compiling, skipping unit test execution")
5959
else()
60+
message(STATUS "Building unit tests!")
61+
6062
find_package(ut REQUIRED)
6163
add_executable(strong_ptr_unit_test)
6264
target_sources(strong_ptr_unit_test PUBLIC
@@ -90,7 +92,6 @@ else()
9092

9193
target_link_libraries(strong_ptr_unit_test PRIVATE Boost::ut strong_ptr)
9294

93-
message(STATUS "Executing unit tests!")
9495
add_custom_target(run_tests ALL
9596
DEPENDS strong_ptr_unit_test
9697
COMMAND strong_ptr_unit_test

conanfile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def validate(self):
8585
self._validate_compiler_version()
8686

8787
def build_requirements(self):
88-
# Provides CMake, Ninja, & toolchain scripts for enabling modules
89-
self.tool_requires("cmake-modules-toolchain/1.0.2")
88+
self.tool_requires("cmake/[^4.0.0]")
89+
self.tool_requires("ninja/[^1.3.0]")
9090
self.test_requires("boost-ext-ut/2.3.1",
9191
options={'disable_module': False})
9292

@@ -98,6 +98,7 @@ def layout(self):
9898

9999
def generate(self):
100100
tc = CMakeToolchain(self)
101+
tc.generator = "Ninja"
101102
tc.generate()
102103

103104
deps = CMakeDeps(self)

test_package/conanfile.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,24 @@
1616

1717
from conan import ConanFile
1818
from conan.tools.build import cross_building
19-
from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain, CMakeDeps
19+
from conan.tools.cmake import CMake, cmake_layout
2020
from pathlib import Path
2121

2222

2323
class TestPackageConan(ConanFile):
2424
settings = "os", "arch", "compiler", "build_type"
25-
generators = "VirtualRunEnv"
25+
generators = "VirtualRunEnv", "CMakeDeps", "CMakeToolchain"
2626

2727
def build_requirements(self):
28-
self.tool_requires("cmake-modules-toolchain/1.0.2")
28+
self.tool_requires("cmake/[^4.0.0]")
29+
self.tool_requires("ninja/[^1.3.0]")
2930

3031
def requirements(self):
3132
self.requires(self.tested_reference_str)
3233

3334
def layout(self):
3435
cmake_layout(self)
3536

36-
def generate(self):
37-
tc = CMakeToolchain(self)
38-
tc.generate()
39-
40-
deps = CMakeDeps(self)
41-
deps.generate()
42-
4337
def build(self):
4438
cmake = CMake(self)
4539
cmake.configure()

0 commit comments

Comments
 (0)