Skip to content

Commit

Permalink
[onert] Use C++17 (#13475)
Browse files Browse the repository at this point in the history
This commit enables C++17 for all onert modules.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh authored Jul 22, 2024
1 parent dbf5c80 commit 89a1b73
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 21 deletions.
9 changes: 4 additions & 5 deletions infra/nnfw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ macro(nnas_find_package PREFIX)
)
endmacro(nnas_find_package)

# C++14 feature requires 5 or later
# Using std::unordered_map shows build fail under 6.2
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.2)
message(FATAL "Runtime build requires GNU Compiler version 6.2 or later.")
# C++17 feature requires 9.1 or later for stable usage
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
message(FATAL "Runtime build requires GNU Compiler version 9.1 or later.")
endif()

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down
4 changes: 0 additions & 4 deletions runtime/contrib/style_transfer_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ if(NOT BUILD_ONERT)
return()
endif(NOT BUILD_ONERT)

# Use C++17 for style_transfer_app
# TODO Remove this when we use C++17 for all runtime directories
set(CMAKE_CXX_STANDARD 17)

find_package(JPEG)
if(JPEG_FOUND)
add_definitions(-DNNFW_ST_APP_JPEG_SUPPORTED)
Expand Down
4 changes: 0 additions & 4 deletions runtime/contrib/tflite_classify/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ if(NOT BUILD_TFLITE_CLASSIFY_APP)
return()
endif(NOT BUILD_TFLITE_CLASSIFY_APP)

# Use C++17 for tflite_classify
# TODO Remove this when we use C++17 for all runtime directories
set(CMAKE_CXX_STANDARD 17)

list(APPEND SOURCES "src/tflite_classify.cc")
list(APPEND SOURCES "src/ImageClassifier.cc")
list(APPEND SOURCES "src/InferenceInterface.cc")
Expand Down
4 changes: 0 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@ if(NOT ENABLE_TEST)
return()
endif(NOT ENABLE_TEST)

# Use C++17 for tests
# TODO: Remove this when we use C++17 for all runtime directories
set(CMAKE_CXX_STANDARD 17)

add_subdirectories()
4 changes: 0 additions & 4 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
# Use C++17 for tools
# TODO: Remove this when we use C++17 for all runtime directories
set(CMAKE_CXX_STANDARD 17)

add_subdirectories()

0 comments on commit 89a1b73

Please sign in to comment.