summaryrefslogtreecommitdiff
path: root/infra/nnfw/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'infra/nnfw/CMakeLists.txt')
-rw-r--r--infra/nnfw/CMakeLists.txt18
1 files changed, 11 insertions, 7 deletions
diff --git a/infra/nnfw/CMakeLists.txt b/infra/nnfw/CMakeLists.txt
index 5caf37fbf..857c15bf5 100644
--- a/infra/nnfw/CMakeLists.txt
+++ b/infra/nnfw/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.5.1)
+cmake_minimum_required(VERSION 3.16.3)
project(nnfw)
@@ -6,9 +6,12 @@ enable_testing()
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/")
+set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../lib/nnfw/odc:$ORIGIN/")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+### CMAKE_BUILD_TYPE_LC: Build type lower case
+string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LC)
+
set(NNAS_PROJECT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." CACHE
INTERNAL "Where to find nnas top-level source directory"
)
@@ -52,14 +55,15 @@ 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.")
+endif()
+
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
-# This feature works with CMake 3.5.2 or later. However, using previous versions does not produce
-# an error. We are still officially using CMake 3.5.1, but put this code for the sake of semantic
-# support in various development tools.
-# Todo: Someday, CMake needs to be updated to 3.7.2 or later to take advantage of improvements
-# such as `cmake-server`.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# identify platform: HOST_PLATFORM, TARGET_PLATFORM and related