function(ginkgo_add_object_library name)
    add_library(${name} OBJECT ${ARGN})
    ginkgo_compile_features(${name})
    ginkgo_default_includes(${name})
    target_include_directories(${name} PUBLIC ${Ginkgo_SOURCE_DIR})
    set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE ON)
endfunction()

function(ginkgo_add_library name)
    add_library(${name} ${ARGN})
    ginkgo_compile_features(${name})
    ginkgo_default_includes(${name})
    if(GINKGO_HAVE_HWLOC)
        target_link_libraries(${name} PUBLIC hwloc)
    endif()
    set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE ON)
endfunction()

ginkgo_add_library(ginkgo_device machine_topology.cpp device.cpp)
ginkgo_install_library(ginkgo_device)

add_subdirectory(cuda)
add_subdirectory(dpcpp)
add_subdirectory(hip)
add_subdirectory(omp)
add_subdirectory(reference)
