Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
options.cmake 1.75 KB
Copy Edit Raw Blame History
xktesla authored 2023-10-07 19:50 . 5c16032 适配macos平台
message("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")
set (CMAKE_CXX_STANDARD 11)
IF(WIN32)
add_definitions(-D__X2LIB_WIN32__)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_LIB)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
IF(DEBUG_OPTIONS_CMAKE)
set(CMAKE_BUILD_TYPE "Debug")
add_definitions(-D__DEBUG__)
add_definitions(-D__X2LIB_DEBUG__)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MTd")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MTd")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
ELSE(DEBUG_OPTIONS_CMAKE)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
ENDIF()
ELSEIF(LINUX)
add_definitions(-D__X2LIB_LINUX__)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
IF(DEBUG_OPTIONS_CMAKE)
add_definitions(-D__DEBUG__)
add_definitions(-D__X2LIB_DEBUG__)
set(CMAKE_BUILD_TYPE "Debug")
ELSE(DEBUG_OPTIONS_CMAKE)
set(CMAKE_BUILD_TYPE "Release")
ENDIF()
ELSEIF(MACOS)
add_definitions(-D__X2LIB_MACOS__)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
IF(DEBUG_OPTIONS_CMAKE)
add_definitions(-D__DEBUG__)
add_definitions(-D__X2LIB_DEBUG__)
set(CMAKE_BUILD_TYPE "Debug")
ELSE(DEBUG_OPTIONS_CMAKE)
set(CMAKE_BUILD_TYPE "Release")
ENDIF()
ENDIF()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化