]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed forcing CMAKE_BUILD_TYPE to Release on multi config generators such as Xcode...
authorNathan Moinvaziri <nathan@nathanm.com>
Fri, 22 Apr 2022 21:58:24 +0000 (14:58 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 27 Apr 2022 08:38:03 +0000 (10:38 +0200)
Co-authored-by: Sergey Markelov <sergio-nsk@users.noreply.github.com>
CMakeLists.txt

index 447d92aca7a3506cede42aa40be3312ec35eb736..f0b08808898ca8bf7a5b7e6095eb1fd0dcffb180 100644 (file)
@@ -59,13 +59,15 @@ endif()
 
 # Make sure we use an appropriate BUILD_TYPE by default, "Release" to be exact
 # this should select the maximum generic optimisation on the current platform (i.e. -O3 for gcc/clang)
-if(NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE "Release" CACHE STRING
-        "Choose the type of build, standard options are: Debug Release RelWithDebInfo MinSizeRel."
-        FORCE)
-    add_feature_info(CMAKE_BUILD_TYPE 1 "Build type: ${CMAKE_BUILD_TYPE} (default)")
-else()
-    add_feature_info(CMAKE_BUILD_TYPE 1 "Build type: ${CMAKE_BUILD_TYPE} (selected)")
+if(NOT GENERATOR_IS_MULTI_CONFIG)
+    if(NOT CMAKE_BUILD_TYPE)
+        set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+            "Choose the type of build, standard options are: Debug Release RelWithDebInfo MinSizeRel."
+            FORCE)
+        add_feature_info(CMAKE_BUILD_TYPE 1 "Build type: ${CMAKE_BUILD_TYPE} (default)")
+    else()
+        add_feature_info(CMAKE_BUILD_TYPE 1 "Build type: ${CMAKE_BUILD_TYPE} (selected)")
+    endif()
 endif()
 
 #