Skip to content

Commit

Permalink
Wrap various C/C++-only options using language-specific generator exp…
Browse files Browse the repository at this point in the history
…ressions to avoid pissing CUDA off
  • Loading branch information
evaleev authored and devreal committed Jun 9, 2023
1 parent 47aaff5 commit aeef798
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ option(TTG_ENABLE_TRACE "Whether to enable ttg::trace() output" OFF)
option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." TRUE)
if (FORCE_COLORED_OUTPUT)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options (-fdiagnostics-color=always)
add_compile_options ($<$<COMPILE_LANGUAGE:CXX,C>:-fdiagnostics-color=always>)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options (-fcolor-diagnostics)
add_compile_options ($<$<COMPILE_LANGUAGE:CXX,C>:-fcolor-diagnostics>)
endif ()
endif (FORCE_COLORED_OUTPUT)

Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/FindCXXStdCoroutine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ foreach(component IN LISTS CXXStdCoroutines_want_components_ordered)
add_library(std::coroutine INTERFACE IMPORTED GLOBAL)
target_compile_features(std::coroutine INTERFACE cxx_std_20)
if (option)
target_compile_options(std::coroutine INTERFACE "${option}")
target_compile_options(std::coroutine INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:${option}>")
endif()
set(CXX_COROUTINE_COMPONENT "${component}" CACHE STRING "The component of CXXStdCoroutine package found")
# break out of this loop
Expand Down

0 comments on commit aeef798

Please sign in to comment.