From 2bb9003ac5373f632a040ea50ba938dadc898d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E6=9C=88=E6=83=8A=E9=B9=8A?= Date: Wed, 29 Sep 2021 17:06:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Release=20=E5=92=8C=20Debug?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根据传入的 -DCMAKE_BUILD_TYPE=Release 或者Debug, 或者不写(默认是Debug) 来决定生成何种编译文件。 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e96eb6e9..c49b487f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ if(CCACHE_FOUND) endif(CCACHE_FOUND) #set(CMAKE_BUILD_TYPE "Release") -if (${CMAKE_BUILD_TYPE} MATCHES "") +if ("${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE "Debug") endif ()