Skip to content

Commit a1ae4b2

Browse files
committed
make rsl-util header-only again
1 parent 2c23516 commit a1ae4b2

5 files changed

Lines changed: 16 additions & 33 deletions

File tree

CMakeLists.txt

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,26 @@ project(rsl-util VERSION 0.1 LANGUAGES CXX)
88

99
include(GNUInstallDirs)
1010

11-
add_library(rsl-util)
11+
add_library(rsl-util INTERFACE)
1212
add_library(rsl::util ALIAS rsl-util)
13-
target_compile_options(rsl-util PUBLIC
13+
14+
# TODO remove
15+
target_compile_options(rsl-util INTERFACE
1416
"-stdlib=libc++"
1517
"-freflection-latest"
1618
"-Wno-c++26-extensions"
1719
)
18-
target_compile_features(rsl-util PUBLIC cxx_std_26)
19-
target_link_options(rsl-util PUBLIC "-stdlib=libc++")
20-
target_link_libraries(rsl-util PUBLIC "c++abi")
21-
target_include_directories(rsl-util PUBLIC
20+
21+
# TODO remove
22+
target_compile_features(rsl-util INTERFACE cxx_std_26)
23+
target_link_options(rsl-util INTERFACE "-stdlib=libc++")
24+
target_link_libraries(rsl-util INTERFACE "c++abi")
25+
26+
target_include_directories(rsl-util INTERFACE
2227
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
2328
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
2429
)
2530

26-
add_subdirectory(src)
27-
2831
option(BUILD_TESTING "Enable tests" ON)
2932
option(BUILD_EXAMPLES "Enable examples" ON)
3033
option(RSL_UTIL_INSTALL "Generate install target for rsl-util" ON)
@@ -56,12 +59,6 @@ if (RSL_UTIL_INSTALL)
5659
${PROJECT_BINARY_DIR}/rsl-util-config.cmake
5760
DESTINATION ${CMAKE_INSTALLDIR_CMAKEDIR}
5861
)
59-
install(TARGETS rsl-util
60-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
61-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
62-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
63-
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
64-
)
6562
endif()
6663

6764
if (BUILD_TESTING)

conanfile.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,23 @@
66
class RslUtilRecipe(ConanFile):
77
name = "rsl-util"
88
version = "0.1"
9-
package_type = "library"
9+
package_type = "header-library"
10+
no_copy_source = True
1011

1112
# Optional metadata
1213
license = "MIT"
1314
author = "Tsche che@pydong.org"
1415
description = "Reflective reimplementations of various standard library types and other utilities."
1516
topics = () # TODO
1617

17-
# Binary configuration
18-
settings = "os", "compiler", "build_type", "arch"
18+
settings = "os", "arch", "compiler", "build_type"
1919
options = {
20-
"shared": [True, False], "fPIC": [True, False],
2120
"examples": [True, False], "tests": [True, False]
2221
}
23-
default_options = {"shared": False, "fPIC": True,
24-
"examples": False, "tests": False}
22+
default_options = {"examples": False, "tests": False}
2523
generators = "CMakeToolchain", "CMakeDeps"
2624

2725
exports_sources = "CMakeLists.txt", "include/*", "test/*", "cmake/*"
28-
29-
def config_options(self):
30-
if self.settings.os == "Windows":
31-
self.options.rm_safe("fPIC")
32-
33-
def configure(self):
34-
if self.options.shared:
35-
self.options.rm_safe("fPIC")
36-
3726
def requirements(self):
3827
if self.options.tests:
3928
self.requires("gtest/1.14.0")
@@ -62,4 +51,4 @@ def package_info(self):
6251
util = self.cpp_info.components["util"]
6352
util.set_property("cmake_target_name", "rsl::util")
6453
util.includedirs = ["include"]
65-
util.libs = ["rsl-util"]
54+
util.libs = []

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/dummy.cpp

Whitespace-only changes.

test/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#include <gtest/gtest.h>
2-
#include <gmock/gmock.h>
3-
42

53
TEST(Dummy, AlwaysPasses) {
64
ASSERT_TRUE(true);

0 commit comments

Comments
 (0)