Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
icfaust authored Jan 12, 2025
1 parent 436e306 commit 9cba3b1
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,6 @@ else()
message(FATAL_ERROR "Unsupported system.")
endif()

if(SKLEARNEX_GCOV)
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "--coverage ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "--coverage ${CMAKE_SHARED_LINKER_FLAGS}")
else()
message(FATAL_ERROR "Unsupported compiler for code coverage.")
endif()
endif()

set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} ${SDL_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} ${SDL_FLAGS}")
Expand Down Expand Up @@ -110,6 +101,15 @@ find_package(pybind11 REQUIRED)
if(IFACE STREQUAL "host")
set(TARGET "_onedal_py_host")

if(SKLEARNEX_GCOV)
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "--coverage ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "--coverage ${CMAKE_SHARED_LINKER_FLAGS}")
else()
message(WARNING "Code coverage will not be generated for `host` target")
endif()
endif()

set(ONEDAL_LIBRARIES "")
if(WIN32)
list(APPEND ONEDAL_LIBRARIES "onedal_dll.${ONEDAL_MAJOR_BINARY}")
Expand Down Expand Up @@ -150,13 +150,17 @@ elseif(IFACE_IS_DPC OR IFACE_IS_SPMD_DPC)
endif()

if(SKLEARNEX_GCOV)
#assumes first argument is --coverage, allowing host code profiling
set(CMAKE_CXX_FLAGS "-Xarch_host ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-Xarch_host ${CMAKE_SHARED_LINKER_FLAGS}")
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
set(CMAKE_CXX_FLAGS "-Xarch_host --coverage ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-Xarch_host --coverage ${CMAKE_SHARED_LINKER_FLAGS}")
else()
message(WARNING "Code coverage will not be generated for `${IFACE}` target")
endif()
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
set(CMAKE_CXX_FLAGS "-fsycl ${CMAKE_CXX_FLAGS}")

endif()

if(CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
Expand Down

0 comments on commit 9cba3b1

Please sign in to comment.