diff --git a/CMakeLists.txt b/CMakeLists.txt index b835e8dbe657441c1264e9ff85b4d4bbbed8dfde..1abe068f0c6a2a54b4bcdcc675630859ef499c63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ project(paddle-mobile) option(DEBUGING "enable debug mode" OFF) option(USE_OPENMP "openmp support" OFF) +option(USE_EXCEPTION "use std exception" OFF) if (DEBUGING) set(CMAKE_BUILD_TYPE Debug) @@ -13,13 +14,20 @@ endif () if(DEBUGING) message(STATUS "debuging") add_definitions(-DPADDLE_MOBILE_DEBUG) - add_definitions(-DENABLE_EXCEPTION) + else() message(STATUS "releasing") add_definitions(-fvisibility=hidden -fvisibility-inlines-hidden) - add_definitions(-fno-exceptions) endif() +if (USE_EXCEPTION) + add_definitions(-DENABLE_EXCEPTION) + add_definitions(-fexceptions) +else() + add_definitions(-fno-exceptions) + +endif () + if(IS_MAC) add_definitions(-DX86) elseif(IS_IOS) @@ -114,4 +122,8 @@ endif() add_library(paddle-mobile SHARED ${PADDLE_MOBILE_CC} ${PADDLE_MOBILE_H}) -add_subdirectory(test) +if(DEBUGING) + add_subdirectory(test) +endif() + +