Commit d1cc1da6 authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Update C++ standard to 17 (#2973)

Summary:
Following the change in PyTorch core.

https://github.com/pytorch/pytorch/commit/87e4a087784c805312a2b48bb063d2400df26c5e

Pull Request resolved: https://github.com/pytorch/audio/pull/2973

Reviewed By: xiaohui-zhang

Differential Revision: D42462709

Pulled By: mthrok

fbshipit-source-id: 60c2aa3d63fe25d8e0b7aa476404e7a55d6eb87f
parent 7e7b60c1
...@@ -24,19 +24,10 @@ string(FIND "${CMAKE_CXX_FLAGS}" "-std=c++" env_cxx_standard) ...@@ -24,19 +24,10 @@ string(FIND "${CMAKE_CXX_FLAGS}" "-std=c++" env_cxx_standard)
if(env_cxx_standard GREATER -1) if(env_cxx_standard GREATER -1)
message( message(
WARNING "C++ standard version definition detected in environment variable." WARNING "C++ standard version definition detected in environment variable."
"PyTorch requires -std=c++14. Please remove -std=c++ settings in your environment.") "PyTorch requires -std=c++17. Please remove -std=c++ settings in your environment.")
endif() endif()
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this target.")
set(CMAKE_CXX_STANDARD 14) set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard whose features are requested to build this target.")
set(CMAKE_C_STANDARD 11)
# https://developercommunity.visualstudio.com/t/VS-16100-isnt-compatible-with-CUDA-11/1433342
if(MSVC)
if(USE_CUDA)
set(CMAKE_CXX_STANDARD 17)
endif()
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment