Skip to content

Commit 54005ef

Browse files
authored
Merge pull request #814 from kbenzie/benie/make-ur_common-a-static-lib
[cmake] Ensure code is compiled with -Werror in dev mode
2 parents ecdd28f + 673ddef commit 54005ef

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

source/common/CMakeLists.txt

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,25 @@
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
add_library(ur_common INTERFACE)
6+
add_subdirectory(unified_malloc_framework)
7+
add_subdirectory(umf_pools)
8+
9+
add_ur_library(ur_common STATIC
10+
umf_helpers.hpp
11+
ur_pool_manager.hpp
12+
$<$<PLATFORM_ID:Windows>:windows/ur_lib_loader.cpp>
13+
$<$<PLATFORM_ID:Linux,Darwin>:linux/ur_lib_loader.cpp>
14+
)
715
add_library(${PROJECT_NAME}::common ALIAS ur_common)
816

9-
target_include_directories(ur_common INTERFACE
17+
target_include_directories(ur_common PUBLIC
1018
${CMAKE_CURRENT_SOURCE_DIR}
1119
${CMAKE_SOURCE_DIR}/include
1220
)
1321

14-
add_subdirectory(unified_malloc_framework)
15-
add_subdirectory(umf_pools)
16-
target_link_libraries(ur_common INTERFACE unified_malloc_framework disjoint_pool ${CMAKE_DL_LIBS} ${PROJECT_NAME}::headers)
17-
18-
if(WIN32)
19-
target_sources(ur_common
20-
INTERFACE
21-
${CMAKE_CURRENT_SOURCE_DIR}/windows/ur_lib_loader.cpp
22-
umf_helpers.hpp ur_pool_manager.hpp
23-
)
24-
else()
25-
target_sources(ur_common
26-
INTERFACE
27-
${CMAKE_CURRENT_SOURCE_DIR}/linux/ur_lib_loader.cpp
28-
umf_helpers.hpp ur_pool_manager.hpp
29-
)
30-
endif()
22+
target_link_libraries(ur_common PUBLIC
23+
unified_malloc_framework
24+
disjoint_pool
25+
${CMAKE_DL_LIBS}
26+
${PROJECT_NAME}::headers
27+
)

test/loader/loader_config/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
add_executable(test-loader-config
6+
add_ur_executable(test-loader-config
77
urLoaderConfigCreate.cpp
88
urLoaderConfigGetInfo.cpp
99
urLoaderConfigEnableLayer.cpp

0 commit comments

Comments
 (0)