Skip to content

Commit

Permalink
Refactor CMakeLists: Consolidate targets into RoughPy_Platform
Browse files Browse the repository at this point in the history
Simplify the CMake configurations by merging RoughPy_Generics_BuiltinType and RoughPy_Generics_Multiprecision targets into RoughPy_Platform. This change reduces redundancy and centralizes target management, improving maintainability.
  • Loading branch information
inakleinbottle committed Nov 26, 2024
1 parent 6de9d23 commit 66e0e04
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 34 deletions.
5 changes: 1 addition & 4 deletions platform/src/generics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ target_sources(RoughPy_Platform PRIVATE
add_subdirectory(builtin_types)
add_subdirectory(multiprecision_types)

target_link_libraries(RoughPy_Platform PRIVATE
RoughPy_Generics_BuiltinType
RoughPy_Generics_Multiprecision
)


if (ROUGHPY_BUILD_TESTS)

Expand Down
15 changes: 1 addition & 14 deletions platform/src/generics/builtin_types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@



add_library(RoughPy_Generics_BuiltinType STATIC
target_sources(RoughPy_Platform PRIVATE
builtin_type.h
builtin_type_ids.h
builtin_type_methods.h
Expand All @@ -18,19 +18,6 @@ add_library(RoughPy_Generics_BuiltinType STATIC
unsigned_int_type.h
)

set_target_properties(RoughPy_Generics_BuiltinType PROPERTIES
POSITION_INDEPENDENT_CODE ON
)

target_include_directories(RoughPy_Generics_BuiltinType PRIVATE
${ROUGHPY_PLATFORM_INCLUDE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../../..
)

target_link_libraries(RoughPy_Generics_BuiltinType PRIVATE
RoughPy::Core
)


if (ROUGHPY_BUILD_TESTS)

Expand Down
18 changes: 2 additions & 16 deletions platform/src/generics/multiprecision_types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@



add_library(RoughPy_Generics_Multiprecision
STATIC
target_sources(RoughPy_Platform PRIVATE
rational_type.cpp
rational_type.h
rational_arithmetic.cpp
Expand Down Expand Up @@ -38,26 +37,15 @@ add_library(RoughPy_Generics_Multiprecision



set_target_properties(RoughPy_Generics_Multiprecision PROPERTIES
POSITION_INDEPENDENT_CODE ON
LINK_LANGUAGE CXX
)

target_include_directories(RoughPy_Generics_Multiprecision PRIVATE
${ROUGHPY_PLATFORM_INCLUDE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../../..
)

target_link_libraries(RoughPy_Generics_Multiprecision PRIVATE
RoughPy::Core
target_link_libraries(RoughPy_Platform PRIVATE
GMP::GMP
MPFR::MPFR
)


if (ROUGHPY_BUILD_TESTS)


add_executable(test_multiprecision_types
test_rational_type.cpp
test_integer_type.cpp
Expand All @@ -71,7 +59,5 @@ if (ROUGHPY_BUILD_TESTS)

setup_roughpy_cpp_tests(test_multiprecision_types)



endif()

0 comments on commit 66e0e04

Please sign in to comment.