refactor: downcasting-specific build options removed

This commit is contained in:
Mateusz Pusz
2022-12-25 17:30:08 +01:00
parent 1cec3d4867
commit daf6d2fb7a
2 changed files with 0 additions and 20 deletions

View File

@@ -54,8 +54,6 @@ class MPUnitsConan(ConanFile):
url = "https://github.com/mpusz/units"
settings = "os", "compiler", "build_type", "arch"
requires = "gsl-lite/0.40.0"
options = {"downcast_mode": ["off", "on", "auto"]}
default_options = {"downcast_mode": "on"}
exports = ["LICENSE.md"]
exports_sources = [
"docs/*",

View File

@@ -22,10 +22,6 @@
cmake_minimum_required(VERSION 3.19)
# core library options
set(${projectPrefix}DOWNCAST_MODE ON CACHE STRING "Select downcasting mode")
set_property(CACHE ${projectPrefix}DOWNCAST_MODE PROPERTY STRINGS AUTO ON OFF)
# find dependencies
find_package(gsl-lite CONFIG REQUIRED)
@@ -65,20 +61,6 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
)
endif()
if(DEFINED ${projectPrefix}DOWNCAST_MODE)
set(downcast_mode_options OFF ON AUTO)
list(FIND downcast_mode_options "${${projectPrefix}DOWNCAST_MODE}" downcast_mode)
if(downcast_mode EQUAL -1)
message(FATAL_ERROR
"'${projectPrefix}DOWNCAST_MODE' should be one of ${downcast_mode_options} ('${${projectPrefix}DOWNCAST_MODE}' received)"
)
else()
message(STATUS "${projectPrefix}DOWNCAST_MODE: ${${projectPrefix}DOWNCAST_MODE}")
target_compile_definitions(mp-units-core INTERFACE ${projectPrefix}DOWNCAST_MODE=${downcast_mode})
endif()
endif()
set_target_properties(mp-units-core PROPERTIES EXPORT_NAME core)
add_library(mp-units::core ALIAS mp-units-core)