提交 c7a5c21a 编写于 作者: M Megvii Engine Team 提交者: huangxinda

chore(bazel/cmake): fix lite bazel/cmake symbols

GitOrigin-RevId: 95f2666817d49d10d295e8bfc1b8b61379e17712
上级 3e4e4c46
......@@ -22,6 +22,8 @@ endif()
include(GNUInstallDirs)
include(CheckCXXCompilerFlag)
include(CheckIPOSupported)
CHECK_CXX_COMPILER_FLAG(-Wclass-memaccess CXX_SUPPORT_WCLASS_MEMACCESS)
set(MGE_ARCH AUTO CACHE STRING "Architecture on which MegEngine to be built.")
......@@ -86,8 +88,25 @@ if(NOT ${MGE_BIN_REDUCE} STREQUAL "")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${MGE_BIN_REDUCE}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${MGE_BIN_REDUCE}")
endif()
CHECK_CXX_COMPILER_FLAG("-ffunction-sections -fdata-sections -Wl,--gc-sections" CXX_FUNCTION_DATA_GC_SECTIONS_SUPPORT)
if(CXX_FUNCTION_DATA_GC_SECTIONS_SUPPORT)
#mac or apple not support
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections")
endif()
check_ipo_supported(RESULT IS_LTO_SUPPORT OUTPUT output_info)
if(IS_LTO_SUPPORT)
message(STATUS "lto is supported in this compiler")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto=full")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto=full")
else()
message(STATUS "lto is not supported in this compiler")
endif()
if(MGE_WITH_MIDOUT_PROFILE)
......@@ -514,7 +533,7 @@ if(MGE_WITH_CUDA)
if(MGE_WITH_CUBLAS_SHARED)
list(APPEND MGE_CUDA_LIBS cublasLt)
else()
list(APPEND MGE_CUDA_LIBS cublasLt_static)
list(APPEND MGE_CUDA_LIBS cublasLt_static culibos)
endif()
endif()
endif()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册