mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 11:54:27 +02:00
refactor: downcasting-specific build options removed
This commit is contained in:
@@ -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/*",
|
||||
|
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user