[geos-commits] [SCM] GEOS branch main updated. 15185e65b3e7bc671cf693c97cf103125fb4a171

git at osgeo.org git at osgeo.org
Mon Aug 28 14:29:08 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, main has been updated
       via  15185e65b3e7bc671cf693c97cf103125fb4a171 (commit)
       via  40da3a61338068549eabe19f68d1cf082cece853 (commit)
      from  feaa331749598866ffc47c3f2bef828eaa4eff8f (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 15185e65b3e7bc671cf693c97cf103125fb4a171
Author: Mike Taves <mwtoews at gmail.com>
Date:   Tue Aug 29 09:28:35 2023 +1200

    Doc: describe empty geometry for getNumGeometries (#950)

diff --git a/capi/geos_c.h.in b/capi/geos_c.h.in
index 271624334..37502912c 100644
--- a/capi/geos_c.h.in
+++ b/capi/geos_c.h.in
@@ -2580,6 +2580,8 @@ extern void GEOS_DLL *GEOSGeom_getUserData(const GEOSGeometry* g);
 * multi-geometry or collection or 1 for a simple geometry.
 * For nested collections, remember to check if returned
 * sub-geometries are **themselves** also collections.
+* Empty collection or multi-geometry types return 0,
+* and empty simple geometry types return 1.
 * \param g Input geometry
 * \return Number of direct children in this collection
 * \warning For GEOS < 3.2 this function may crash when fed simple geometries
diff --git a/include/geos/geom/Geometry.h b/include/geos/geom/Geometry.h
index 38343cee2..cfa989a9a 100644
--- a/include/geos/geom/Geometry.h
+++ b/include/geos/geom/Geometry.h
@@ -302,8 +302,13 @@ public:
     /// Return an integer representation of this Geometry type
     virtual GeometryTypeId getGeometryTypeId() const = 0; //Abstract
 
-    /// Returns the number of geometries in this collection
-    /// (or 1 if this is not a collection)
+    /**
+     * \brief Returns the number of geometries in this collection,
+     * or 1 if this is not a collection.
+     *
+     * Empty collection or multi-geometry types return 0,
+     * and empty simple geometry types return 1.
+     */
     virtual std::size_t
     getNumGeometries() const
     {

commit 40da3a61338068549eabe19f68d1cf082cece853
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 c64f5a375..f5537d0c1 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 +++++++++++---
 capi/geos_c.h.in             |  2 ++
 include/geos/geom/Geometry.h |  9 +++++++--
 3 files changed, 20 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list