Skip to content

Commit

Permalink
C++17 only if TF ops are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheorey committed Oct 3, 2023
1 parent 0ca03ad commit c61fb71
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,14 @@ endif()

# Global flag to set CXX standard.
# This does not affect 3rd party libraries.
set(CMAKE_CXX_STANDARD 17)
# Tensorflow 2.9+ requires cxx_17, but MSVC 19.29 throws errors with C++17
# enabled.
if (BUILD_SYCL_MODULE OR BUILD_TENSORFLOW_OPS)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 14)
endif()
set(CMAKE_CXX_EXTENSIONS OFF) # Improved compatibility

# FIXME: Remove this workaround once a fixed Visual Studio 16.10 version is released.
if (BUILD_CUDA_MODULE
Expand Down

0 comments on commit c61fb71

Please sign in to comment.