Skip to content

Commit

Permalink
[cmake] [CUDA] ignore CUDA-specific source files in non-CUDA builds (f…
Browse files Browse the repository at this point in the history
…ixes #6267) (#6268)
  • Loading branch information
sabjohnso authored Jan 12, 2024
1 parent 5516533 commit 2e3543c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,10 @@ file(
src/network/*.cpp
src/treelearner/*.cpp
src/utils/*.cpp
if(USE_CUDA)
)
file(
GLOB
LGBM_CUDA_SOURCES
src/treelearner/*.cu
src/boosting/cuda/*.cpp
src/boosting/cuda/*.cu
Expand All @@ -442,9 +445,12 @@ if(USE_CUDA)
src/io/cuda/*.cpp
src/cuda/*.cpp
src/cuda/*.cu
endif()
)

if(USE_CUDA)
list(APPEND SOURCES ${LGBM_CUDA_SOURCES})
endif()

add_library(lightgbm_objs OBJECT ${SOURCES})

if(BUILD_CLI)
Expand Down

0 comments on commit 2e3543c

Please sign in to comment.