[geos-commits] [SCM] GEOS branch 3.12 updated. 87bf94a3227626bba6a94fe65abd3b6bd2344fa6

git at osgeo.org git at osgeo.org
Tue Aug 15 20:26:05 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, 3.12 has been updated
       via  87bf94a3227626bba6a94fe65abd3b6bd2344fa6 (commit)
      from  60e59750f2476162bbbacafcb6b87a95b57a5e6d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 87bf94a3227626bba6a94fe65abd3b6bd2344fa6
Author: Aaron Barany <aaron.barany at here.com>
Date:   Tue Aug 15 20:25:35 2023 -0700

    Fix CMake on Windows with Visual Studio (#945)
    
    Avoid setting CMAKE_BUILD_TYPE default when multi-config generators are
    used.
    
    Avoid setting CMAKE_BUILD_TYPE STRINGS property if it is not a cache
    variable. This avoids CMake errors if CMAKE_BUILD_TYPE isn't set on the
    command-line.
    
    Closes #932

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a2906c73..7888f193c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -114,8 +114,12 @@ endif()
 
 # Make sure we know our build type
 if(NOT CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE ${DEFAULT_BUILD_TYPE})
-  message(STATUS "GEOS: Using default build type: ${CMAKE_BUILD_TYPE}")
+  get_property(_is_multi_config_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+  if (NOT _is_multi_config_generator)
+    set(CMAKE_BUILD_TYPE ${DEFAULT_BUILD_TYPE})
+    message(STATUS "GEOS: Using default build type: ${CMAKE_BUILD_TYPE}")
+  endif()
+  unset(_is_multi_config_generator)
 else()
   message(STATUS "GEOS: Build type: ${CMAKE_BUILD_TYPE}")
 endif()
@@ -186,7 +190,11 @@ set(CMAKE_CXX_FLAGS_ASAN "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -fno-omit-
 set(CMAKE_EXE_LINKER_FLAGS_ASAN "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fsanitize=address")
 set(CMAKE_SHARED_LINKER_FLAGS_ASAN "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=address")
 
-set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "ASAN")
+get_property(_cmake_build_type_is_cache CACHE CMAKE_BUILD_TYPE PROPERTY TYPE)
+if (_cmake_build_type_is_cache)
+  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "ASAN")
+endif()
+unset(_cmake_build_type_is_cache)
 
 #-----------------------------------------------------------------------------
 # Install directories

-----------------------------------------------------------------------

Summary of changes:
 CMakeLists.txt | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list