Skip to content

Commit

Permalink
Required changes in CMake files (#1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
KulikovNikita committed Jun 18, 2021
1 parent 47df50d commit 1f5dcc0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/daal/cpp_sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ set(CMAKE_BUILD_TYPE Release)
set(USE_DPCPP yes)
set(USE_NEW_IFACES no)

set(custom_options "-fsycl-device-code-split=per_kernel")

if (WIN32)
set(TARGET_LINK dynamic)
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> /Fo<OBJECT> -c <SOURCE>")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib <OBJECTS> /out:<TARGET>")
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> ${custom_options} <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()

function (add_examples examples)
Expand All @@ -36,6 +41,7 @@ function (add_examples examples)
else()
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
endif()
target_compile_options(${example} PRIVATE ${custom_options})
set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/_cmake_results/intel_intel64_${THREADING_TYPE}_${LINK_TYPE}")
endforeach()
endfunction()
Expand Down
6 changes: 6 additions & 0 deletions examples/oneapi/dpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ set(CMAKE_BUILD_TYPE Release)
set(USE_DPCPP yes)
set(USE_NEW_IFACES yes)

set(custom_options "-fsycl-device-code-split=per_kernel")

if (WIN32)
set(TARGET_LINK dynamic)
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> /Fo<OBJECT> -c <SOURCE>")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib <OBJECTS> /out:<TARGET>")
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> ${custom_options} <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()

function (add_examples examples)
Expand All @@ -36,6 +41,7 @@ function (add_examples examples)
else()
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
endif()
target_compile_options(${example} PRIVATE ${custom_options})
set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/_cmake_results/intel_intel64_${THREADING_TYPE}_${LINK_TYPE}")
endforeach()
endfunction()
Expand Down

0 comments on commit 1f5dcc0

Please sign in to comment.