Skip to content

Commit

Permalink
Merge pull request #814 from kbenzie/benie/make-ur_common-a-static-lib
Browse files Browse the repository at this point in the history
[cmake] Ensure code is compiled with -Werror in dev mode
  • Loading branch information
kbenzie authored Aug 25, 2023
2 parents ecdd28f + 673ddef commit 54005ef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
35 changes: 16 additions & 19 deletions source/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,25 @@
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

add_library(ur_common INTERFACE)
add_subdirectory(unified_malloc_framework)
add_subdirectory(umf_pools)

add_ur_library(ur_common STATIC
umf_helpers.hpp
ur_pool_manager.hpp
$<$<PLATFORM_ID:Windows>:windows/ur_lib_loader.cpp>
$<$<PLATFORM_ID:Linux,Darwin>:linux/ur_lib_loader.cpp>
)
add_library(${PROJECT_NAME}::common ALIAS ur_common)

target_include_directories(ur_common INTERFACE
target_include_directories(ur_common PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/include
)

add_subdirectory(unified_malloc_framework)
add_subdirectory(umf_pools)
target_link_libraries(ur_common INTERFACE unified_malloc_framework disjoint_pool ${CMAKE_DL_LIBS} ${PROJECT_NAME}::headers)

if(WIN32)
target_sources(ur_common
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/windows/ur_lib_loader.cpp
umf_helpers.hpp ur_pool_manager.hpp
)
else()
target_sources(ur_common
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/linux/ur_lib_loader.cpp
umf_helpers.hpp ur_pool_manager.hpp
)
endif()
target_link_libraries(ur_common PUBLIC
unified_malloc_framework
disjoint_pool
${CMAKE_DL_LIBS}
${PROJECT_NAME}::headers
)
2 changes: 1 addition & 1 deletion test/loader/loader_config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

add_executable(test-loader-config
add_ur_executable(test-loader-config
urLoaderConfigCreate.cpp
urLoaderConfigGetInfo.cpp
urLoaderConfigEnableLayer.cpp
Expand Down

0 comments on commit 54005ef

Please sign in to comment.