cmake: Build release build by default

Release build uses "-O3 -DNDEBUG" flags.
Also updated tools/cmake/README.md

PiperOrigin-RevId: 343415907
Change-Id: If8bc6b15febc79d7d982e972e9fc14ab8f8dbbff
This commit is contained in:
Terry Heo 2020-11-19 19:23:09 -08:00
parent 289ba7f54b
commit 5d44405066
2 changed files with 13 additions and 0 deletions
tensorflow/lite

View File

@ -27,6 +27,12 @@
# - Host Tools (i.e conversion / analysis tools etc.)
cmake_minimum_required(VERSION 3.16)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting build type to Release, for debug builds use"
"'-DCMAKE_BUILD_TYPE=Debug'.")
set(CMAKE_BUILD_TYPE "Release")
endif()
# Double colon in target name means ALIAS or IMPORTED target.
cmake_policy(SET CMP0028 NEW)
# Enable MACOSX_RPATH (@rpath) for built dynamic libraries.

View File

@ -40,6 +40,13 @@ cd tflite_build
cmake ../tensorflow_src/tensorflow/lite
```
It generates release binary by default. If you need to produce debug builds, you
need to provide '-DCMAKE_BUILD_TYPE=Debug' option.
```sh
cmake ../tensorflow_src/tensorflow/lite -DCMAKE_BUILD_TYPE=Debug
```
If you want to configure Android build with GPU delegate support,
```sh