Skip to content

Commit

Permalink
build: rename LIB_NAME to DNNL_LIBRARY_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
densamoilov committed Aug 13, 2021
1 parent ff642a7 commit b3f70bd
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 59 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@ set(PROJECT_NAME "oneDNN")
set(PROJECT_FULL_NAME "oneAPI Deep Neural Network Library (oneDNN)")
set(PROJECT_VERSION "2.3.0")

function(set_lib_name LIB_NAME)
function(set_lib_name DNNL_LIBRARY_NAME)
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPERCASE_CMAKE_BUILD_TYPE)
if(WIN32 AND DNNL_INSTALL_MODE STREQUAL "BUNDLE"
AND UPPERCASE_CMAKE_BUILD_TYPE STREQUAL "RELWITHMDD"
AND DNNL_CPU_RUNTIME MATCHES "(DPCPP|SYCL)"
AND DNNL_GPU_RUNTIME MATCHES "(DPCPP|SYCL)")
set(LIB_NAME "dnnld" PARENT_SCOPE)
set(DNNL_LIBRARY_NAME "dnnld" PARENT_SCOPE)
else()
set(LIB_NAME "dnnl" PARENT_SCOPE)
set(DNNL_LIBRARY_NAME "dnnl" PARENT_SCOPE)
endif()
endfunction()

set_lib_name(LIB_NAME)
set_lib_name(DNNL_LIBRARY_NAME)

if (CMAKE_VERSION VERSION_LESS 3.0)
project(${PROJECT_NAME} C CXX)
Expand Down Expand Up @@ -185,8 +185,8 @@ if(DNNL_INSTALL_MODE STREQUAL "BUNDLE")
install(FILES THIRD-PARTY-PROGRAMS DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${PROJECT_BINARY_DIR}/README DESTINATION ${CMAKE_INSTALL_PREFIX})
else()
# Cannot use CMAKE_INSTALL_DOCDIR since it uses PROJECT_NAME and not LIB_NAME
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${LIB_NAME})
install(FILES THIRD-PARTY-PROGRAMS DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${LIB_NAME})
install(FILES ${PROJECT_BINARY_DIR}/README DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${LIB_NAME})
# Cannot use CMAKE_INSTALL_DOCDIR since it uses PROJECT_NAME and not DNNL_LIBRARY_NAME
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${DNNL_LIBRARY_NAME})
install(FILES THIRD-PARTY-PROGRAMS DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${DNNL_LIBRARY_NAME})
install(FILES ${PROJECT_BINARY_DIR}/README DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/${DNNL_LIBRARY_NAME})
endif()
4 changes: 2 additions & 2 deletions cmake/Doxygen.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#===============================================================================
# Copyright 2016-2020 Intel Corporation
# Copyright 2016-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -69,6 +69,6 @@ if(DOXYGEN_FOUND)
if(NOT DNNL_INSTALL_MODE STREQUAL "BUNDLE")
install(
DIRECTORY ${DOXYGEN_OUTPUT_DIR}
DESTINATION share/doc/${LIB_NAME} OPTIONAL)
DESTINATION share/doc/${DNNL_LIBRARY_NAME} OPTIONAL)
endif()
endif(DOXYGEN_FOUND)
4 changes: 2 additions & 2 deletions cmake/config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#===============================================================================
# Copyright 2019-2020 Intel Corporation
# Copyright 2019-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,4 +41,4 @@ endif()
set(CMAKE_MODULE_PATH ${DNNL_ORIGINAL_CMAKE_MODULE_PATH})

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components("@LIB_NAME@")
check_required_components("@DNNL_LIBRARY_NAME@")
2 changes: 1 addition & 1 deletion cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endfunction()
# arg4 -- (optional) list of extra library dependencies
function(register_exe name srcs test)
add_executable(${name} ${srcs})
target_link_libraries(${name} ${LIB_NAME} ${EXTRA_SHARED_LIBS} ${ARGV3})
target_link_libraries(${name} ${DNNL_LIBRARY_NAME} ${EXTRA_SHARED_LIBS} ${ARGV3})
if("x${test}" STREQUAL "xtest")
add_dnnl_test(${name} ${name})
maybe_configure_windows_test(${name} TEST)
Expand Down
4 changes: 2 additions & 2 deletions cmake/version.rc.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2019-2020 Intel Corporation
* Copyright 2019-2021 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,7 +36,7 @@ BEGIN
VALUE "InternalName", "@PROJECT_NAME@"
VALUE "LegalCopyright", "Copyright @DNNL_VERSION_YEAR@ Intel Corporation.\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "@LIB_NAME@.dll\0"
VALUE "OriginalFilename", "@DNNL_LIBRARY_NAME@.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "@PROJECT_FULL_NAME@\0"
VALUE "ProductVersion", "@PROJECT_VERSION@ (@DNNL_VERSION_HASH@)\0"
Expand Down
6 changes: 3 additions & 3 deletions examples/CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ get_filename_component(DNNL_CONFIGURATION "${DNNL_CONFIGURATION}" NAME)
# The hint can be used to find CMake config in oneAPI directory layout.
set(ONEAPI_CMAKE_CONFIG_HINT "../..")

find_package(@LIB_NAME@ @PROJECT_VERSION@ CONFIG REQUIRED HINTS ${DNNLROOT} ${ONEAPI_CMAKE_CONFIG_HINT})
find_package(@DNNL_LIBRARY_NAME@ @PROJECT_VERSION@ CONFIG REQUIRED HINTS ${DNNLROOT} ${ONEAPI_CMAKE_CONFIG_HINT})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DNNL_COMPILE_FLAGS}")

Expand Down Expand Up @@ -144,8 +144,8 @@ endfunction()
# test -- "test" to mark executable as a test, "" otherwise
function(register_example name srcs test)
add_executable(${name} ${srcs})
string(TOUPPER "@LIB_NAME@" LIB_NAMESPACE)
target_link_libraries(${name} ${LIB_NAMESPACE}::@LIB_NAME@ ${LIBM})
string(TOUPPER "@DNNL_LIBRARY_NAME@" LIB_NAMESPACE)
target_link_libraries(${name} ${LIB_NAMESPACE}::@DNNL_LIBRARY_NAME@ ${LIBM})
if("x${test}" STREQUAL "xtest")
add_test(${name} ${name})
maybe_configure_test("${example_name}" TEST)
Expand Down
42 changes: 21 additions & 21 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,30 +110,30 @@ if(DNNL_WITH_SYCL)
endif()

get_property(LIB_DEPS GLOBAL PROPERTY DNNL_LIB_DEPS)
add_library(${LIB_NAME} ${DNNL_LIBRARY_TYPE}
add_library(${DNNL_LIBRARY_NAME} ${DNNL_LIBRARY_TYPE}
${VERSION_RESOURCE_FILE} ${HEADERS_ROOT} ${HEADERS_SUBDIR} ${LIB_DEPS})
# LINK_PRIVATE for cmake 2.8.11 compatibility
target_link_libraries(${LIB_NAME} LINK_PRIVATE ${${LIB_NAME}_INTERFACE})
target_link_libraries(${DNNL_LIBRARY_NAME} LINK_PRIVATE ${${DNNL_LIBRARY_NAME}_INTERFACE})

set_property(TARGET ${LIB_NAME} PROPERTY VERSION "${DNNL_VERSION_MAJOR}.${DNNL_VERSION_MINOR}")
set_property(TARGET ${LIB_NAME} PROPERTY SOVERSION "${DNNL_VERSION_MAJOR}")
set_property(TARGET ${DNNL_LIBRARY_NAME} PROPERTY VERSION "${DNNL_VERSION_MAJOR}.${DNNL_VERSION_MINOR}")
set_property(TARGET ${DNNL_LIBRARY_NAME} PROPERTY SOVERSION "${DNNL_VERSION_MAJOR}")

target_include_directories(${LIB_NAME} PUBLIC
target_include_directories(${DNNL_LIBRARY_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../include>
# $<INSTALL_PREFIX> is required for compatibility with cmake 2.8
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>
)

target_link_libraries_build(${LIB_NAME}
target_link_libraries_build(${DNNL_LIBRARY_NAME}
"${EXTRA_SHARED_LIBS};${EXTRA_STATIC_LIBS}")
target_link_libraries_install(${LIB_NAME} "${EXTRA_SHARED_LIBS}")
target_link_libraries_install(${DNNL_LIBRARY_NAME} "${EXTRA_SHARED_LIBS}")
if(DNNL_LIBRARY_TYPE STREQUAL "STATIC")
target_link_libraries_install(${LIB_NAME} "${EXTRA_STATIC_LIBS}")
target_link_libraries_install(${DNNL_LIBRARY_NAME} "${EXTRA_STATIC_LIBS}")
endif()

set(LIB_EXPORT_NAME "${LIB_NAME}-targets")
install(TARGETS ${LIB_NAME}
set(LIB_EXPORT_NAME "${DNNL_LIBRARY_NAME}-targets")
install(TARGETS ${DNNL_LIBRARY_NAME}
EXPORT "${LIB_EXPORT_NAME}"
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand All @@ -149,11 +149,11 @@ endforeach()

# Write version and package config files
set(LIB_CONFIG_GENERATE_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
set(LIB_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${LIB_NAME}")
set(LIB_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${DNNL_LIBRARY_NAME}")
set(LIB_VERSION_FILE
"${LIB_CONFIG_GENERATE_DIR}/${LIB_NAME}-config-version.cmake")
"${LIB_CONFIG_GENERATE_DIR}/${DNNL_LIBRARY_NAME}-config-version.cmake")
set(LIB_CONFIG_FILE
"${LIB_CONFIG_GENERATE_DIR}/${LIB_NAME}-config.cmake")
"${LIB_CONFIG_GENERATE_DIR}/${DNNL_LIBRARY_NAME}-config.cmake")
write_basic_package_version_file(
"${LIB_VERSION_FILE}"
VERSION ${PROJECT_VERSION}
Expand All @@ -164,7 +164,7 @@ configure_package_config_file(
INSTALL_DESTINATION ${LIB_CONFIG_INSTALL_DIR})
install(FILES ${LIB_CONFIG_FILE} ${LIB_VERSION_FILE}
DESTINATION ${LIB_CONFIG_INSTALL_DIR})
string(TOUPPER "${LIB_NAME}::" LIB_NAMESPACE)
string(TOUPPER "${DNNL_LIBRARY_NAME}::" LIB_NAMESPACE)
install(EXPORT ${LIB_EXPORT_NAME}
NAMESPACE ${LIB_NAMESPACE}
DESTINATION ${LIB_CONFIG_INSTALL_DIR})
Expand All @@ -189,12 +189,12 @@ if (WIN32)
endif()
add_custom_target(compat_libs ALL
${CMAKE_COMMAND} -E copy
$<TARGET_LINKER_FILE_DIR:${LIB_NAME}>/$<TARGET_LINKER_FILE_NAME:${LIB_NAME}>
$<TARGET_LINKER_FILE_DIR:${LIB_NAME}>/${prefix}mkldnn${ext}
$<TARGET_LINKER_FILE_DIR:${DNNL_LIBRARY_NAME}>/$<TARGET_LINKER_FILE_NAME:${DNNL_LIBRARY_NAME}>
$<TARGET_LINKER_FILE_DIR:${DNNL_LIBRARY_NAME}>/${prefix}mkldnn${ext}
# Workaround for MSB8065 warning.
COMMAND ${CMAKE_COMMAND} -E touch "CMakeFiles/compat_libs"
DEPENDS ${LIB_NAME})
install(FILES $<TARGET_LINKER_FILE_DIR:${LIB_NAME}>/${prefix}mkldnn${ext}
DEPENDS ${DNNL_LIBRARY_NAME})
install(FILES $<TARGET_LINKER_FILE_DIR:${DNNL_LIBRARY_NAME}>/${prefix}mkldnn${ext}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
else()
if(DNNL_LIBRARY_TYPE STREQUAL "SHARED")
Expand All @@ -206,7 +206,7 @@ else()
endif()
foreach(ver "" ${vers})
set_ternary(ext_and_ver APPLE "${ver}${ext}" "${ext}${ver}")
get_property(lib_location TARGET ${LIB_NAME} PROPERTY LIBRARY_OUTPUT_DIRECTORY)
get_property(lib_location TARGET ${DNNL_LIBRARY_NAME} PROPERTY LIBRARY_OUTPUT_DIRECTORY)
if(lib_location)
set(compat_link "${lib_location}/libmkldnn${ext_and_ver}")
else()
Expand All @@ -215,13 +215,13 @@ else()
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
add_custom_command(OUTPUT ${compat_link}
COMMAND ${CMAKE_COMMAND} -E copy libdnnl${ext_and_ver} ${compat_link}
DEPENDS ${LIB_NAME})
DEPENDS ${DNNL_LIBRARY_NAME})
else()
add_custom_command(OUTPUT ${compat_link}
# to make the next command work fine
COMMAND ${CMAKE_COMMAND} -E remove -f ${compat_link}
COMMAND ${CMAKE_COMMAND} -E create_symlink libdnnl${ext_and_ver} ${compat_link}
DEPENDS ${LIB_NAME})
DEPENDS ${DNNL_LIBRARY_NAME})
endif()
add_custom_target(compat_libs${ver} ALL DEPENDS ${compat_link})
install(FILES ${compat_link} DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
Expand Down
2 changes: 1 addition & 1 deletion src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if(NOT DNNL_CPU_RUNTIME STREQUAL "THREADPOOL")
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/stream_threadpool.cpp")
endif()

set(OBJ_LIB ${LIB_NAME}_common)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_common)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
2 changes: 1 addition & 1 deletion src/cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if(DNNL_WITH_SYCL)
PROPERTIES COMPILE_FLAGS "-O0")
endif()

set(OBJ_LIB ${LIB_NAME}_cpu)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_cpu)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
Expand Down
2 changes: 1 addition & 1 deletion src/cpu/aarch64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if(NOT DNNL_AARCH64_USE_ACL)
list(REMOVE_ITEM SOURCES ${ACL_FILES})
endif()

set(OBJ_LIB ${LIB_NAME}_cpu_aarch64)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_cpu_aarch64)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
Expand Down
2 changes: 1 addition & 1 deletion src/cpu/aarch64/xbyak_aarch64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ file(GLOB SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/xbyak_aarch64_impl.cpp
)

set(OBJ_LIB ${LIB_NAME}_cpu_aarch64_xbyak_aarch64)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_cpu_aarch64_xbyak_aarch64)
add_library(${OBJ_LIB} OBJECT ${SOURCES})

target_include_directories(
Expand Down
2 changes: 1 addition & 1 deletion src/cpu/x64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ else()
PROPERTIES COMPILE_FLAGS "-O0 -U_FORTIFY_SOURCE")
endif()

set(OBJ_LIB ${LIB_NAME}_cpu_x64)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_cpu_x64)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
6 changes: 3 additions & 3 deletions src/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ add_definitions_with_host_compiler(-DNGEN_NEO_INTERFACE)
add_definitions_with_host_compiler(-DNGEN_NO_OP_NAMES)
add_definitions_with_host_compiler(-DNGEN_WINDOWS_COMPAT)

set(OBJ_LIB ${LIB_NAME}_gpu)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_gpu)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
Expand All @@ -35,6 +35,6 @@ add_subdirectory(jit)
add_subdirectory(ocl)
if(DNNL_SYCL_CUDA)
add_subdirectory(nvidia)
# Pass ${LIB_NAME}_INTERFACE to upper level for proper linking
set(${LIB_NAME}_INTERFACE "${${LIB_NAME}_INTERFACE}" PARENT_SCOPE)
# Pass ${DNNL_LIBRARY_NAME}_INTERFACE to upper level for proper linking
set(${DNNL_LIBRARY_NAME}_INTERFACE "${${DNNL_LIBRARY_NAME}_INTERFACE}" PARENT_SCOPE)
endif()
4 changes: 2 additions & 2 deletions src/gpu/compute/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#===============================================================================
# Copyright 2019-2020 Intel Corporation
# Copyright 2019-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@ file(GLOB_RECURSE SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)

set(OBJ_LIB ${LIB_NAME}_gpu_compute)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_gpu_compute)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
4 changes: 2 additions & 2 deletions src/gpu/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#===============================================================================
# Copyright 2020 Intel Corporation
# Copyright 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@ file(GLOB_RECURSE SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)

set(OBJ_LIB ${LIB_NAME}_gpu_jit)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_gpu_jit)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
8 changes: 4 additions & 4 deletions src/gpu/nvidia/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#===============================================================================
# Copyright 2020 Intel Corporation
# Copyright 2020-2021 Intel Corporation
# Copyright 2020 Codeplay Software Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -20,7 +20,7 @@ file(GLOB_RECURSE SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)

set(OBJ_LIB ${LIB_NAME}_sycl_nvidia)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_sycl_nvidia)
add_library(${OBJ_LIB} OBJECT ${SOURCES})

find_package(OpenCL REQUIRED)
Expand All @@ -46,6 +46,6 @@ target_link_libraries(${OBJ_LIB}_interface INTERFACE cuBLAS::cuBLAS
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)

set(${LIB_NAME}_INTERFACE
${${LIB_NAME}_INTERFACE} ${OBJ_LIB}_interface
set(${DNNL_LIBRARY_NAME}_INTERFACE
${${DNNL_LIBRARY_NAME}_INTERFACE} ${OBJ_LIB}_interface
PARENT_SCOPE)
2 changes: 1 addition & 1 deletion src/gpu/ocl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ gen_gpu_kernel_list(

list(APPEND SOURCES ${kernel_list_src})

set(OBJ_LIB ${LIB_NAME}_gpu_ocl)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_gpu_ocl)
add_library(${OBJ_LIB} OBJECT ${SOURCES})
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
$<TARGET_OBJECTS:${OBJ_LIB}>)
4 changes: 2 additions & 2 deletions src/sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#===============================================================================

set(TARGET_NAME ${LIB_NAME}_sycl)
set(TARGET_NAME ${DNNL_LIBRARY_NAME}_sycl)

file(GLOB_RECURSE SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/*.h
Expand All @@ -30,7 +30,7 @@ if(DNNL_CPU_RUNTIME STREQUAL "NONE")
)
endif()

set(OBJ_LIB ${LIB_NAME}_sycl)
set(OBJ_LIB ${DNNL_LIBRARY_NAME}_sycl)
add_library(${OBJ_LIB} OBJECT ${SOURCES})

set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS
Expand Down
2 changes: 1 addition & 1 deletion tests/gtests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ set_source_files_properties(
function(register_gtest exe src)
add_executable(${exe} ${MAIN_SRC_GTEST} ${src})
add_definitions_with_host_compiler(-DNOMINMAX) # to allow std::max on Windows with parentheses
target_link_libraries(${exe} ${LIB_NAME} dnnl_gtest ${EXTRA_SHARED_LIBS})
target_link_libraries(${exe} ${DNNL_LIBRARY_NAME} dnnl_gtest ${EXTRA_SHARED_LIBS})

get_source_file_property(no_engine_param ${src} NO_ENGINE_PARAM)

Expand Down

0 comments on commit b3f70bd

Please sign in to comment.