Skip to content

Commit

Permalink
Fix CUDA/C++14 compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojnnes committed Jun 9, 2020
1 parent 2139cd5 commit 2bc8182
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ if(IS_MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
elseif(IS_GNU OR IS_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
# We want c++14 mainly for supporting latest dependencies, but older GCC
# versions in combination with CUDA do not yet support it. In the worst
# case, this will lead to compile errors and there is not much we can
# do on the COLMAP side.
if(CUDA_ENABLED AND
IS_GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()
endif()

add_subdirectory(base)
Expand Down

0 comments on commit 2bc8182

Please sign in to comment.