cmake_minimum_required(VERSION 3.18)
project(izh_companion LANGUAGES CXX)
add_executable(izh main.cpp)
target_compile_features(izh PRIVATE cxx_std_17)
find_package(Threads REQUIRED)
target_link_libraries(izh PRIVATE Threads::Threads)    # Chapter 40's kernels split rows across threads
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
  target_compile_options(izh PRIVATE -Wall -Wextra -Wpedantic)
endif()
option(BUILD_CUDA "Build standalone CUDA kernels" OFF)
if(BUILD_CUDA)
  enable_language(CUDA)
  add_executable(izh_cuda kernels.cu)
  set_target_properties(izh_cuda PROPERTIES CUDA_STANDARD 17 CUDA_STANDARD_REQUIRED ON)
endif()
