Skip to content

Commit

Permalink
[rls] Additional Flags for Linker in CMake (#1495)
Browse files Browse the repository at this point in the history
* Additional flags for linker in CMake

* fix

* fix
  • Loading branch information
owerbat authored Mar 12, 2021
1 parent a213d02 commit 481f859
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion examples/daal/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ function (add_examples examples)
foreach(example ${examples})
add_executable(${example} "${example}.cpp")
target_include_directories(${example} PRIVATE ${oneDAL_INCLUDE_DIRS})
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
if (UNIX)
target_link_libraries(${example} PRIVATE -Wl,--start-group ${oneDAL_IMPORTED_TARGETS} -Wl,--end-group)
else()
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
endif()
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: 5 additions & 1 deletion examples/daal/cpp_sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ function (add_examples examples)
foreach(example ${examples})
add_executable(${example} "${example}.cpp")
target_include_directories(${example} PRIVATE ${oneDAL_INCLUDE_DIRS})
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
if (UNIX)
target_link_libraries(${example} PRIVATE -Wl,--start-group ${oneDAL_IMPORTED_TARGETS} -Wl,--end-group)
else()
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
endif()
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: 5 additions & 1 deletion examples/oneapi/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ function (add_examples examples)
foreach(example ${examples})
add_executable(${example} "${example}.cpp")
target_include_directories(${example} PRIVATE ${oneDAL_INCLUDE_DIRS})
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
if (UNIX)
target_link_libraries(${example} PRIVATE -Wl,--start-group ${oneDAL_IMPORTED_TARGETS} -Wl,--end-group)
else()
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
endif()
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: 5 additions & 1 deletion examples/oneapi/dpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ function (add_examples examples)
foreach(example ${examples})
add_executable(${example} "${example}.cpp")
target_include_directories(${example} PRIVATE ${oneDAL_INCLUDE_DIRS})
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
if (UNIX)
target_link_libraries(${example} PRIVATE -Wl,--start-group ${oneDAL_IMPORTED_TARGETS} -Wl,--end-group)
else()
target_link_libraries(${example} PRIVATE ${oneDAL_IMPORTED_TARGETS})
endif()
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 481f859

Please sign in to comment.