Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ function(add_umf_library)
${ARG_NAME}
PRIVATE ${UMF_CMAKE_SOURCE_DIR}/include
${UMF_CMAKE_SOURCE_DIR}/src/utils
${UMF_CMAKE_SOURCE_DIR}/src/base_alloc)
${UMF_CMAKE_SOURCE_DIR}/src/base_alloc
${UMF_CMAKE_SOURCE_DIR}/src/coarse)
add_umf_target_compile_options(${ARG_NAME})
add_umf_target_link_options(${ARG_NAME})
endfunction()
Expand Down
11 changes: 7 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ set(UMF_CUDA_INCLUDE_DIR
# TODO: Cleanup the compile definitions across all the CMake files
set(UMF_COMMON_COMPILE_DEFINITIONS UMF_VERSION=${UMF_VERSION})

add_subdirectory(utils)

set(UMF_LIBS $<BUILD_INTERFACE:umf_utils>)

set(BA_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc.c
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_linear.c
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_global.c)

add_subdirectory(utils)
add_subdirectory(coarse)

set(UMF_LIBS $<BUILD_INTERFACE:umf_utils> $<BUILD_INTERFACE:coarse>)

if(LINUX)
set(BA_SOURCES ${BA_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_linux.c)
Expand Down Expand Up @@ -145,6 +146,8 @@ else()
LIBS ${UMF_LIBS})
endif()

add_dependencies(umf coarse)

if(UMF_LINK_HWLOC_STATICALLY)
add_dependencies(umf ${UMF_HWLOC_NAME})
endif()
Expand Down
26 changes: 26 additions & 0 deletions src/coarse/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (C) 2024 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake)

set(COARSE_SOURCES coarse.c ../ravl/ravl.c)

if(UMF_BUILD_SHARED_LIBRARY)
set(COARSE_EXTRA_SRCS ${BA_SOURCES})
set(COARSE_EXTRA_LIBS $<BUILD_INTERFACE:umf_utils>)
endif()

add_umf_library(
NAME coarse
TYPE STATIC
SRCS ${COARSE_SOURCES} ${COARSE_EXTRA_SRCS}
LIBS ${COARSE_EXTRA_LIBS})

target_include_directories(
coarse
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/ravl>)

add_library(${PROJECT_NAME}::coarse ALIAS coarse)
Loading
Loading