From bc2dfcbb53dd573933112b10d4b059e02d4d74bb Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Sat, 22 Aug 2020 17:18:43 +0800 Subject: [PATCH] refactor(cmake): clear cmakelist file may caused by some commit conflict fix error GitOrigin-RevId: ac5acfdf4c8935f2a97554193bffe6fb6b7b9d43 --- CMakeLists.txt | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0551e3c5..7a6703f58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,17 @@ option(MGE_WITH_TRT "Build MegEngine with TensorRT." ON) option(MGE_USE_SYSTEM_LIB "Build MegEngine with system libraries." OFF) option(MGB_WITH_FLATBUFFERS "Build MegBrain with FlatBuffers serialization support." ON) option(BUILD_SHARED_LIBS "Build shared libraries" ON) +option(MGE_ENABLE_RTTI "Build with RTTI" ON) +option(MGE_ENABLE_LOGGING "Build with logging" ON) +option(MGE_DEBUG_UTIL "Enable debug utility" ON) +option(MGE_ENABLE_EXCEPTIONS "Build with exceptions" ON) +option(MGE_WITH_TEST "Enable test for MegEngine." OFF) +option(MGE_WITH_DISTRIBUTED "Build with distributed support" ON) +option(MGE_BUILD_IMPERATIVE_RT "Build _imperative_rt.so instead of _mgb.so " OFF) +option(MGE_BUILD_SDK "Build load_and_run" ON) +option(MGE_INFERENCE_ONLY "Build inference only library." OFF) +option(MGE_WITH_PYTHON_MODULE "Build MegEngine Python Module." ON) +option(MGE_WITH_MKLDNN "Enable Intel MKL_DNN support," ON) if (APPLE) set (BUILD_SHARED_LIBS OFF) @@ -167,15 +178,6 @@ if(CXX_SUPPORT_GOLD AND NOT ANDROID AND NOT APPLE AND NOT MSVC AND NOT WIN32) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MGE_COMMON_LINKER_FLAGS}") endif() -option(MGE_WITH_JIT "Build MegEngine with JIT." ON) -option(MGE_WITH_HALIDE "Build MegEngine with Halide JIT" ON) -option(MGE_DISABLE_FLOAT16 "Disable MegEngine float16 support." OFF) -option(MGE_WITH_CUDA "Enable MegEngine CUDA support." ON) -option(MGE_CUDA_USE_STATIC "Enable MegEngine CUDA static linking." ON) -option(MGE_WITH_TRT "Build MegEngine with TensorRT." ON) -option(MGE_USE_SYSTEM_LIB "Build MegEngine with system libraries." OFF) -option(MGB_WITH_FLATBUFFERS "Build MegBrain with FlatBuffers serialization support." ON) - if(NOT MGE_WITH_JIT) if(MGE_WITH_HALIDE) message(WARNING "MGE_WITH_HALIDE is set to OFF with MGE_WITH_JIT disabled") @@ -221,10 +223,6 @@ if(NOT CMAKE_CUDA_HOST_COMPILER) set(CMAKE_CUDA_HOST_COMPILER $(CMAKE_CXX_COMPILER)) endif() -option(MGE_ENABLE_RTTI "Build with RTTI" ON) -option(MGE_ENABLE_LOGGING "Build with logging" ON) -option(MGE_DEBUG_UTIL "Enable debug utility" ON) - if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") set(CMAKE_BUILD_TYPE RelWithDebInfo) @@ -234,25 +232,19 @@ if(NOT MGE_ENABLE_RTTI) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") endif() -option(MGE_ENABLE_EXCEPTIONS "Build with exceptions" ON) if(NOT MGE_ENABLE_EXCEPTIONS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exception") endif() - -option(MGE_WITH_TEST "Enable test for MegEngine." OFF) if(MGE_WITH_TEST) include(cmake/gtest.cmake) endif() -option(MGE_WITH_DISTRIBUTED "Build with distributed support" ON) -option(MGE_BUILD_IMPERATIVE_RT "Build _imperative_rt.so instead of _mgb.so " OFF) if(MGE_BUILD_IMPERATIVE_RT) add_compile_definitions(MGB_ENABLE_IMPERATIVE_RUNTIME) set(CMAKE_CXX_STANDARD 17) endif() -option(MGE_BUILD_SDK "Build load_and_run" ON) if(MGE_BUILD_IMPERATIVE_RT) set(MGE_BUILD_SDK OFF) endif() @@ -262,8 +254,6 @@ if(NOT MGE_WITH_CUDA) set(MGE_WITH_DISTRIBUTED OFF) endif() -option(MGE_INFERENCE_ONLY "Build inference only library." OFF) -option(MGE_WITH_PYTHON_MODULE "Build MegEngine Python Module." ON) if(MGE_INFERENCE_ONLY) message("-- Disable distributed support for inference only build.") set(MGE_WITH_DISTRIBUTED OFF) @@ -438,8 +428,6 @@ if(${MGE_ARCH} STREQUAL "x86_64" OR ${MGE_ARCH} STREQUAL "i386") endif() endif() -option(MGE_WITH_MKLDNN "Enable Intel MKL_DNN support," ON) - # MKLDNN build if(MGE_WITH_MKLDNN AND ${MGE_ARCH} STREQUAL "x86_64") include(cmake/MKL_DNN.cmake) -- GitLab