[Bf-blender-cvs] [e6a9b223844] master: OBJ: New C++ based wavefront OBJ importer

2022-04-04 Thread Ankit Meel
Commit: e6a9b223844346a34ce195652449fec3229a2ec1
Author: Ankit Meel
Date:   Mon Apr 4 13:36:10 2022 +0300
Branches: master
https://developer.blender.org/rBe6a9b223844346a34ce195652449fec3229a2ec1

OBJ: New C++ based wavefront OBJ importer

This takes state of soc-2020-io-performance branch as it was at
e9bbfd0c8c7 (2021 Oct 31), merges latest master (2022 Apr 4),
adds a bunch of tests, and fixes a bunch of stuff found by said
tests. The fixes are detailed in the differential.

Timings on my machine (Windows, VS2022 release build, AMD Ryzen
5950X 32 threads):

- Rungholt minecraft level (269MB file, 1 mesh): 54.2s -> 14.2s
  (memory usage: 7.0GB -> 1.9GB).
- Blender 3.0 splash scene: "I waited for 90 minutes and gave up"
  -> 109s. Now, this time is not great, but at least 20% of the
  time is spent assigning unique names for the imported objects
  (the scene has 24 thousand objects). This is not specific to obj
  importer, but rather a general issue across blender overall.

Test suite file updates done in Subversion tests repository.

Reviewed By: @howardt, @sybren
Differential Revision: https://developer.blender.org/D13958

===

M   release/scripts/startup/bl_ui/space_topbar.py
M   source/blender/editors/io/io_obj.c
M   source/blender/editors/io/io_obj.h
M   source/blender/editors/io/io_ops.c
M   source/blender/io/wavefront_obj/CMakeLists.txt
M   source/blender/io/wavefront_obj/IO_wavefront_obj.cc
M   source/blender/io/wavefront_obj/IO_wavefront_obj.h
A   source/blender/io/wavefront_obj/importer/importer_mesh_utils.cc
A   source/blender/io/wavefront_obj/importer/importer_mesh_utils.hh
A   source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
A   source/blender/io/wavefront_obj/importer/obj_import_file_reader.hh
A   source/blender/io/wavefront_obj/importer/obj_import_mesh.cc
A   source/blender/io/wavefront_obj/importer/obj_import_mesh.hh
A   source/blender/io/wavefront_obj/importer/obj_import_mtl.cc
A   source/blender/io/wavefront_obj/importer/obj_import_mtl.hh
A   source/blender/io/wavefront_obj/importer/obj_import_nurbs.cc
A   source/blender/io/wavefront_obj/importer/obj_import_nurbs.hh
A   source/blender/io/wavefront_obj/importer/obj_import_objects.hh
A   source/blender/io/wavefront_obj/importer/obj_importer.cc
A   source/blender/io/wavefront_obj/importer/obj_importer.hh
A   source/blender/io/wavefront_obj/importer/parser_string_utils.cc
A   source/blender/io/wavefront_obj/importer/parser_string_utils.hh
A   source/blender/io/wavefront_obj/tests/obj_importer_tests.cc

===

diff --git a/release/scripts/startup/bl_ui/space_topbar.py 
b/release/scripts/startup/bl_ui/space_topbar.py
index 0a428b4ea3f..55dcb4a20eb 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -456,6 +456,7 @@ class TOPBAR_MT_file_import(Menu):
 "wm.usd_import", text="Universal Scene Description (.usd, 
.usdc, .usda)")
 
 self.layout.operator("wm.gpencil_import_svg", text="SVG as Grease 
Pencil")
+self.layout.operator("wm.obj_import", text="Wavefront (.obj) 
(experimental)")
 
 
 class TOPBAR_MT_file_export(Menu):
diff --git a/source/blender/editors/io/io_obj.c 
b/source/blender/editors/io/io_obj.c
index df15191916a..97f1e08fdff 100644
--- a/source/blender/editors/io/io_obj.c
+++ b/source/blender/editors/io/io_obj.c
@@ -359,3 +359,87 @@ void WM_OT_obj_export(struct wmOperatorType *ot)
   RNA_def_boolean(
   ot->srna, "smooth_group_bitflags", false, "Generate Bitflags for Smooth 
Groups", "");
 }
+
+static int wm_obj_import_invoke(bContext *C, wmOperator *op, const wmEvent 
*UNUSED(event))
+{
+  WM_event_add_fileselect(C, op);
+  return OPERATOR_RUNNING_MODAL;
+}
+
+static int wm_obj_import_exec(bContext *C, wmOperator *op)
+{
+  if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
+BKE_report(op->reports, RPT_ERROR, "No filename given");
+return OPERATOR_CANCELLED;
+  }
+
+  struct OBJImportParams import_params;
+  RNA_string_get(op->ptr, "filepath", import_params.filepath);
+  import_params.clamp_size = RNA_float_get(op->ptr, "clamp_size");
+  import_params.forward_axis = RNA_enum_get(op->ptr, "forward_axis");
+  import_params.up_axis = RNA_enum_get(op->ptr, "up_axis");
+
+  OBJ_import(C, _params);
+
+  return OPERATOR_FINISHED;
+}
+
+static void ui_obj_import_settings(uiLayout *layout, PointerRNA *imfptr)
+{
+  uiLayoutSetPropSep(layout, true);
+  uiLayoutSetPropDecorate(layout, false);
+  uiLayout *box = uiLayoutBox(layout);
+
+  uiItemL(box, IFACE_("Transform"), ICON_OBJECT_DATA);
+  uiLayout 

[Bf-blender-cvs] [5be74160c06] master: macOS/ blender_icons_update.py: prioritise environment variables

2022-02-21 Thread Ankit Meel
Commit: 5be74160c06a51fa61dce6293ddbd538562e766b
Author: Ankit Meel
Date:   Mon Feb 21 15:19:19 2022 +0530
Branches: master
https://developer.blender.org/rB5be74160c06a51fa61dce6293ddbd538562e766b

macOS/ blender_icons_update.py: prioritise environment variables

Also fix binary name for mac

Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D14161

===

M   release/datafiles/blender_icons_update.py

===

diff --git a/release/datafiles/blender_icons_update.py 
b/release/datafiles/blender_icons_update.py
index f4299fc510f..c1cf8d6fcb0 100755
--- a/release/datafiles/blender_icons_update.py
+++ b/release/datafiles/blender_icons_update.py
@@ -26,8 +26,8 @@ if sys.platform[:3] == "win":
 env["SystemDrive"] = os.environ.get("SystemDrive", "")
 env["SystemRoot"] = os.environ.get("SystemRoot", "")
 
-inkscape_bin = os.environ.get("INKSCAPE_BIN", "inkscape")
-blender_bin = os.environ.get("BLENDER_BIN", "blender")
+inkscape_bin = "inkscape"
+blender_bin = "blender"
 
 if sys.platform == 'darwin':
 inkscape_app_path = '/Applications/Inkscape.app/Contents/MacOS/inkscape'
@@ -36,6 +36,11 @@ if sys.platform == 'darwin':
 blender_app_path = '/Applications/Blender.app/Contents/MacOS/Blender'
 if os.path.exists(blender_app_path):
 blender_bin = blender_app_path
+else:
+blender_bin = "Blender"
+
+inkscape_bin = os.environ.get("INKSCAPE_BIN", inkscape_bin)
+blender_bin = os.environ.get("BLENDER_BIN", blender_bin)
 
 cmd = (
 inkscape_bin,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [71545e542c5] master: macOS/bpy module: install scripts relative to bpy.so

2022-02-16 Thread Ankit Meel
Commit: 71545e542c5b14351a0addf713234cf87a39a5c3
Author: Ankit Meel
Date:   Thu Feb 17 01:28:10 2022 +0530
Branches: master
https://developer.blender.org/rB71545e542c5b14351a0addf713234cf87a39a5c3

macOS/bpy module: install scripts relative to bpy.so

Brew's Python framework's site-packages is a symlink so the assumption
that Resources and site-packages would be in the same directory
doesn't hold. So install scripts etc relative to bpy.so. Part of D14111

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index e6e122508a9..6a1d5b78611 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -319,11 +319,16 @@ elseif(WIN32)
 elseif(APPLE)
   if(WITH_PYTHON_MODULE)
 if(WITH_INSTALL_PORTABLE)
+  set(BPY_INSTALL_DIR)
   set(TARGETDIR_VER 
$/../Resources/${BLENDER_VERSION})
   # Keep the `BLENDER_VERSION` folder and bpy.so in the build folder.
   set(INSTALL_BPY_TO_SITE_PACKAGES OFF)
 else()
-  set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
+  # Parent directory of bpy.so for installation.
+  set(BPY_INSTALL_DIR ${PYTHON_LIBPATH}/site-packages)
+  # Defined in terms of site-packages since the site-packages
+  # directory can be a symlink (brew for example).
+  set(TARGETDIR_VER "${BPY_INSTALL_DIR}/../Resources/${BLENDER_VERSION}")
   set(INSTALL_BPY_TO_SITE_PACKAGES ON)
 endif()
   else()
@@ -1108,11 +1113,12 @@ elseif(APPLE)
 )
 unset(_py_inc_suffix)
   endif()
+
   if(WITH_PYTHON_MODULE)
 if(INSTALL_BPY_TO_SITE_PACKAGES)
   install(
 TARGETS blender
-LIBRARY DESTINATION ${PYTHON_LIBPATH}/site-packages
+LIBRARY DESTINATION ${BPY_INSTALL_DIR}
   )
 endif()
   endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6862caea5e8] master: macOS/bpy module: install text files correctly

2022-02-16 Thread Ankit Meel
Commit: 6862caea5e878ab5de22513fb9ca13e17add8919
Author: Ankit Meel
Date:   Thu Feb 17 01:30:51 2022 +0530
Branches: master
https://developer.blender.org/rB6862caea5e878ab5de22513fb9ca13e17add8919

macOS/bpy module: install text files correctly

Instead of Blender.app (despite building bpy), install license etc in
`Resources/text` of bpy install location. Part of D14111

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 6a1d5b78611..d17afad0918 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -334,6 +334,8 @@ elseif(APPLE)
   else()
 set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
   endif()
+  # License, copyright, readme files.
+  set(BLENDER_TEXT_FILES_DESTINATION "${TARGETDIR_VER}/../text")
   set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   # Skip relinking on cpack / install
   set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true)
@@ -1057,9 +1059,6 @@ elseif(APPLE)
 DESTINATION "."
   )
 
-  # install release and app files
-  set(BLENDER_TEXT_FILES_DESTINATION Blender.app/Contents/Resources/text)
-
   install(
 FILES ${OSX_APP_SOURCEDIR}/Contents/PkgInfo
 DESTINATION Blender.app/Contents

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c146d75808f] master: readme.html: replace IRC with blender.chat, fix typo

2022-02-14 Thread Ankit Meel
Commit: c146d75808f84fddeffb0059b31e572845a3bc49
Author: Ankit Meel
Date:   Tue Feb 15 11:09:40 2022 +0530
Branches: master
https://developer.blender.org/rBc146d75808f84fddeffb0059b31e572845a3bc49

readme.html: replace IRC with blender.chat, fix typo

- Replace IRC links and channels with blender.chat ones.
- Fix mismatch in text vs link of "GIT and Bug Tracker".
- http -> https for blender links

===

M   release/text/readme.html

===

diff --git a/release/text/readme.html b/release/text/readme.html
index 6048dd78e6b..37fe43a5abc 100644
--- a/release/text/readme.html
+++ b/release/text/readme.html
@@ -33,7 +33,7 @@ It's free and open-source software, released under the GNU 
GPL licence.
 The entire source code is available on our website.
 
 
-For more information, visit http://www.blender.org/;>blender.org.
+For more information, visit https://www.blender.org/;>blender.org.
 
 
 @BLENDER_VERSION@
@@ -79,27 +79,27 @@ download an addon as a .py or .zip file, then press the 
"Install Addon" button a
 Links
 Users:
 
-General information http://www.blender.org/;>
+General information https://www.blender.org/;>
 www.blender.org 
 Release Notes https://wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@;>
 wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@
-Tutorials http://www.blender.org/support/tutorials/;>
+Tutorials https://www.blender.org/support/tutorials/;>
 www.blender.org/support/tutorials/ 
 Manual https://docs.blender.org/manual/en/latest/;>https://docs.blender.org/manual/en/latest/
-User Forum http://www.blenderartists.org/;>
+User Forum https://www.blenderartists.org/;>
 www.blenderartists.org
-IRC 
-#blenderchat or 
-#blender on irc.freenode.net
+Chat https://blender.chat/channel/today;>
+#today or https://blender.chat/channel/support;>
+#support on blender.chat
 
 Developers:
 
-Development http://www.blender.org/get-involved/developers/;>
+Development https://www.blender.org/get-involved/developers/;>
 www.blender.org/get-involved/developers/
-GIT and Bug Tracker http://developer.blender.org/;>
-www.blender.org/get-involved/
-IRC 
-#blendercoders on irc.freenode.net
+GIT and Bug Tracker https://developer.blender.org/;>
+developer.blender.org
+Chat https://blender.chat/channel/blender-coders;>
+#blender-coders on blender.chat
 
 
 

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [14d98d03880] master: CMake: create readme.html with configure_file

2022-02-14 Thread Ankit Meel
Commit: 14d98d0388043f7e49451e31fcc1cbb46a214fa9
Author: Ankit Meel
Date:   Tue Feb 15 10:14:35 2022 +0530
Branches: master
https://developer.blender.org/rB14d98d0388043f7e49451e31fcc1cbb46a214fa9

CMake: create readme.html with configure_file

Since the output file stays unmodified for most developer builds,
install step installed it redundantly.

Create readme.html using `configure_file`:
- Now it's modified only if final output changes (handled by CMake).
- If input file (from git) or blender version changes,
  it //will// be modified.

Also don't re-implement what CMake can do.

Reviewed By: campbellbarton, LazyDodo
Differential Revision: https://developer.blender.org/D13863

===

M   release/text/readme.html
M   source/creator/CMakeLists.txt

===

diff --git a/release/text/readme.html b/release/text/readme.html
index 3972f137d8e..6048dd78e6b 100644
--- a/release/text/readme.html
+++ b/release/text/readme.html
@@ -18,7 +18,7 @@
   
 
 
-Blender BLENDER_VERSION
+Blender @BLENDER_VERSION@
 
 About
 
@@ -36,10 +36,10 @@ The entire source code is available on our website.
 For more information, visit http://www.blender.org/;>blender.org.
 
 
-BLENDER_VERSION
+@BLENDER_VERSION@
 
-The Blender Foundation and online developer community is proud to present 
Blender BLENDER_VERSION.
-https://wiki.blender.org/wiki/Reference/Release_Notes/BLENDER_VERSION;>
+The Blender Foundation and online developer community is proud to present 
Blender @BLENDER_VERSION@.
+https://wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@;>
 More information about this release.
 
 
@@ -81,8 +81,8 @@ download an addon as a .py or .zip file, then press the 
"Install Addon" button a
 
 General information http://www.blender.org/;>
 www.blender.org 
-Release Notes https://wiki.blender.org/wiki/Reference/Release_Notes/BLENDER_VERSION;>
-wiki.blender.org/wiki/Reference/Release_Notes/BLENDER_VERSION
+Release Notes https://wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@;>
+wiki.blender.org/wiki/Reference/Release_Notes/@BLENDER_VERSION@
 Tutorials http://www.blender.org/support/tutorials/;>
 www.blender.org/support/tutorials/ 
 Manual https://docs.blender.org/manual/en/latest/;>https://docs.blender.org/manual/en/latest/
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index e804db05687..e6e122508a9 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1130,15 +1130,9 @@ endif()
 
 if(DEFINED BLENDER_TEXT_FILES_DESTINATION)
 
-  install(
-CODE
-"
-file(READ \"${CMAKE_SOURCE_DIR}/release/text/readme.html\" DATA_SRC)
-string(REGEX REPLACE \"BLENDER_VERSION\" \"${BLENDER_VERSION}\" DATA_DST 
\"\${DATA_SRC}\")
-file(WRITE \"${CMAKE_BINARY_DIR}/release/text/readme.html\" 
\"\${DATA_DST}\")
-unset(DATA_SRC)
-unset(DATA_DST)
-"
+  configure_file(${CMAKE_SOURCE_DIR}/release/text/readme.html
+ ${CMAKE_BINARY_DIR}/release/text/readme.html
+ @ONLY
   )
   list(APPEND BLENDER_TEXT_FILES
 ${CMAKE_BINARY_DIR}/release/text/readme.html

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7331c86dbf3] master: macOS: support building blender-thumbnailer

2022-02-04 Thread Ankit Meel
Commit: 7331c86dbf3bdd65fbf7e7f26bf4461515a0c591
Author: Ankit Meel
Date:   Fri Feb 4 20:57:30 2022 +0530
Branches: master
https://developer.blender.org/rB7331c86dbf3bdd65fbf7e7f26bf4461515a0c591

macOS: support building blender-thumbnailer

It was missing framework flags added in `setup_platform_linker_flags`.
Keep it off until QuickLook Thumbnailing is implemented.

Differential Revision: https://developer.blender.org/D13997

===

M   CMakeLists.txt
M   source/blender/blendthumb/CMakeLists.txt
M   source/creator/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f73149adc04..21a398e31a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,8 +157,9 @@ option(WITH_BLENDER "Build blender (disable to build only 
the blender player)" O
 mark_as_advanced(WITH_BLENDER)
 
 if(APPLE)
-  # Currently this causes a build error linking, disable.
-  set(WITH_BLENDER_THUMBNAILER OFF)
+  # In future, can be used with `quicklookthumbnailing/qlthumbnailreply` to 
create file
+  # thumbnails for say Finder. Turn it off for now.
+  option(WITH_BLENDER_THUMBNAILER "Build \"blender-thumbnailer\" thumbnail 
extraction utility" OFF)
 elseif(WIN32)
   option(WITH_BLENDER_THUMBNAILER "Build \"BlendThumb.dll\" helper for Windows 
explorer integration" ON)
 else()
diff --git a/source/blender/blendthumb/CMakeLists.txt 
b/source/blender/blendthumb/CMakeLists.txt
index e2d278255ba..d64e942069d 100644
--- a/source/blender/blendthumb/CMakeLists.txt
+++ b/source/blender/blendthumb/CMakeLists.txt
@@ -65,6 +65,7 @@ else()
   )
 
   add_executable(blender-thumbnailer ${SRC} ${SRC_CMD})
+  setup_platform_linker_flags(blender-thumbnailer)
   target_link_libraries(blender-thumbnailer bf_blenlib)
   target_link_libraries(blender-thumbnailer ${PTHREADS_LIBRARIES})
 endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 6f23fbe486a..b86b8999fd0 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1082,6 +1082,13 @@ elseif(APPLE)
 Blender.app/Contents/
   )
 
+  if(WITH_BLENDER_THUMBNAILER)
+  install(
+TARGETS blender-thumbnailer
+DESTINATION Blender.app/Contents/MacOS/
+  )
+  endif()
+
   if(WITH_OPENMP AND OPENMP_CUSTOM)
 install(
   FILES "${OpenMP_LIBRARY}"

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [36c40760a5a] master: .obj: simplify templates in FileHandler, add comments

2022-01-21 Thread Ankit Meel
Commit: 36c40760a5a38db733e20c948b2170ab78bb2607
Author: Ankit Meel
Date:   Fri Jan 21 14:45:21 2022 +0530
Branches: master
https://developer.blender.org/rB36c40760a5a38db733e20c948b2170ab78bb2607

.obj: simplify templates in FileHandler, add comments

- Remove redundant template from `FormattingSyntax`.
- Replace one enable_if with static assert for readability
- Add comments

No functional change expected.

Reviewed by: jacqueslucke
Differential Revision: https://developer.blender.org/D13882

===

M   source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
M   source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
M   source/blender/io/wavefront_obj/exporter/obj_export_io.hh

===

diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc 
b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
index 8c845c34db2..d31353c4a76 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
@@ -394,7 +394,7 @@ MTLWriter::MTLWriter(const char *obj_filepath) 
noexcept(false)
   if (!ok) {
 throw std::system_error(ENAMETOOLONG, std::system_category(), "");
   }
-  file_handler_ = std::make_unique>(mtl_filepath_);
+  file_handler_ = 
std::make_unique>(mtl_filepath_);
 }
 
 void MTLWriter::write_header(const char *blen_filepath) const
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh 
b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
index 1cad179a70c..7385d9fabe2 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
@@ -49,14 +49,14 @@ struct IndexOffsets {
 class OBJWriter : NonMovable, NonCopyable {
  private:
   const OBJExportParams _params_;
-  std::unique_ptr> file_handler_ = nullptr;
+  std::unique_ptr> file_handler_ = 
nullptr;
   IndexOffsets index_offsets_{0, 0, 0};
 
  public:
   OBJWriter(const char *filepath, const OBJExportParams _params) 
noexcept(false)
   : export_params_(export_params)
   {
-file_handler_ = std::make_unique>(filepath);
+file_handler_ = 
std::make_unique>(filepath);
   }
 
   void write_header() const;
@@ -172,7 +172,7 @@ class OBJWriter : NonMovable, NonCopyable {
  */
 class MTLWriter : NonMovable, NonCopyable {
  private:
-  std::unique_ptr> file_handler_ = nullptr;
+  std::unique_ptr> file_handler_ = 
nullptr;
   std::string mtl_filepath_;
   Vector mtlmaterials_;
   /* Map from a Material* to an index into mtlmaterials_. */
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_io.hh 
b/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
index a6f0174d68b..e88a76fc4e8 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
@@ -88,6 +88,7 @@ enum class eMTLSyntaxElement {
 
 template struct FileTypeTraits;
 
+/* Used to prevent mixing of say OBJ file format with MTL syntax elements. */
 template<> struct FileTypeTraits {
   using SyntaxType = eOBJSyntaxElement;
 };
@@ -96,15 +97,19 @@ template<> struct FileTypeTraits {
   using SyntaxType = eMTLSyntaxElement;
 };
 
-template struct Formatting {
+struct FormattingSyntax {
+  /* Formatting syntax with the file format key like `newmtl %s\n`. */
   const char *fmt = nullptr;
+  /* Number of arguments needed by the syntax. */
   const int total_args = 0;
-  /* Fail to compile by default. */
-  const bool is_type_valid = false;
+  /* Whether types of the given arguments are accepted by the syntax above. 
Fail to compile by
+   * default.
+   */
+  const bool are_types_valid = false;
 };
 
 /**
- * Type dependent but always false. Use to add a conditional compile-time 
error.
+ * Type dependent but always false. Use to add a constexpr-conditional 
compile-time error.
  */
 template struct always_false : std::false_type {
 };
@@ -118,9 +123,8 @@ constexpr bool is_type_integral = (... && 
std::is_integral_v>);
 template
 constexpr bool is_type_string_related = (... && 
std::is_constructible_v);
 
-template
-constexpr std::enable_if_t>
-syntax_elem_to_formatting(const eOBJSyntaxElement key)
+template
+constexpr FormattingSyntax syntax_elem_to_formatting(const eOBJSyntaxElement 
key)
 {
   switch (key) {
 case eOBJSyntaxElement::vertex_coords: {
@@ -201,9 +205,8 @@ syntax_elem_to_formatting(const eOBJSyntaxElement key)
   }
 }
 
-template
-constexpr std::enable_if_t>
-syntax_elem_to_formatting(const eMTLSyntaxElement key)
+template
+constexpr FormattingSyntax syntax_elem_to_formatting(const eMTLSyntaxElement 
key)
 {
   switch (key) {
 case eMTLSyntaxElement::newmtl: {
@@ -261,21 +264,25 @@ syntax_elem_to_format

[Bf-blender-cvs] [cd0acba330e] master: CMake: Support external callback in configuration

2022-01-19 Thread Ankit Meel
Commit: cd0acba330eb7dd2f39dd3ee218cc793f1956a2a
Author: Ankit Meel
Date:   Thu Jan 20 00:15:09 2022 +0530
Branches: master
https://developer.blender.org/rBcd0acba330eb7dd2f39dd3ee218cc793f1956a2a

CMake: Support external callback in configuration

An external CMake script can be used to debug CMake code, modify/read
target properties, inter-target dependencies, non-cache variables etc.

Reviewed by: LazyDodo, brecht
Differential Revision: https://developer.blender.org/D13830

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8af43d36916..25cdd122a7f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -711,6 +711,9 @@ endif()
 set(POSTINSTALL_SCRIPT "" CACHE FILEPATH "Run given CMake script after 
installation process")
 mark_as_advanced(POSTINSTALL_SCRIPT)
 
+set(POSTCONFIGURE_SCRIPT "" CACHE FILEPATH "Run given CMake script as the last 
step of CMake configuration")
+mark_as_advanced(POSTCONFIGURE_SCRIPT)
+
 # end option(...)
 
 
@@ -2074,3 +2077,8 @@ endif()
 if(0)
   print_all_vars()
 endif()
+
+# Should be the last step of configuration.
+if(POSTCONFIGURE_SCRIPT)
+  include(${POSTCONFIGURE_SCRIPT})
+endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [596ce115567] master: CMake Cleanup: use set for filepath instead of option

2022-01-19 Thread Ankit Meel
Commit: 596ce115567e3ddfd7ab5b7a8a488d064983e83c
Author: Ankit Meel
Date:   Wed Jan 19 23:34:25 2022 +0530
Branches: master
https://developer.blender.org/rB596ce115567e3ddfd7ab5b7a8a488d064983e83c

CMake Cleanup: use set for filepath instead of option

See https://developer.blender.org/D13830#368219

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 380acbbba0f..8af43d36916 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -708,7 +708,7 @@ if(UNIX AND NOT APPLE)
 endif()
 
 # Installation process.
-option(POSTINSTALL_SCRIPT "Run given CMake script after installation process" 
OFF)
+set(POSTINSTALL_SCRIPT "" CACHE FILEPATH "Run given CMake script after 
installation process")
 mark_as_advanced(POSTINSTALL_SCRIPT)
 
 # end option(...)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ca881afef16] blender-v2.83-release: Fix T88877: 2.93: Crash on recent OSX with a non-English locale.

2022-01-17 Thread Ankit Meel
Commit: ca881afef1631cdd138ccf9af090ca6fb29b3608
Author: Ankit Meel
Date:   Fri Oct 29 10:11:04 2021 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBca881afef1631cdd138ccf9af090ca6fb29b3608

Fix T88877: 2.93: Crash on recent OSX with a non-English locale.

Looks like OSX changed the default format of its locale, which is not
valid anymore for gettext/boost::locale.

Solution based on investigations and patch by Kieun Mun (@kieuns), with
some further tweaks by Ankit Meel (@ankitm), many thanks.

Also add an exception catcher on `std::runtime_error` in
`bl_locale_set()`, since in OSX catching the ancestor `std::exception`
does not work with `boost::locale::conv::conversion_error` and the like
for some reasons.

Reviewed By: #platform_macos, brecht

Maniphest Tasks: T88877

Differential Revision: https://developer.blender.org/D13019

===

M   intern/locale/boost_locale_wrapper.cpp
M   intern/locale/osx_user_locale.mm

===

diff --git a/intern/locale/boost_locale_wrapper.cpp 
b/intern/locale/boost_locale_wrapper.cpp
index 73433fe7c5e..ede9377b38f 100644
--- a/intern/locale/boost_locale_wrapper.cpp
+++ b/intern/locale/boost_locale_wrapper.cpp
@@ -117,6 +117,13 @@ void bl_locale_set(const char *locale)
 
 #undef LOCALE_INFO
   }
+  // Extra catch on `std::runtime_error` is needed for macOS/Clang as it seems 
that exceptions
+  // like `boost::locale::conv::conversion_error` (which inherit from 
`std::runtime_error`) are
+  // not caught by their ancestor `std::exception`. See
+  // https://developer.blender.org/T88877#1177108 .
+  catch (std::runtime_error const ) {
+std::cout << "bl_locale_set(" << locale << "): " << e.what() << " \n";
+  }
   catch (std::exception const ) {
 std::cout << "bl_locale_set(" << locale << "): " << e.what() << " \n";
   }
diff --git a/intern/locale/osx_user_locale.mm b/intern/locale/osx_user_locale.mm
index e2f65d39df9..ce694b5fc1e 100644
--- a/intern/locale/osx_user_locale.mm
+++ b/intern/locale/osx_user_locale.mm
@@ -14,7 +14,17 @@ const char *osx_user_locale()
   CFLocaleRef myCFLocale = CFLocaleCopyCurrent();
   NSLocale *myNSLocale = (NSLocale *)myCFLocale;
   [myNSLocale autorelease];
-  NSString *nsIdentifier = [myNSLocale localeIdentifier];
+
+  // This produces gettext-invalid locale in recent macOS versions (11.4),
+  // like `ko-Kore_KR` instead of `ko_KR`. See T88877.
+  // NSString *nsIdentifier = [myNSLocale localeIdentifier];
+
+  const NSString *nsIdentifier = [myNSLocale languageCode];
+  const NSString *const nsIdentifier_country = [myNSLocale countryCode];
+  if ([nsIdentifier length] != 0 && [nsIdentifier_country length] != 0) {
+nsIdentifier = [NSString stringWithFormat:@"%@_%@", nsIdentifier, 
nsIdentifier_country];
+  }
+
   user_locale = ::strdup([nsIdentifier UTF8String]);
   [pool drain];

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b87d87b1d3c] master: macOS: fix llvm-ranlib invalid option error

2022-01-15 Thread Ankit Meel
Commit: b87d87b1d3c8400e4ee4ea3f0763df64c8ca7fc0
Author: Ankit Meel
Date:   Sun Jan 16 11:47:55 2022 +0530
Branches: master
https://developer.blender.org/rBb87d87b1d3c8400e4ee4ea3f0763df64c8ca7fc0

macOS: fix llvm-ranlib invalid option error

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index bf517f8fde9..447645b6806 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -480,8 +480,11 @@ string(APPEND PLATFORM_LINKFLAGS " -stdlib=libc++")
 # Suppress ranlib "has no symbols" warnings (workaround for T48250)
 set(CMAKE_C_ARCHIVE_CREATE   " Scr   ")
 set(CMAKE_CXX_ARCHIVE_CREATE " Scr   ")
-set(CMAKE_C_ARCHIVE_FINISH   " -no_warning_for_no_symbols -c 
")
-set(CMAKE_CXX_ARCHIVE_FINISH " -no_warning_for_no_symbols -c 
")
+# llvm-ranlib doesn't support this flag. Xcode's libtool does.
+if(NOT ${CMAKE_RANLIB} MATCHES ".*llvm-ranlib$")
+  set(CMAKE_C_ARCHIVE_FINISH   " -no_warning_for_no_symbols -c 
")
+  set(CMAKE_CXX_ARCHIVE_FINISH " -no_warning_for_no_symbols -c 
")
+endif()
 
 if(WITH_COMPILER_CCACHE)
   if(NOT CMAKE_GENERATOR STREQUAL "Xcode")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d723fa3d316] master: blenlib Any tests: Fix unknown pragma warning on Windows.

2022-01-14 Thread Ankit Meel
Commit: d723fa3d3165b02db7d6ebd0c90c4c563baec837
Author: Ankit Meel
Date:   Fri Jan 14 22:06:53 2022 +0530
Branches: master
https://developer.blender.org/rBd723fa3d3165b02db7d6ebd0c90c4c563baec837

blenlib Any tests: Fix unknown pragma warning on Windows.

Part of a5cb7c1e62a07c17e346278b1c4e9ea58c9f54e0 is reverted since it 
created unknown pragma warning on windows.
Use a trick to do self-assigning.
Reviewed by Jacques Lucke in chat.

===

M   source/blender/blenlib/tests/BLI_any_test.cc

===

diff --git a/source/blender/blenlib/tests/BLI_any_test.cc 
b/source/blender/blenlib/tests/BLI_any_test.cc
index d5871f46192..3a5cbee6d72 100644
--- a/source/blender/blenlib/tests/BLI_any_test.cc
+++ b/source/blender/blenlib/tests/BLI_any_test.cc
@@ -53,11 +53,9 @@ TEST(any, AssignMap)
   EXPECT_EQ((b.get>().lookup(4)), 2);
 
   Any<> c = std::move(a);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wself-assign-overloaded"
-  /* Test valid state after self assignment. */
-  c = c;
-#pragma clang diagnostic pop
+  /* Test valid state after self assignment. Clang emits 
`-Wself-assign-overloaded` with `c=c;`.
+   * And pragma suppression creates warnings on other compilers. */
+  c = static_cast(c);
   EXPECT_TRUE(c);
   EXPECT_EQ((c.get>().lookup(4)), 2);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ba48c1ee581] master: macOS: silence bundle identifier mismatch Xcode warning

2022-01-14 Thread Ankit Meel
Commit: ba48c1ee581a6514fe558d23a5c63fa8a53ddc5b
Author: Ankit Meel
Date:   Fri Jan 14 19:33:23 2022 +0530
Branches: master
https://developer.blender.org/rBba48c1ee581a6514fe558d23a5c63fa8a53ddc5b

macOS: silence bundle identifier mismatch Xcode warning

Blender.xcodeproj User-supplied CFBundleIdentifier value
'org.blenderfoundation.blender' in the Info.plist must be the same as
the PRODUCT_BUNDLE_IDENTIFIER build setting value ''.

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D13826

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 929be0c93f7..bf517f8fde9 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -508,3 +508,6 @@ list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
 
 set(CMAKE_SKIP_INSTALL_RPATH FALSE)
 list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
+
+# Same as `CFBundleIdentifier` in Info.plist.
+set(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER 
"org.blenderfoundation.blender")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6f51cb0ad76] master: Info.plist: Bump LSMinimumSystemVersion to silence warning

2022-01-14 Thread Ankit Meel
Commit: 6f51cb0ad76afc06006a58e665b07537e380dbc0
Author: Ankit Meel
Date:   Fri Jan 14 19:33:06 2022 +0530
Branches: master
https://developer.blender.org/rB6f51cb0ad76afc06006a58e665b07537e380dbc0

Info.plist: Bump LSMinimumSystemVersion to silence warning

Didn't remove the key-value pair since old Xcode behavior is not
known.

warning: LSMinimumSystemVersion of '10.9.0' is less than the value of
MACOSX_DEPLOYMENT_TARGET '10.13' - setting to '10.13'. (in target
'blender' from project 'Blender')

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D13831

===

M   release/darwin/Blender.app/Contents/Info.plist

===

diff --git a/release/darwin/Blender.app/Contents/Info.plist 
b/release/darwin/Blender.app/Contents/Info.plist
index 9b2d5248d8e..263bd8cbba1 100644
--- a/release/darwin/Blender.app/Contents/Info.plist
+++ b/release/darwin/Blender.app/Contents/Info.plist
@@ -3,7 +3,7 @@
 
 
LSMinimumSystemVersion
-   10.9.0
+   10.13
CFBundleDocumentTypes



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a5cb7c1e62a] master: blenlib/ Any tests: fix self-assignment warning and typo

2022-01-14 Thread Ankit Meel
Commit: a5cb7c1e62a07c17e346278b1c4e9ea58c9f54e0
Author: Ankit Meel
Date:   Fri Jan 14 19:32:29 2022 +0530
Branches: master
https://developer.blender.org/rBa5cb7c1e62a07c17e346278b1c4e9ea58c9f54e0

blenlib/ Any tests: fix self-assignment warning and typo

Fix assignment warning

source/blender/blenlib/tests/BLI_any_test.cc:56:5: warning: explicitly
assigning value of variable of type 'blender::Any'
to itself [-Wself-assign-overloaded]
  c = c;

Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D13835

===

M   source/blender/blenlib/tests/BLI_any_test.cc

===

diff --git a/source/blender/blenlib/tests/BLI_any_test.cc 
b/source/blender/blenlib/tests/BLI_any_test.cc
index 436a1d5fa4a..d5871f46192 100644
--- a/source/blender/blenlib/tests/BLI_any_test.cc
+++ b/source/blender/blenlib/tests/BLI_any_test.cc
@@ -53,8 +53,12 @@ TEST(any, AssignMap)
   EXPECT_EQ((b.get>().lookup(4)), 2);
 
   Any<> c = std::move(a);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wself-assign-overloaded"
+  /* Test valid state after self assignment. */
   c = c;
-  EXPECT_TRUE(b);
+#pragma clang diagnostic pop
+  EXPECT_TRUE(c);
   EXPECT_EQ((c.get>().lookup(4)), 2);
 
   EXPECT_TRUE((a.get>().is_empty())); /* NOLINT: 
bugprone-use-after-move */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4b8cf11fa55] master: macOS: fix xcrun sdk detection for minimal CLT

2022-01-10 Thread Ankit Meel
Commit: 4b8cf11fa554f9e1aeaa9d3a44df275751577f12
Author: Ankit Meel
Date:   Tue Jan 11 01:07:31 2022 +0530
Branches: master
https://developer.blender.org/rB4b8cf11fa554f9e1aeaa9d3a44df275751577f12

macOS: fix xcrun sdk detection for minimal CLT

Differential Revision: https://developer.blender.org/D13783

===

M   build_files/cmake/platform/platform_apple_xcode.cmake

===

diff --git a/build_files/cmake/platform/platform_apple_xcode.cmake 
b/build_files/cmake/platform/platform_apple_xcode.cmake
index 639d7e43afd..c9afd67df84 100644
--- a/build_files/cmake/platform/platform_apple_xcode.cmake
+++ b/build_files/cmake/platform/platform_apple_xcode.cmake
@@ -96,7 +96,7 @@ else()
 # Detect SDK version to use.
 if(NOT DEFINED OSX_SYSTEM)
   execute_process(
-  COMMAND xcrun --show-sdk-version
+  COMMAND xcrun --sdk macosx --show-sdk-version
   OUTPUT_VARIABLE OSX_SYSTEM
   OUTPUT_STRIP_TRAILING_WHITESPACE)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9df13fba69c] master: macOS: add tilde-based path expander

2021-12-11 Thread Ankit Meel
Commit: 9df13fba69c3b0e0e013db198515e6e1a7238f6a
Author: Ankit Meel
Date:   Sat Dec 11 22:29:53 2021 +0530
Branches: master
https://developer.blender.org/rB9df13fba69c3b0e0e013db198515e6e1a7238f6a

macOS: add tilde-based path expander

Replaces `HOME` environment variable usage for user
directories like in D12802.

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D13212

===

M   source/blender/blenkernel/intern/appdir.c
M   source/blender/blenlib/BLI_fileops.h
M   source/blender/blenlib/intern/storage_apple.mm

===

diff --git a/source/blender/blenkernel/intern/appdir.c 
b/source/blender/blenkernel/intern/appdir.c
index a819459f989..9dd4c7e503a 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -175,10 +175,12 @@ const char *BKE_appdir_folder_default_or_root(void)
 
 const char *BKE_appdir_folder_home(void)
 {
-#ifndef WIN32
-  return BLI_getenv("HOME");
-#else /* Windows */
+#ifdef WIN32
   return BLI_getenv("userprofile");
+#elif defined(__APPLE__)
+  return BLI_expand_tilde("~/");
+#else
+  return BLI_getenv("HOME");
 #endif
 }
 
@@ -248,10 +250,8 @@ bool BKE_appdir_font_folder_default(char *dir)
 BLI_strncpy_wchar_as_utf8(test_dir, wpath, sizeof(test_dir));
   }
 #elif defined(__APPLE__)
-  const char *home = BLI_getenv("HOME");
-  if (home) {
-BLI_path_join(test_dir, sizeof(test_dir), home, "Library", "Fonts", NULL);
-  }
+  STRNCPY(test_dir, BLI_expand_tilde("~/Library/Fonts/"));
+  BLI_path_slash_ensure(test_dir);
 #else
   STRNCPY(test_dir, "/usr/share/fonts");
 #endif
diff --git a/source/blender/blenlib/BLI_fileops.h 
b/source/blender/blenlib/BLI_fileops.h
index 932b67866ea..2ef9b8f6c36 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -322,6 +322,14 @@ void *BLI_file_read_binary_as_mem(const char *filepath, 
size_t pad_bytes, size_t
  */
 void BLI_file_free_lines(struct LinkNode *lines);
 
+#ifdef __APPLE__
+/**
+ * Expand the leading `~` in the given path to `/Users/$USER`.
+ * This doesn't preserve the trailing path separator.
+ * Giving a path without leading `~` is not an error.
+ */
+const char *BLI_expand_tilde(const char *path_with_tilde);
+#endif
 /* This weirdo pops up in two places. */
 #if !defined(WIN32)
 #  ifndef O_BINARY
diff --git a/source/blender/blenlib/intern/storage_apple.mm 
b/source/blender/blenlib/intern/storage_apple.mm
index 07091f2b055..b0234b9a093 100644
--- a/source/blender/blenlib/intern/storage_apple.mm
+++ b/source/blender/blenlib/intern/storage_apple.mm
@@ -184,3 +184,20 @@ eFileAttributes BLI_file_attributes(const char *path)
 
   return (eFileAttributes)ret;
 }
+
+const char *BLI_expand_tilde(const char *path_with_tilde)
+{
+  static char path_expanded[FILE_MAX];
+  @autoreleasepool {
+const NSString *const str_with_tilde = [[NSString alloc] 
initWithCString:path_with_tilde
+
encoding:NSUTF8StringEncoding];
+if (!str_with_tilde) {
+  return nullptr;
+}
+const NSString *const str_expanded = [str_with_tilde 
stringByExpandingTildeInPath];
+[str_expanded getCString:path_expanded
+   maxLength:sizeof(path_expanded)
+encoding:NSUTF8StringEncoding];
+  }
+  return path_expanded;
+}

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [96387a2eff9] master: Cleanup: const, autoreleasepool, remove unneeded cast.

2021-12-11 Thread Ankit Meel
Commit: 96387a2eff97709f519274aa510942c5eec6b493
Author: Ankit Meel
Date:   Sat Dec 11 19:07:36 2021 +0530
Branches: master
https://developer.blender.org/rB96387a2eff97709f519274aa510942c5eec6b493

Cleanup: const, autoreleasepool, remove unneeded cast.

Early return in some places also.
De-duplicate getSystemDir and getUserDir also.

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D13211

===

M   intern/ghost/intern/GHOST_SystemPathsCocoa.mm

===

diff --git a/intern/ghost/intern/GHOST_SystemPathsCocoa.mm 
b/intern/ghost/intern/GHOST_SystemPathsCocoa.mm
index 43ce0bb0533..4032c145ab4 100644
--- a/intern/ghost/intern/GHOST_SystemPathsCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemPathsCocoa.mm
@@ -36,130 +36,101 @@ GHOST_SystemPathsCocoa::~GHOST_SystemPathsCocoa()
 
 #pragma mark Base directories retrieval
 
-const char *GHOST_SystemPathsCocoa::getSystemDir(int, const char *versionstr) 
const
+static const char *GetApplicationSupportDir(const char *versionstr,
+const NSSearchPathDomainMask mask,
+char *tempPath,
+const std::size_t len_tempPath)
 {
-  static char tempPath[512] = "";
-  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-  NSString *basePath;
-  NSArray *paths;
-
-  paths = NSSearchPathForDirectoriesInDomains(
-  NSApplicationSupportDirectory, NSLocalDomainMask, YES);
-
-  if ([paths count] > 0)
-basePath = [paths objectAtIndex:0];
-  else {
-[pool drain];
-return NULL;
-  }
+  @autoreleasepool {
+const NSArray *const paths = NSSearchPathForDirectoriesInDomains(
+NSApplicationSupportDirectory, mask, YES);
 
-  snprintf(tempPath,
-   sizeof(tempPath),
-   "%s/Blender/%s",
-   [basePath cStringUsingEncoding:NSASCIIStringEncoding],
-   versionstr);
-
-  [pool drain];
+if ([paths count] == 0) {
+  return NULL;
+}
+const NSString *const basePath = [paths objectAtIndex:0];
+
+snprintf(tempPath,
+ len_tempPath,
+ "%s/Blender/%s",
+ [basePath cStringUsingEncoding:NSASCIIStringEncoding],
+ versionstr);
+  }
   return tempPath;
 }
 
-const char *GHOST_SystemPathsCocoa::getUserDir(int, const char *versionstr) 
const
+const char *GHOST_SystemPathsCocoa::getSystemDir(int, const char *versionstr) 
const
 {
   static char tempPath[512] = "";
-  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-  NSString *basePath;
-  NSArray *paths;
-
-  paths = NSSearchPathForDirectoriesInDomains(
-  NSApplicationSupportDirectory, NSUserDomainMask, YES);
-
-  if ([paths count] > 0)
-basePath = [paths objectAtIndex:0];
-  else {
-[pool drain];
-return NULL;
-  }
-
-  snprintf(tempPath,
-   sizeof(tempPath),
-   "%s/Blender/%s",
-   [basePath cStringUsingEncoding:NSASCIIStringEncoding],
-   versionstr);
+  return GetApplicationSupportDir(versionstr, NSLocalDomainMask, tempPath, 
sizeof(tempPath));
+}
 
-  [pool drain];
-  return tempPath;
+const char *GHOST_SystemPathsCocoa::getUserDir(int, const char *versionstr) 
const
+{
+  static char tempPath[512] = "";
+  return GetApplicationSupportDir(versionstr, NSUserDomainMask, tempPath, 
sizeof(tempPath));
 }
 
 const char 
*GHOST_SystemPathsCocoa::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) 
const
 {
   static char tempPath[512] = "";
-  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-  NSString *basePath;
-  NSArray *paths;
-  NSSearchPathDirectory ns_directory;
-
-  switch (type) {
-case GHOST_kUserSpecialDirDesktop:
-  ns_directory = NSDesktopDirectory;
-  break;
-case GHOST_kUserSpecialDirDocuments:
-  ns_directory = NSDocumentDirectory;
-  break;
-case GHOST_kUserSpecialDirDownloads:
-  ns_directory = NSDownloadsDirectory;
-  break;
-case GHOST_kUserSpecialDirMusic:
-  ns_directory = NSMusicDirectory;
-  break;
-case GHOST_kUserSpecialDirPictures:
-  ns_directory = NSPicturesDirectory;
-  break;
-case GHOST_kUserSpecialDirVideos:
-  ns_directory = NSMoviesDirectory;
-  break;
-case GHOST_kUserSpecialDirCaches:
-  ns_directory = NSCachesDirectory;
-  break;
-default:
-  GHOST_ASSERT(
-  false,
-  "GHOST_SystemPathsCocoa::getUserSpecialDir(): Invalid enum value for 
type parameter");
-  [pool drain];
+  @autoreleasepool {
+NSSearchPathDirectory ns_directory;
+
+switch (type) {
+  case GHOST_kUserSpecialDirDesktop:
+ns_directory = NSDesktopDirectory;
+break;
+  case GHOST_kUserSpecialDirDocuments:
+ns_direc

[Bf-blender-cvs] [0ed254574fc] master: macOS: Fix build error in hash functions

2021-12-06 Thread Ankit Meel
Commit: 0ed254574fc7d138e56affe4c14b72ad67b65afe
Author: Ankit Meel
Date:   Tue Dec 7 01:38:14 2021 +0530
Branches: master
https://developer.blender.org/rB0ed254574fc7d138e56affe4c14b72ad67b65afe

macOS: Fix build error in hash functions

Remove unneeded recent static_cast attempt.

Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D13492

===

M   source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc

===

diff --git 
a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc 
b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc
index 44541362c78..95633d14270 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc
@@ -85,7 +85,7 @@ class EdgeVerticesFieldInput final : public 
GeometryFieldInput {
 
   uint64_t hash() const override
   {
-return get_default_hash_2(static_cast(vertex_), 9872922352);
+return get_default_hash_2(vertex_, 9872922352ULL);
   }
 
   bool is_equal_to(const fn::FieldNode ) const override
@@ -147,7 +147,7 @@ class EdgePositionFieldInput final : public 
GeometryFieldInput {
 
   uint64_t hash() const override
   {
-return get_default_hash_2(vertex_, 2359867235);
+return get_default_hash_2(vertex_, 2359867235ULL);
   }
 
   bool is_equal_to(const fn::FieldNode ) const override

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9fc5a9c78f5] master: macOS: Fix build error due to std::optional::value

2021-11-24 Thread Ankit Meel
Commit: 9fc5a9c78f57f11d72ab6dbaf819945c862367e1
Author: Ankit Meel
Date:   Wed Nov 24 17:41:37 2021 +0530
Branches: master
https://developer.blender.org/rB9fc5a9c78f57f11d72ab6dbaf819945c862367e1

macOS: Fix build error due to std::optional::value

===

M   source/blender/editors/animation/keyframes_keylist_test.cc

===

diff --git a/source/blender/editors/animation/keyframes_keylist_test.cc 
b/source/blender/editors/animation/keyframes_keylist_test.cc
index 012e087c9d8..17a21be5ae8 100644
--- a/source/blender/editors/animation/keyframes_keylist_test.cc
+++ b/source/blender/editors/animation/keyframes_keylist_test.cc
@@ -52,7 +52,7 @@ static void assert_act_key_column(const ActKeyColumn *column,
 {
   if (expected_frame.has_value()) {
 EXPECT_NE(column, nullptr);
-EXPECT_NEAR(column->cfra, expected_frame.value(), KEYLIST_NEAR_ERROR);
+EXPECT_NEAR(column->cfra, *expected_frame, KEYLIST_NEAR_ERROR);
   }
   else {
 EXPECT_EQ(column, nullptr);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8e237d83f21] blender-v2.93-release: Fix T88877: 2.93: Crash on recent OSX with a non-English locale.

2021-11-02 Thread Ankit Meel
Commit: 8e237d83f2138fb94933f971a070a0552f1f506a
Author: Ankit Meel
Date:   Fri Oct 29 10:11:04 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rB8e237d83f2138fb94933f971a070a0552f1f506a

Fix T88877: 2.93: Crash on recent OSX with a non-English locale.

Looks like OSX changed the default format of its locale, which is not
valid anymore for gettext/boost::locale.

Solution based on investigations and patch by Kieun Mun (@kieuns), with
some further tweaks by Ankit Meel (@ankitm), many thanks.

Also add an exception catcher on `std::runtime_error` in
`bl_locale_set()`, since in OSX catching the ancestor `std::exception`
does not work with `boost::locale::conv::conversion_error` and the like
for some reasons.

Reviewed By: #platform_macos, brecht

Maniphest Tasks: T88877

Differential Revision: https://developer.blender.org/D13019

===

M   intern/locale/boost_locale_wrapper.cpp
M   intern/locale/osx_user_locale.mm

===

diff --git a/intern/locale/boost_locale_wrapper.cpp 
b/intern/locale/boost_locale_wrapper.cpp
index 73433fe7c5e..ede9377b38f 100644
--- a/intern/locale/boost_locale_wrapper.cpp
+++ b/intern/locale/boost_locale_wrapper.cpp
@@ -117,6 +117,13 @@ void bl_locale_set(const char *locale)
 
 #undef LOCALE_INFO
   }
+  // Extra catch on `std::runtime_error` is needed for macOS/Clang as it seems 
that exceptions
+  // like `boost::locale::conv::conversion_error` (which inherit from 
`std::runtime_error`) are
+  // not caught by their ancestor `std::exception`. See
+  // https://developer.blender.org/T88877#1177108 .
+  catch (std::runtime_error const ) {
+std::cout << "bl_locale_set(" << locale << "): " << e.what() << " \n";
+  }
   catch (std::exception const ) {
 std::cout << "bl_locale_set(" << locale << "): " << e.what() << " \n";
   }
diff --git a/intern/locale/osx_user_locale.mm b/intern/locale/osx_user_locale.mm
index e2f65d39df9..ce694b5fc1e 100644
--- a/intern/locale/osx_user_locale.mm
+++ b/intern/locale/osx_user_locale.mm
@@ -14,7 +14,17 @@ const char *osx_user_locale()
   CFLocaleRef myCFLocale = CFLocaleCopyCurrent();
   NSLocale *myNSLocale = (NSLocale *)myCFLocale;
   [myNSLocale autorelease];
-  NSString *nsIdentifier = [myNSLocale localeIdentifier];
+
+  // This produces gettext-invalid locale in recent macOS versions (11.4),
+  // like `ko-Kore_KR` instead of `ko_KR`. See T88877.
+  // NSString *nsIdentifier = [myNSLocale localeIdentifier];
+
+  const NSString *nsIdentifier = [myNSLocale languageCode];
+  const NSString *const nsIdentifier_country = [myNSLocale countryCode];
+  if ([nsIdentifier length] != 0 && [nsIdentifier_country length] != 0) {
+nsIdentifier = [NSString stringWithFormat:@"%@_%@", nsIdentifier, 
nsIdentifier_country];
+  }
+
   user_locale = ::strdup([nsIdentifier UTF8String]);
   [pool drain];

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [be0d5da341c] blender-v3.0-release: Fix T88877: 2.93: Crash on recent OSX with a non-English locale.

2021-10-29 Thread Ankit Meel
Commit: be0d5da341cf3f33ba2d7cca8c979abf9d94f683
Author: Ankit Meel
Date:   Fri Oct 29 10:11:04 2021 +0200
Branches: blender-v3.0-release
https://developer.blender.org/rBbe0d5da341cf3f33ba2d7cca8c979abf9d94f683

Fix T88877: 2.93: Crash on recent OSX with a non-English locale.

Looks like OSX changed the default format of its locale, which is not
valid anymore for gettext/boost::locale.

Solution based on investigations and patch by Kieun Mun (@kieuns), with
some further tweaks by Ankit Meel (@ankitm), many thanks.

Also add an exception catcher on `std::runtime_error` in
`bl_locale_set()`, since in OSX catching the ancestor `std::exception`
does not work with `boost::locale::conv::conversion_error` and the like
for some reasons.

Reviewed By: #platform_macos, brecht

Maniphest Tasks: T88877

Differential Revision: https://developer.blender.org/D13019

===

M   intern/locale/boost_locale_wrapper.cpp
M   intern/locale/osx_user_locale.mm

===

diff --git a/intern/locale/boost_locale_wrapper.cpp 
b/intern/locale/boost_locale_wrapper.cpp
index 73433fe7c5e..ede9377b38f 100644
--- a/intern/locale/boost_locale_wrapper.cpp
+++ b/intern/locale/boost_locale_wrapper.cpp
@@ -117,6 +117,13 @@ void bl_locale_set(const char *locale)
 
 #undef LOCALE_INFO
   }
+  // Extra catch on `std::runtime_error` is needed for macOS/Clang as it seems 
that exceptions
+  // like `boost::locale::conv::conversion_error` (which inherit from 
`std::runtime_error`) are
+  // not caught by their ancestor `std::exception`. See
+  // https://developer.blender.org/T88877#1177108 .
+  catch (std::runtime_error const ) {
+std::cout << "bl_locale_set(" << locale << "): " << e.what() << " \n";
+  }
   catch (std::exception const ) {
 std::cout << "bl_locale_set(" << locale << "): " << e.what() << " \n";
   }
diff --git a/intern/locale/osx_user_locale.mm b/intern/locale/osx_user_locale.mm
index e2f65d39df9..ce694b5fc1e 100644
--- a/intern/locale/osx_user_locale.mm
+++ b/intern/locale/osx_user_locale.mm
@@ -14,7 +14,17 @@ const char *osx_user_locale()
   CFLocaleRef myCFLocale = CFLocaleCopyCurrent();
   NSLocale *myNSLocale = (NSLocale *)myCFLocale;
   [myNSLocale autorelease];
-  NSString *nsIdentifier = [myNSLocale localeIdentifier];
+
+  // This produces gettext-invalid locale in recent macOS versions (11.4),
+  // like `ko-Kore_KR` instead of `ko_KR`. See T88877.
+  // NSString *nsIdentifier = [myNSLocale localeIdentifier];
+
+  const NSString *nsIdentifier = [myNSLocale languageCode];
+  const NSString *const nsIdentifier_country = [myNSLocale countryCode];
+  if ([nsIdentifier length] != 0 && [nsIdentifier_country length] != 0) {
+nsIdentifier = [NSString stringWithFormat:@"%@_%@", nsIdentifier, 
nsIdentifier_country];
+  }
+
   user_locale = ::strdup([nsIdentifier UTF8String]);
   [pool drain];

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3bcd264141f] master: GitHub: add PR template Differential Revision: https://developer.blender.org/D12890

2021-10-22 Thread Ankit Meel
Commit: 3bcd264141fda53529e9c11f98f9fc28b548b79c
Author: Ankit Meel
Date:   Sat Oct 23 10:49:51 2021 +0530
Branches: master
https://developer.blender.org/rB3bcd264141fda53529e9c11f98f9fc28b548b79c

GitHub: add PR template
Differential Revision: https://developer.blender.org/D12890

===

A   .github/pull_request_template.md

===

diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 000..93a29565e54
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,5 @@
+This repository is only used as a mirror of git.blender.org. Blender 
development happens on
+https://developer.blender.org.
+
+To get started with contributing code, please see:
+https://wiki.blender.org/wiki/Process/Contributing_Code

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5fec6eda551] master: Cleanup: silence Clang missing-braces warning.

2021-10-13 Thread Ankit Meel
Commit: 5fec6eda551470d320dd2ab586e13dcc06de1d2f
Author: Ankit Meel
Date:   Thu Oct 14 10:06:16 2021 +0530
Branches: master
https://developer.blender.org/rB5fec6eda551470d320dd2ab586e13dcc06de1d2f

Cleanup: silence Clang missing-braces warning.

===

M   source/blender/blenlib/intern/uuid.cc

===

diff --git a/source/blender/blenlib/intern/uuid.cc 
b/source/blender/blenlib/intern/uuid.cc
index 3c86238036c..de4602bf3ed 100644
--- a/source/blender/blenlib/intern/uuid.cc
+++ b/source/blender/blenlib/intern/uuid.cc
@@ -83,7 +83,7 @@ bUUID BLI_uuid_generate_random()
 
 bUUID BLI_uuid_nil(void)
 {
-  const bUUID nil = {0, 0, 0, 0, 0, 0};
+  const bUUID nil = {0, 0, 0, 0, 0, {0}};
   return nil;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [30691560fa9] sculpt-dev: Fix C++20 designated initializer build issue.

2021-08-26 Thread Ankit Meel
Commit: 30691560fa90461a78f8229ca064601128b2621a
Author: Ankit Meel
Date:   Thu Aug 26 20:56:13 2021 +0530
Branches: sculpt-dev
https://developer.blender.org/rB30691560fa90461a78f8229ca064601128b2621a

Fix C++20 designated initializer build issue.

===

M   source/blender/blenkernel/intern/mesh_remesh_voxel.cc

===

diff --git a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc 
b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc
index b77f18954b1..9651e2d2f01 100644
--- a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc
+++ b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc
@@ -344,9 +344,8 @@ void BKE_mesh_remesh_sculpt_array_update(Object *ob, Mesh 
*target, Mesh *source)
 return;
   }
 
-  BVHTreeFromMesh bvhtree = {
-  .nearest_callback = NULL,
-  };
+  BVHTreeFromMesh bvhtree = {nullptr};
+  bvhtree.nearest_callback = nullptr;
   BKE_bvhtree_from_mesh_get(, source, BVHTREE_FROM_VERTS, 2);
   MVert *target_verts = (MVert *)CustomData_get_layer(>vdata, 
CD_MVERT);
 
@@ -452,9 +451,8 @@ void BKE_remesh_reproject_sculpt_face_sets(Mesh *target, 
Mesh *source)
 
 void BKE_remesh_reproject_materials(Mesh *target, Mesh *source)
 {
-  BVHTreeFromMesh bvhtree = {
-  .nearest_callback = NULL,
-  };
+  BVHTreeFromMesh bvhtree = {nullptr};
+  bvhtree.nearest_callback = nullptr;
 
   const MPoly *target_polys = (MPoly *)CustomData_get_layer(>pdata, 
CD_MPOLY);
   const MVert *target_verts = (MVert *)CustomData_get_layer(>vdata, 
CD_MVERT);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b4773334732] master: Cleanup: fix comment about compiler support.

2021-08-22 Thread Ankit Meel
Commit: b4773334732350162f02aab6b6154dfc73165f85
Author: Ankit Meel
Date:   Sun Aug 22 22:15:28 2021 +0530
Branches: master
https://developer.blender.org/rBb4773334732350162f02aab6b6154dfc73165f85

Cleanup: fix comment about compiler support.

Differential Revision: https://developer.blender.org/D12288

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a555876d21..47712f0ac1e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1598,8 +1598,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
   ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER 
-Wunused-parameter)
 
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
-  # Designated initializer is a C++20 feature & breaks MSVC build. Dropping 
MSVC 2019 or
-  # updating to C++20 allows removing this.
+  # Using C++20 features while having C++17 as the project language isn't 
allowed by MSVC.
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_CXX20_DESIGNATOR 
-Wc++20-designator)
 
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_AUTOLOGICAL_COMPARE 
-Wno-tautological-compare)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [34a05f39be2] master: Clang: warn about C++20 designated initializers

2021-08-21 Thread Ankit Meel
Commit: 34a05f39be2b79dd1c508c374a47cee6792174f9
Author: Ankit Meel
Date:   Sat Aug 21 14:02:50 2021 +0530
Branches: master
https://developer.blender.org/rB34a05f39be2b79dd1c508c374a47cee6792174f9

Clang: warn about C++20 designated initializers

With the ongoing transition to C++ files, Windows build
breaks often because of designated initializers.
Now we have two compilers to catch the MSVC build error on.

Reviewed By: #platform_macos, brecht, campbellbarton
Differential Revision: https://developer.blender.org/D11940

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2868324bf46..5a555876d21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1598,6 +1598,10 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
   ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER 
-Wunused-parameter)
 
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
+  # Designated initializer is a C++20 feature & breaks MSVC build. Dropping 
MSVC 2019 or
+  # updating to C++20 allows removing this.
+  ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_CXX20_DESIGNATOR 
-Wc++20-designator)
+
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_AUTOLOGICAL_COMPARE 
-Wno-tautological-compare)
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS 
-Wno-unknown-pragmas)
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS 
-Wno-char-subscripts)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [b83ee724a41] master: Fix T90418: macOS codesign fails with dylib next to executable

2021-08-09 Thread Ankit Meel
Commit: b83ee724a418bee98f4e81e0c6854d03bc2e1fa6
Author: Ankit Meel
Date:   Tue Aug 10 10:30:55 2021 +0530
Branches: master
https://developer.blender.org/rBb83ee724a418bee98f4e81e0c6854d03bc2e1fa6

Fix T90418: macOS codesign fails with dylib next to executable

Change the dylib folder relative to `Blender` executable to be
the same as before rB652fbc200500497a67bd11d18b786587ba34e3d9 and same
as bpy.so : `@loader_path/../Resources/${BLENDER_VERSION}/lib`

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a130d265dff..dceafb236de 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,17 +500,10 @@ endif()
 # makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
 # CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
 #
-# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
-# to locate the dylibs at @executable_path, next to the Blender executable.
-#
-# For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
-# dylib in an adjacent folder.
+# For the installed Python module and installed Blender executable, 
CMAKE_INSTALL_RPATH
+# is modified to find the dylib in an adjacent folder. Install step puts the 
libraries there.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
 list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
 
 set(CMAKE_SKIP_INSTALL_RPATH FALSE)
-list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
-
-if(WITH_PYTHON_MODULE)
-  list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
-endif()
+list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index e928be571a2..47fb2642da1 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -345,13 +345,10 @@ elseif(APPLE)
   set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
   set(INSTALL_BPY_TO_SITE_PACKAGES ON)
 endif()
-# Dylibs folder for bpy.so.
-set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   else()
 set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
-# Dylibs folder for Blender executable. @executable_path is an rpath.
-set(MAC_BLENDER_TARGET_DYLIBS_DIR "$")
   endif()
+  set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   # Skip relinking on cpack / install
   set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [888c0e55665] tmp_codesign_T90418: Fix install location

2021-08-09 Thread Ankit Meel
Commit: 888c0e55665a0f96725480ca96ceae14ce84fd53
Author: Ankit Meel
Date:   Tue Aug 10 09:12:18 2021 +0530
Branches: tmp_codesign_T90418
https://developer.blender.org/rB888c0e55665a0f96725480ca96ceae14ce84fd53

Fix install location

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 78de85307cb..a1cef1d61af 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -342,11 +342,11 @@ elseif(APPLE)
   # Keep the `BLENDER_VERSION` folder and bpy.so in the build folder.
   set(INSTALL_BPY_TO_SITE_PACKAGES OFF)
 else()
-  set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
+  set(TARGETDIR_VER 
"${PYTHON_LIBPATH}/site-packages/Resources/${BLENDER_VERSION}")
   set(INSTALL_BPY_TO_SITE_PACKAGES ON)
 endif()
   else()
-set(TARGETDIR_VER 
$/../Resources/${BLENDER_VERSION})
+set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
   endif()
   set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   # Skip relinking on cpack / install

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e40d221b067] tmp_codesign_T90418: Change dylib install location to fix codesign issue

2021-08-09 Thread Ankit Meel
Commit: e40d221b067d0d18f365ff7dcb1fc4df12828f22
Author: Ankit Meel
Date:   Tue Aug 10 08:09:01 2021 +0530
Branches: tmp_codesign_T90418
https://developer.blender.org/rBe40d221b067d0d18f365ff7dcb1fc4df12828f22

Change dylib install location to fix codesign issue

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a130d265dff..1702c9478a2 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,17 +500,13 @@ endif()
 # makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
 # CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
 #
-# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
-# to locate the dylibs at @executable_path, next to the Blender executable.
-#
-# For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
-# dylib in an adjacent folder.
+# For the installed Python module and installed Blender executable, 
CMAKE_INSTALL_RPATH
+# is modified to find the dylib in an adjacent folder. Install step puts the 
libraries there.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
-list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+if(WITH_OPENMP)
+  list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+endif()
 
 set(CMAKE_SKIP_INSTALL_RPATH FALSE)
-list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
 
-if(WITH_PYTHON_MODULE)
-  list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
-endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index e928be571a2..78de85307cb 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -345,13 +345,10 @@ elseif(APPLE)
   set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
   set(INSTALL_BPY_TO_SITE_PACKAGES ON)
 endif()
-# Dylibs folder for bpy.so.
-set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   else()
-set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
-# Dylibs folder for Blender executable. @executable_path is an rpath.
-set(MAC_BLENDER_TARGET_DYLIBS_DIR "$")
+set(TARGETDIR_VER 
$/../Resources/${BLENDER_VERSION})
   endif()
+  set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   # Skip relinking on cpack / install
   set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [450593ddf09] master: Cleanup: Fix Clang braced-scalar-init warning

2021-08-04 Thread Ankit Meel
Commit: 450593ddf0959681b05686368b80963840f297d0
Author: Ankit Meel
Date:   Thu Aug 5 11:00:56 2021 +0530
Branches: master
https://developer.blender.org/rB450593ddf0959681b05686368b80963840f297d0

Cleanup: Fix Clang braced-scalar-init warning

===

M   source/blender/blenkernel/intern/mesh_remesh_voxel.cc

===

diff --git a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc 
b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc
index 63b0403dcea..9f5703a015d 100644
--- a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc
+++ b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc
@@ -292,7 +292,7 @@ Mesh *BKE_mesh_remesh_voxel(const Mesh *mesh,
 
 void BKE_mesh_remesh_reproject_paint_mask(Mesh *target, Mesh *source)
 {
-  BVHTreeFromMesh bvhtree = {{nullptr}};
+  BVHTreeFromMesh bvhtree = {nullptr};
   BKE_bvhtree_from_mesh_get(, source, BVHTREE_FROM_VERTS, 2);
   MVert *target_verts = (MVert *)CustomData_get_layer(>vdata, 
CD_MVERT);
 
@@ -330,7 +330,7 @@ void BKE_mesh_remesh_reproject_paint_mask(Mesh *target, 
Mesh *source)
 
 void BKE_remesh_reproject_sculpt_face_sets(Mesh *target, Mesh *source)
 {
-  BVHTreeFromMesh bvhtree = {{nullptr}};
+  BVHTreeFromMesh bvhtree = {nullptr};
 
   const MPoly *target_polys = (const MPoly 
*)CustomData_get_layer(>pdata, CD_MPOLY);
   const MVert *target_verts = (const MVert 
*)CustomData_get_layer(>vdata, CD_MVERT);
@@ -377,7 +377,7 @@ void BKE_remesh_reproject_sculpt_face_sets(Mesh *target, 
Mesh *source)
 
 void BKE_remesh_reproject_vertex_paint(Mesh *target, const Mesh *source)
 {
-  BVHTreeFromMesh bvhtree = {{nullptr}};
+  BVHTreeFromMesh bvhtree = {nullptr};
   BKE_bvhtree_from_mesh_get(, source, BVHTREE_FROM_VERTS, 2);
 
   int tot_color_layer = CustomData_number_of_layers(>vdata, 
CD_PROP_COLOR);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3985822f48d] tmp_openmpfix: Change rpath to `@loader_path/../Resources/${BLENDER_VERSION}/lib`

2021-08-03 Thread Ankit Meel
Commit: 3985822f48d3c48f5bc9ddfa1bedf620f8df4895
Author: Ankit Meel
Date:   Wed Aug 4 10:00:28 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB3985822f48d3c48f5bc9ddfa1bedf620f8df4895

Change rpath to `@loader_path/../Resources/${BLENDER_VERSION}/lib`

Check if that fixes the codesign error.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a130d265dff..422886b5551 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -509,8 +509,5 @@ set(CMAKE_SKIP_BUILD_RPATH FALSE)
 list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
 
 set(CMAKE_SKIP_INSTALL_RPATH FALSE)
-list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
 
-if(WITH_PYTHON_MODULE)
-  list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
-endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 345ee75e6da..b3da63ff72c 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -345,13 +345,10 @@ elseif(APPLE)
   set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
   set(INSTALL_BPY_TO_SITE_PACKAGES ON)
 endif()
-# Dylibs folder for bpy.so.
-set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   else()
 set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
-# Dylibs folder for Blender executable. @executable_path is an rpath.
-set(MAC_BLENDER_TARGET_DYLIBS_DIR "$")
   endif()
+  set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   # Skip relinking on cpack / install
   set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0a619b0c59c] tmp_openmpfix: Merge branch 'master' into tmp_openmpfix

2021-08-03 Thread Ankit Meel
Commit: 0a619b0c59ceb74238e30dfc6e3338f23e370aba
Author: Ankit Meel
Date:   Wed Aug 4 03:04:45 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB0a619b0c59ceb74238e30dfc6e3338f23e370aba

Merge branch 'master' into tmp_openmpfix

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4088d7f6b67] tmp_openmpfix: Comment logging

2021-08-03 Thread Ankit Meel
Commit: 4088d7f6b6711c26310ae389daaf01f6a43518fb
Author: Ankit Meel
Date:   Wed Aug 4 03:05:48 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB4088d7f6b6711c26310ae389daaf01f6a43518fb

Comment logging

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 936d58dc085..345ee75e6da 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1056,8 +1056,8 @@ elseif(APPLE)
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
-  install(CODE "execute_process(COMMAND ls 
\"${MAC_BLENDER_TARGET_DYLIBS_DIR}\")")
-  install(CODE "execute_process(COMMAND otool -l \"$\")")
+  # install(CODE "execute_process(COMMAND ls 
\"${MAC_BLENDER_TARGET_DYLIBS_DIR}\")")
+  # install(CODE "execute_process(COMMAND otool -l 
\"$\")")
 
   # python
   if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f43ede3b9da] tmp_openmpfix: Test if double slash is problematic.

2021-08-03 Thread Ankit Meel
Commit: f43ede3b9da7fdba33a624aca4d615214762d9f3
Author: Ankit Meel
Date:   Wed Aug 4 02:00:08 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBf43ede3b9da7fdba33a624aca4d615214762d9f3

Test if double slash is problematic.

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index c18b2225f97..1a185a4dba1 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -411,7 +411,7 @@ if(WITH_OPENMP)
 set(OPENMP_FOUND ON)
 set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
 set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
-set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib")
+set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
 set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
 set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
   endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [68ae8f70c82] tmp_openmpfix: List contents of MacOS folder, and get otool output.

2021-08-03 Thread Ankit Meel
Commit: 68ae8f70c82c9651f9a7dda680dda737dcaaf3fa
Author: Ankit Meel
Date:   Wed Aug 4 00:37:09 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB68ae8f70c82c9651f9a7dda680dda737dcaaf3fa

List contents of MacOS folder, and get otool output.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 93b45f09a31..c18b2225f97 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -507,7 +507,7 @@ endif()
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
 if(WITH_OPENMP)
-  list(APPEND CMAKE_BUILD_RPATH   "${OpenMP_LIBRARY_DIR}")
+  list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
 endif()
 
 set(CMAKE_SKIP_INSTALL_RPATH FALSE)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 23a747be521..a07b038e24b 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1044,9 +1044,6 @@ elseif(APPLE)
 Blender.app/Contents/
   )
 
-  message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
-  message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
-  message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
 install(
   FILES "${OpenMP_LIBRARY}"
@@ -1060,6 +1057,8 @@ elseif(APPLE)
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
+  install(CODE "execute_process(COMMAND ls 
\"${MAC_BLENDER_TARGET_DYLIBS_DIR}\")")
+  install(CODE "execute_process(COMMAND otool -l \"$\")")
 
   # python
   if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c63393e58ce] tmp_openmpfix: macOS: Fix for dylib loader issues.

2021-08-03 Thread Ankit Meel
Commit: c63393e58ce4e4b6bd2d574bff24fffacb349a2c
Author: Ankit Meel
Date:   Tue Aug 3 22:25:11 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBc63393e58ce4e4b6bd2d574bff24fffacb349a2c

macOS: Fix for dylib loader issues.

Also some logging for buildbot

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 529c01db009..a85e9f23277 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,14 +500,19 @@ endif()
 # makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
 # CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
 #
-# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used, but
-# needs no changes since it already looks for dylibs next to the executable by
-# default (@executable_path).
+# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
+# to locate the dylibs at @executable_path, next to the Blender executable.
 #
 # For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
-list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+if(WITH_OPENMP)
+  list(APPEND CMAKE_BUILD_RPATH   "${OpenMP_LIBRARY_DIR}")
+endif()
+
+set(CMAKE_SKIP_INSTALL_RPATH FALSE)
+list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+
 if(WITH_PYTHON_MODULE)
   list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
 endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index f7179dfb7e9..52e9e449642 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1044,12 +1044,16 @@ elseif(APPLE)
 Blender.app/Contents/
   )
 
+  message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
+message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
+message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
 install(
   FILES "${OpenMP_LIBRARY}"
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
+  message(FATAL_ERROR "")
 
   if(WITH_COMPILER_ASAN)
 install(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a446092beeb] tmp_openmpfix: Remove fatal error, extra slash.

2021-08-03 Thread Ankit Meel
Commit: a446092beeb53fe1f03513be4b1da04d976bd600
Author: Ankit Meel
Date:   Tue Aug 3 23:36:59 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBa446092beeb53fe1f03513be4b1da04d976bd600

Remove fatal error, extra slash.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a85e9f23277..93b45f09a31 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -411,7 +411,7 @@ if(WITH_OPENMP)
 set(OPENMP_FOUND ON)
 set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
 set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
-set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
+set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib")
 set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
 set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
   endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 52e9e449642..23a747be521 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1045,15 +1045,14 @@ elseif(APPLE)
   )
 
   message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
+  message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
+  message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
-message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
-message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
 install(
   FILES "${OpenMP_LIBRARY}"
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
-  message(FATAL_ERROR "")
 
   if(WITH_COMPILER_ASAN)
 install(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [18d900caca8] master: macOS: Fix OpenMP dynamic loader error.

2021-08-03 Thread Ankit Meel
Commit: 18d900caca8317d33216bbc778c07b9f6ce3da84
Author: Ankit Meel
Date:   Wed Aug 4 01:22:27 2021 +0530
Branches: master
https://developer.blender.org/rB18d900caca8317d33216bbc778c07b9f6ce3da84

macOS: Fix OpenMP dynamic loader error.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 529c01db009..a130d265dff 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,14 +500,17 @@ endif()
 # makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
 # CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
 #
-# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used, but
-# needs no changes since it already looks for dylibs next to the executable by
-# default (@executable_path).
+# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
+# to locate the dylibs at @executable_path, next to the Blender executable.
 #
 # For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
 list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+
+set(CMAKE_SKIP_INSTALL_RPATH FALSE)
+list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+
 if(WITH_PYTHON_MODULE)
   list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
 endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index f7179dfb7e9..e928be571a2 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -349,8 +349,7 @@ elseif(APPLE)
 set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   else()
 set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
-# Dylibs folder for Blender executable. @executable_path is a default
-# rpath, so dropping libraries next to Blender is enough.
+# Dylibs folder for Blender executable. @executable_path is an rpath.
 set(MAC_BLENDER_TARGET_DYLIBS_DIR "$")
   endif()
   # Skip relinking on cpack / install

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [68ae8f70c82] tmp_openmpfix: List contents of MacOS folder, and get otool output.

2021-08-03 Thread Ankit Meel
Commit: 68ae8f70c82c9651f9a7dda680dda737dcaaf3fa
Author: Ankit Meel
Date:   Wed Aug 4 00:37:09 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rB68ae8f70c82c9651f9a7dda680dda737dcaaf3fa

List contents of MacOS folder, and get otool output.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 93b45f09a31..c18b2225f97 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -507,7 +507,7 @@ endif()
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
 if(WITH_OPENMP)
-  list(APPEND CMAKE_BUILD_RPATH   "${OpenMP_LIBRARY_DIR}")
+  list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
 endif()
 
 set(CMAKE_SKIP_INSTALL_RPATH FALSE)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 23a747be521..a07b038e24b 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1044,9 +1044,6 @@ elseif(APPLE)
 Blender.app/Contents/
   )
 
-  message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
-  message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
-  message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
 install(
   FILES "${OpenMP_LIBRARY}"
@@ -1060,6 +1057,8 @@ elseif(APPLE)
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
+  install(CODE "execute_process(COMMAND ls 
\"${MAC_BLENDER_TARGET_DYLIBS_DIR}\")")
+  install(CODE "execute_process(COMMAND otool -l \"$\")")
 
   # python
   if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a446092beeb] tmp_openmpfix: Remove fatal error, extra slash.

2021-08-03 Thread Ankit Meel
Commit: a446092beeb53fe1f03513be4b1da04d976bd600
Author: Ankit Meel
Date:   Tue Aug 3 23:36:59 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBa446092beeb53fe1f03513be4b1da04d976bd600

Remove fatal error, extra slash.

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a85e9f23277..93b45f09a31 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -411,7 +411,7 @@ if(WITH_OPENMP)
 set(OPENMP_FOUND ON)
 set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
 set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
-set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
+set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib")
 set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
 set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
   endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 52e9e449642..23a747be521 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1045,15 +1045,14 @@ elseif(APPLE)
   )
 
   message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
+  message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
+  message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
-message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
-message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
 install(
   FILES "${OpenMP_LIBRARY}"
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
-  message(FATAL_ERROR "")
 
   if(WITH_COMPILER_ASAN)
 install(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c63393e58ce] tmp_openmpfix: macOS: Fix for dylib loader issues.

2021-08-03 Thread Ankit Meel
Commit: c63393e58ce4e4b6bd2d574bff24fffacb349a2c
Author: Ankit Meel
Date:   Tue Aug 3 22:25:11 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBc63393e58ce4e4b6bd2d574bff24fffacb349a2c

macOS: Fix for dylib loader issues.

Also some logging for buildbot

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 529c01db009..a85e9f23277 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,14 +500,19 @@ endif()
 # makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
 # CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
 #
-# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used, but
-# needs no changes since it already looks for dylibs next to the executable by
-# default (@executable_path).
+# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
+# to locate the dylibs at @executable_path, next to the Blender executable.
 #
 # For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
-list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+if(WITH_OPENMP)
+  list(APPEND CMAKE_BUILD_RPATH   "${OpenMP_LIBRARY_DIR}")
+endif()
+
+set(CMAKE_SKIP_INSTALL_RPATH FALSE)
+list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+
 if(WITH_PYTHON_MODULE)
   list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
 endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index f7179dfb7e9..52e9e449642 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1044,12 +1044,16 @@ elseif(APPLE)
 Blender.app/Contents/
   )
 
+  message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
+message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
+message(WARNING 
"MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
 install(
   FILES "${OpenMP_LIBRARY}"
   DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
 )
   endif()
+  message(FATAL_ERROR "")
 
   if(WITH_COMPILER_ASAN)
 install(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [652fbc20050] master: macOS: Portable builds with dynamic libraries.

2021-08-03 Thread Ankit Meel
Commit: 652fbc200500497a67bd11d18b786587ba34e3d9
Author: Ankit Meel
Date:   Tue Aug 3 20:49:40 2021 +0530
Branches: master
https://developer.blender.org/rB652fbc200500497a67bd11d18b786587ba34e3d9

macOS: Portable builds with dynamic libraries.

For Blender.app: dropping libomp.dylib next to Blender executable is
enough for it getting picked up since `@executable_path` is an rpath.

For non-distributed binaries datatoc, makesdna, tests etc, code for
copying libomp.dylib to build folder is removed and replaced by
CMake's rpath option for *build* tree.

For bpy.so, the post build rpath change has also been replaced by CMake
rpath option for *install* tree.

Since -id has been changed in D11748, remove the
`install_name_tool -change ...` command.

Any dylib can just be dropped at `MAC_BLENDER_TARGET_DYLIBS_DIR`
hereafter. Appending dylib path to `CMAKE_BUILD_RPATH` will be needed
for datatoc etc if linked against one (instead of copying the
dylibs around).

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D11997

===

M   CMakeLists.txt
M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6c6408bee2c..b7dfb56ff02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,6 +110,10 @@ if(POLICY CMP0074)
   cmake_policy(SET CMP0074 NEW)
 endif()
 
+# Install CODE|SCRIPT allow the use of generator expressions.
+if(POLICY CMP0087)
+  cmake_policy(SET CMP0087 NEW)
+endif()
 #-
 # Load some macros.
 include(build_files/cmake/macros.cmake)
diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 70973eeda99..529c01db009 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -411,25 +411,9 @@ if(WITH_OPENMP)
 set(OPENMP_FOUND ON)
 set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
 set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
-set(OpenMP_LINKER_FLAGS "-L'${LIBDIR}/openmp/lib' -lomp")
-
-# Copy libomp.dylib to allow executables like datatoc and tests to work.
-# `@executable_path/../Resources/lib/` `LC_ID_DYLIB` is added by the deps 
builder.
-# For single config generator datatoc, tests etc.
-execute_process(
-  COMMAND mkdir -p ${CMAKE_BINARY_DIR}/Resources/lib
-  COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib 
${CMAKE_BINARY_DIR}/Resources/lib/libomp.dylib
-)
-# For multi-config generator datatoc, etc.
-execute_process(
-  COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/Resources/lib
-  COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib 
${CMAKE_BINARY_DIR}/bin/Resources/lib/libomp.dylib
-)
-# For multi-config generator tests.
-execute_process(
-  COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/tests/Resources/lib
-  COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib 
${CMAKE_BINARY_DIR}/bin/tests/Resources/lib/libomp.dylib
-)
+set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
+set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
+set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
   endif()
 endif()
 
@@ -511,3 +495,19 @@ if(WITH_COMPILER_CCACHE)
 endif()
   endif()
 endif()
+
+# For binaries that are built but not installed (also not distributed) 
(datatoc,
+# makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
+# CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next 
to each binary.
+#
+# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used, but
+# needs no changes since it already looks for dylibs next to the executable by
+# default (@executable_path).
+#
+# For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
+# dylib in an adjacent folder.
+set(CMAKE_SKIP_BUILD_RPATH FALSE)
+list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+if(WITH_PYTHON_MODULE)
+  list(APPEND CMAKE_INSTALL_RPATH 
"@loader_path/../Resources/${BLENDER_VERSION}/lib")
+endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index c3aeffe8fda..f7179dfb7e9 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -345,8 +345,13 @@ elseif(APPLE)
   set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
   set(INSTALL_BPY_TO_SITE_PACKAGES ON)
 endif()
+# Dylibs folder for bpy.so.
+set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
   else()
 set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
+# Dylibs folder for Blender executable. @

[Bf-blender-cvs] [a9121640be0] master: macOS Cleanup: Remove old version specific code

2021-07-26 Thread Ankit Meel
Commit: a9121640be063b8c45a021782a1914a3060bf71e
Author: Ankit Meel
Date:   Mon Jul 26 18:39:08 2021 +0530
Branches: master
https://developer.blender.org/rBa9121640be063b8c45a021782a1914a3060bf71e

macOS Cleanup: Remove old version specific code

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D12021

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 90188751fc0..70973eeda99 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -404,7 +404,7 @@ endif()
 
 # CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide 
custom flags.
 if(WITH_OPENMP)
-  if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_VERSION 
VERSION_GREATER_EQUAL "7.0")
+  if(CMAKE_C_COMPILER_ID MATCHES "Clang")
 # Use OpenMP from our precompiled libraries.
 message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
 set(OPENMP_CUSTOM ON)
@@ -480,10 +480,8 @@ else()
   set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic")
 endif()
 
-if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
-  # Xcode 5 is always using CLANG, which has too low template depth of 128 for 
libmv
-  string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
-endif()
+# Clang has too low template depth of 128 for libmv.
+string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
 
 # Avoid conflicts with Luxrender, and other plug-ins that may use the same
 # libraries as Blender with a different version or build options.
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index a4b32fac9fc..c3aeffe8fda 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1060,13 +1060,6 @@ elseif(APPLE)
 endif()
   endif()
 
-  if(WITH_LLVM AND NOT LLVM_STATIC)
-install(
-  FILES ${LIBDIR}/llvm/lib/libLLVM-3.4.dylib
-  DESTINATION Blender.app/Contents/MacOS
-)
-  endif()
-
   # python
   if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
 # Copy the python libs into the install directory

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [41d31be6377] blender-v2.83-release: macOS: use -fno-strict-aliasing for all build types.

2021-07-26 Thread Ankit Meel
Commit: 41d31be6377217cdc586d4c330c30df3496b8faf
Author: Ankit Meel
Date:   Wed Oct 28 20:52:51 2020 +0530
Branches: blender-v2.83-release
https://developer.blender.org/rB41d31be6377217cdc586d4c330c30df3496b8faf

macOS: use -fno-strict-aliasing for all build types.

The old code was added in {rBbaa4a9c7d4dd}

While the hotfix committed in {rB2ddecfffc3d3a3a1db4ae45e8665ca} fixed
the id_management test, the correct reason was found at
https://bugs.llvm.org/show_bug.cgi?id=47984

This matches the behavior on Linux.

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 47e5b807be5..003c07e7b23 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -186,7 +186,7 @@ if(SYSTEMSTUBS_LIBRARY)
   list(APPEND PLATFORM_LINKLIBS SystemStubs)
 endif()
 
-set(PLATFORM_CFLAGS "-pipe -funsigned-char")
+set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
 set(PLATFORM_LINKFLAGS
   "-fexceptions -framework CoreServices -framework Foundation -framework IOKit 
-framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit 
-framework AudioToolbox -framework CoreAudio -framework Metal -framework 
QuartzCore"
 )
@@ -430,8 +430,8 @@ endif()
 
 set(EXETYPE MACOSX_BUNDLE)
 
-set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
-set(CMAKE_CXX_FLAGS_DEBUG "-fno-strict-aliasing -g")
+set(CMAKE_C_FLAGS_DEBUG "-g")
+set(CMAKE_CXX_FLAGS_DEBUG "-g")
 if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES 
"i386")
   set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic -msse -msse2 -msse3 
-mssse3")
   set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic  -msse -msse2 -msse3 
-mssse3")
@@ -440,8 +440,13 @@ if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR 
CMAKE_OSX_ARCHITECTURES MATCHES "
 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ftree-vectorize  
-fvariable-expansion-in-unroller")
   endif()
 else()
+<<<<<<< HEAD
   set(CMAKE_C_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
   set(CMAKE_CXX_FLAGS_RELEASE "-mdynamic-no-pic -fno-strict-aliasing")
+===
+  set(CMAKE_C_FLAGS_RELEASE "-O2 -mdynamic-no-pic")
+  set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic")
+>>>>>>> fc6a1f44d2e (macOS: use -fno-strict-aliasing for all build types.)
 endif()
 
 if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f53ca7e41c2] master: Cleanup: Fix missing braces warning on Clang

2021-07-20 Thread Ankit Meel
Commit: f53ca7e41c2c4413af5eced1a83d1ee54c19
Author: Ankit Meel
Date:   Tue Jul 20 21:03:47 2021 +0530
Branches: master
https://developer.blender.org/rBf53ca7e41c2c4413af5eced1a83d1ee54c19

Cleanup: Fix missing braces warning on Clang

===

M   source/blender/editors/interface/interface_template_list.cc

===

diff --git a/source/blender/editors/interface/interface_template_list.cc 
b/source/blender/editors/interface/interface_template_list.cc
index eaab33e32c9..4a500962478 100644
--- a/source/blender/editors/interface/interface_template_list.cc
+++ b/source/blender/editors/interface/interface_template_list.cc
@@ -1170,7 +1170,7 @@ uiList *uiTemplateList_ex(uiLayout *layout,
   enum uiTemplateListFlags flags,
   void *customdata)
 {
-  TemplateListInputData input_data = {nullptr};
+  TemplateListInputData input_data = {{nullptr}};
   uiListType *ui_list_type;
   if (!ui_template_list_data_retrieve(listtype_name,
   list_id,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [49b798ca7e1] master: macOS/glog: Silence syscall deprecation warning

2021-07-15 Thread Ankit Meel
Commit: 49b798ca7e1d1499f855166e904f8885181cadcf
Author: Ankit Meel
Date:   Thu Jul 15 15:23:06 2021 +0530
Branches: master
https://developer.blender.org/rB49b798ca7e1d1499f855166e904f8885181cadcf

macOS/glog: Silence syscall deprecation warning

Upstream will release the fix in 0.6 which will take time.
Silence two warnings.

Differential Revision: https://developer.blender.org/D11246

===

M   extern/glog/README.blender
M   extern/glog/src/raw_logging.cc
M   extern/glog/src/utilities.cc

===

diff --git a/extern/glog/README.blender b/extern/glog/README.blender
index 5b4dab199bf..bc2ca9f958e 100644
--- a/extern/glog/README.blender
+++ b/extern/glog/README.blender
@@ -7,3 +7,4 @@ Local modifications:
   checks for functions and so are needed.
 * Added special definitions of HAVE_SNPRINTF and HAVE_LIB_GFLAGS
   in Windows' specific config.h.
+* Silenced syscall deprecation warnings on macOS >= 10.12.
diff --git a/extern/glog/src/raw_logging.cc b/extern/glog/src/raw_logging.cc
index 3bbfda31868..15d14f6e4f5 100644
--- a/extern/glog/src/raw_logging.cc
+++ b/extern/glog/src/raw_logging.cc
@@ -59,7 +59,7 @@
 # include 
 #endif
 
-#if defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)
+#if (defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)) && (!(defined 
OS_MACOSX))
 # define safe_write(fd, s, len)  syscall(SYS_write, fd, s, len)
 #else
   // Not so safe, but what can you do?
diff --git a/extern/glog/src/utilities.cc b/extern/glog/src/utilities.cc
index 25c4b760f1c..6387e14e123 100644
--- a/extern/glog/src/utilities.cc
+++ b/extern/glog/src/utilities.cc
@@ -259,7 +259,13 @@ pid_t GetTID() {
 #endif
   static bool lacks_gettid = false;
   if (!lacks_gettid) {
+#ifdef OS_MACOSX
+uint64_t tid64;
+const int error = pthread_threadid_np(NULL, );
+pid_t tid = error ? -1 : (pid_t)tid64;
+#else
 pid_t tid = syscall(__NR_gettid);
+#endif
 if (tid != -1) {
   return tid;
 }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [40027f31b35] soc-2020-io-performance: Consistent var naming, function usage.

2021-07-10 Thread Ankit Meel
Commit: 40027f31b3508848d9c9c9a1d048344901d95906
Author: Ankit Meel
Date:   Sat Jul 10 19:08:45 2021 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB40027f31b3508848d9c9c9a1d048344901d95906

Consistent var naming, function usage.

===

M   source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
M   source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
M   source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh

===

diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc 
b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
index 2895c3fb647..b1cacfb2026 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
@@ -356,11 +356,9 @@ void OBJWriter::write_poly_elements(const OBJMesh 
_mesh_data,
   /* Number of normals may not be equal to number of polygons due to smooth 
shading. */
   int per_object_tot_normals = 0;
   const int tot_polygons = obj_mesh_data.tot_polygons();
-  /* If we aren't exporting UVs, need an array for the ignored argument to 
poly_element_writer. */
-  Array dummy_uvs(0);
-  Span uvs = dummy_uvs.as_span();
   for (int i = 0; i < tot_polygons; i++) {
 Vector poly_vertex_indices = 
obj_mesh_data.calc_poly_vertex_indices(i);
+Span poly_uv_indices = obj_mesh_data.calc_poly_uv_indices(i);
 /* For an Object, a normal index depends on how many of its normals have 
been written before
  * it. This is unknown because of smooth shading. So pass "per object 
total normals"
  * and update it after each call. */
@@ -373,10 +371,7 @@ void OBJWriter::write_poly_elements(const OBJMesh 
_mesh_data,
 last_poly_smooth_group = write_smooth_group(obj_mesh_data, i, 
last_poly_smooth_group);
 last_poly_vertex_group = write_vertex_group(obj_mesh_data, i, 
last_poly_vertex_group);
 last_poly_mat_nr = write_poly_material(obj_mesh_data, i, last_poly_mat_nr, 
matname_fn);
-if (export_params_.export_uv) {
-  uvs = obj_mesh_data.uv_indices(i);
-}
-(this->*poly_element_writer)(poly_vertex_indices, uvs, 
poly_normal_indices);
+(this->*poly_element_writer)(poly_vertex_indices, poly_uv_indices, 
poly_normal_indices);
   }
   /* Unusual: Other indices are updated in #OBJWriter::update_index_offsets. */
   index_offsets_.normal_offset += per_object_tot_normals;
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc 
b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
index d4b017bcece..7b7c5a7c4f1 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
@@ -154,16 +154,6 @@ int OBJMesh::tot_uv_vertices() const
   return tot_uv_vertices_;
 }
 
-/**
- * \return UV vertex indices of one polygon.
- */
-Span OBJMesh::uv_indices(const int poly_index) const
-{
-  BLI_assert(poly_index < export_mesh_eval_->totpoly);
-  BLI_assert(poly_index < uv_indices_.size());
-  return uv_indices_[poly_index];
-}
-
 int OBJMesh::tot_edges() const
 {
   return export_mesh_eval_->totedge;
@@ -354,6 +344,15 @@ void 
OBJMesh::store_uv_coords_and_indices(Vector> _uv_coo
   BKE_mesh_uv_vert_map_free(uv_vert_map);
 }
 
+Span OBJMesh::calc_poly_uv_indices(const int poly_index) const
+{
+  if (uv_indices_.size() <= 0) {
+return {};
+  }
+  BLI_assert(poly_index < export_mesh_eval_->totpoly);
+  BLI_assert(poly_index < uv_indices_.size());
+  return uv_indices_[poly_index];
+}
 /**
  * Calculate polygon normal of a polygon at given index.
  *
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh 
b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh
index f73a114659d..6e6cf6383a9 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.hh
@@ -96,7 +96,6 @@ class OBJMesh : NonCopyable {
   int tot_vertices() const;
   int tot_polygons() const;
   int tot_uv_vertices() const;
-  Span uv_indices(const int poly_index) const;
   int tot_edges() const;
 
   int16_t tot_materials() const;
@@ -117,6 +116,7 @@ class OBJMesh : NonCopyable {
   float3 calc_vertex_coords(const int vert_index, const float scaling_factor) 
const;
   Vector calc_poly_vertex_indices(const int poly_index) const;
   void store_uv_coords_and_indices(Vector> _uv_coords);
+  Span calc_poly_uv_indices(const int poly_index) const;
   float3 calc_poly_normal(const int poly_index) const;
   std::pair> calc_poly_normal_indices(const int poly_index,
const int 
object_tot_prev_normals) const;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List

[Bf-blender-cvs] [2cb056af9a5] soc-2020-io-performance: Merge branch 'master' into soc-2020-io-performance

2021-07-10 Thread Ankit Meel
Commit: 2cb056af9a51575f8e21df27891a2e7106f85151
Author: Ankit Meel
Date:   Sat Jul 10 19:04:19 2021 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB2cb056af9a51575f8e21df27891a2e7106f85151

Merge branch 'master' into soc-2020-io-performance

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1af722b8191] master: Deps builder: macOS/ ffmpeg: Fix linker warning

2021-07-06 Thread Ankit Meel
Commit: 1af722b819120312ac0e709635032005a31bcc28
Author: Ankit Meel
Date:   Tue Jul 6 21:13:31 2021 +0530
Branches: master
https://developer.blender.org/rB1af722b819120312ac0e709635032005a31bcc28

Deps builder: macOS/ ffmpeg: Fix linker warning

ld: warning: could not create compact unwind for _ff_rl_init_vlc: stack
subq instruction is too different from dwarf stack size
Similar to rB2de5de57c58521862e0fecc95fc474ea347b7468

Differential Revision: https://developer.blender.org/D11796

===

M   build_files/build_environment/patches/ffmpeg.diff

===

diff --git a/build_files/build_environment/patches/ffmpeg.diff 
b/build_files/build_environment/patches/ffmpeg.diff
index e195ca272de..5a50a3f8756 100644
--- a/build_files/build_environment/patches/ffmpeg.diff
+++ b/build_files/build_environment/patches/ffmpeg.diff
@@ -68,3 +68,32 @@
 +
  return ret;
  }
+--- a/libavcodec/rl.c
 b/libavcodec/rl.c
+@@ -71,7 +71,7 @@ av_cold void ff_rl_init(RLTable *rl,
+ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
+ {
+ int i, q;
+-VLC_TYPE table[1500][2] = {{0}};
++VLC_TYPE (*table)[2] = av_calloc(sizeof(VLC_TYPE), 1500 * 2);
+ VLC vlc = { .table = table, .table_allocated = static_size };
+ av_assert0(static_size <= FF_ARRAY_ELEMS(table));
+ init_vlc(, 9, rl->n + 1, >table_vlc[0][1], 4, 2, 
>table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
+@@ -80,8 +80,10 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned 
static_size)
+ int qmul = q * 2;
+ int qadd = (q - 1) | 1;
+ 
+-if (!rl->rl_vlc[q])
++if (!rl->rl_vlc[q]){
++av_free(table);
+ return;
++}
+ 
+ if (q == 0) {
+ qmul = 1;
+@@ -113,4 +115,5 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned 
static_size)
+ rl->rl_vlc[q][i].run   = run;
+ }
+ }
++av_free(table);
+ }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6bab2edec25] tmp_T72605: Explicitly remove write for o and g.

2021-07-01 Thread Ankit Meel
Commit: 6bab2edec2553b4bef13a6633651a1c11e77e4b2
Author: Ankit Meel
Date:   Thu Jul 1 15:20:04 2021 +0530
Branches: tmp_T72605
https://developer.blender.org/rB6bab2edec2553b4bef13a6633651a1c11e77e4b2

Explicitly remove write for o and g.

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 7005b6aed75..204858d9edc 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1242,7 +1242,7 @@ endif()
 # Post-install script
 
 if(APPLE)
-  install(CODE "execute_process(COMMAND chmod -R a+rX,u+w 
\"$\")")
+  install(CODE "execute_process(COMMAND chmod -R a+rX,u+w,og-w 
\"$\")")
 endif()
 
 if(POSTINSTALL_SCRIPT)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a4e9f322fae] tmp_T72605: Fix path error

2021-06-30 Thread Ankit Meel
Commit: a4e9f322faef6cb4c6e76892f3406516f34bb85f
Author: Ankit Meel
Date:   Wed Jun 30 14:28:11 2021 +0530
Branches: tmp_T72605
https://developer.blender.org/rBa4e9f322faef6cb4c6e76892f3406516f34bb85f

Fix path error

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index eb8dbef5e71..7005b6aed75 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1242,7 +1242,7 @@ endif()
 # Post-install script
 
 if(APPLE)
-  install(CODE "execute_process(COMMAND chmod -R a+X,a+r,u+w 
'$')")
+  install(CODE "execute_process(COMMAND chmod -R a+rX,u+w 
\"$\")")
 endif()
 
 if(POSTINSTALL_SCRIPT)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [34a9d0e0670] tmp_T72605: Handle all files, directories and executables.

2021-06-30 Thread Ankit Meel
Commit: 34a9d0e06703c85c61935ee105cf441e622f0624
Author: Ankit Meel
Date:   Wed Jun 30 14:28:11 2021 +0530
Branches: tmp_T72605
https://developer.blender.org/rB34a9d0e06703c85c61935ee105cf441e622f0624

Handle all files, directories and executables.

===

M   CMakeLists.txt
M   source/creator/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 297e32bd67e..0dfe91ba84e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,6 +110,11 @@ if(POLICY CMP0074)
   cmake_policy(SET CMP0074 NEW)
 endif()
 
+# The NEW behavior is to evaluate generator expressions for install(CODE) and 
install(SCRIPT).
+if(POLICY CMP0087)
+  cmake_policy(SET CMP0087 NEW)
+endif()
+
 #-
 # Load some macros.
 include(build_files/cmake/macros.cmake)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 361e7bfc65a..eb8dbef5e71 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1020,16 +1020,6 @@ elseif(APPLE)
   endif()
   execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE}
   ${EXECUTABLE_OUTPUT_PATH}/Blender.app)
-  add_custom_command(TARGET blender
-# Ensure that the binary exists.
-POST_BUILD
-# Permissions for all intermediate directories and the Blender binary.
-COMMAND chmod -R a+rx,u+w
-# ${EXECUTABLE_OUTPUT_PATH}/Blender.app is wrong path for Xcode generator.
-"$"
-"$"
-"$/MacOS"
-"$")
 
   install(
 TARGETS blender
@@ -1251,6 +1241,10 @@ endif()
 # -
 # Post-install script
 
+if(APPLE)
+  install(CODE "execute_process(COMMAND chmod -R a+X,a+r,u+w 
'$')")
+endif()
+
 if(POSTINSTALL_SCRIPT)
   install(SCRIPT ${POSTINSTALL_SCRIPT})
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bcca36f4e8f] tmp_T72605: Account for other generators, and intermediate directories.

2021-06-30 Thread Ankit Meel
Commit: bcca36f4e8ff0b2435437293f9724c019c54cb77
Author: Ankit Meel
Date:   Wed Jun 30 11:35:37 2021 +0530
Branches: tmp_T72605
https://developer.blender.org/rBbcca36f4e8ff0b2435437293f9724c019c54cb77

Account for other generators, and intermediate directories.

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index ae634dc50bf..361e7bfc65a 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1020,18 +1020,20 @@ elseif(APPLE)
   endif()
   execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE}
   ${EXECUTABLE_OUTPUT_PATH}/Blender.app)
-  execute_process(COMMAND chmod a+rx,u+w ${EXECUTABLE_OUTPUT_PATH}/Blender.app)
-
-  set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
-OWNER_READGROUP_READWORLD_READ
-OWNER_WRITE
-OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
-  )
+  add_custom_command(TARGET blender
+# Ensure that the binary exists.
+POST_BUILD
+# Permissions for all intermediate directories and the Blender binary.
+COMMAND chmod -R a+rx,u+w
+# ${EXECUTABLE_OUTPUT_PATH}/Blender.app is wrong path for Xcode generator.
+"$"
+"$"
+"$/MacOS"
+"$")
 
   install(
 TARGETS blender
 DESTINATION "."
-PERMISSIONS ${CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS}
   )
 
   # install release and app files

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e5d35a05f68] tmp_T72605: Fix directory permissions.

2021-06-29 Thread Ankit Meel
Commit: e5d35a05f687e66842feab6d2602b8649a93b4ea
Author: Ankit Meel
Date:   Wed Jun 30 09:15:01 2021 +0530
Branches: tmp_T72605
https://developer.blender.org/rBe5d35a05f687e66842feab6d2602b8649a93b4ea

Fix directory permissions.

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 57030757540..ae634dc50bf 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1020,14 +1020,18 @@ elseif(APPLE)
   endif()
   execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE}
   ${EXECUTABLE_OUTPUT_PATH}/Blender.app)
+  execute_process(COMMAND chmod a+rx,u+w ${EXECUTABLE_OUTPUT_PATH}/Blender.app)
+
+  set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
+OWNER_READGROUP_READWORLD_READ
+OWNER_WRITE
+OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
+  )
 
   install(
 TARGETS blender
 DESTINATION "."
-PERMISSIONS
-  OWNER_READGROUP_READWORLD_READ
-  OWNER_WRITE
-  OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
+PERMISSIONS ${CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS}
   )
 
   # install release and app files

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6c7b44e9fd7] tmp_T72605: macOS: execute permission for all users

2021-06-29 Thread Ankit Meel
Commit: 6c7b44e9fd748a3b4d27639c8c408ca92b5a48b2
Author: Ankit Meel
Date:   Tue Jun 29 22:52:49 2021 +0530
Branches: tmp_T72605
https://developer.blender.org/rB6c7b44e9fd748a3b4d27639c8c408ca92b5a48b2

macOS: execute permission for all users

Differential Revision: https://developer.blender.org/D11747

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index a4b32fac9fc..4d9beb8e7d1 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1024,6 +1024,7 @@ elseif(APPLE)
   install(
 TARGETS blender
 DESTINATION "."
+PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
   )
 
   # install release and app files

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d8ef33795cb] tmp_T72605: Set read write bits too

2021-06-29 Thread Ankit Meel
Commit: d8ef33795cbdf6875f7fa683573a37c4972d142a
Author: Ankit Meel
Date:   Wed Jun 30 02:44:16 2021 +0530
Branches: tmp_T72605
https://developer.blender.org/rBd8ef33795cbdf6875f7fa683573a37c4972d142a

Set read write bits too

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 4d9beb8e7d1..57030757540 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1024,7 +1024,10 @@ elseif(APPLE)
   install(
 TARGETS blender
 DESTINATION "."
-PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
+PERMISSIONS
+  OWNER_READGROUP_READWORLD_READ
+  OWNER_WRITE
+  OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
   )
 
   # install release and app files

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [91d3a548696] master: Fix build error, remove duplicate include.

2021-06-07 Thread Ankit Meel
Commit: 91d3a548696753ef1b664acbeab1dba9cc7ab1af
Author: Ankit Meel
Date:   Mon Jun 7 19:11:36 2021 +0530
Branches: master
https://developer.blender.org/rB91d3a548696753ef1b664acbeab1dba9cc7ab1af

Fix build error, remove duplicate include.

===

M   source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c 
b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 39f4f04206c..59ac809eb4f 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -52,7 +52,7 @@
 #include "DNA_scene_types.h"
 #include "MEM_guardedalloc.h"
 
-#include "BLI_math.h"
+#include "PIL_time.h"
 
 #include "bmesh.h"
 #include "bmesh_class.h"

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [704f56d68f3] blender-v2.83-release: macOS build: set minimum deployment target correctly

2021-05-20 Thread Ankit Meel
Commit: 704f56d68f3ed83e6350f182fcf9aa45a19ded41
Author: Ankit Meel
Date:   Thu May 20 22:38:57 2021 +0530
Branches: blender-v2.83-release
https://developer.blender.org/rB704f56d68f3ed83e6350f182fcf9aa45a19ded41

macOS build: set minimum deployment target correctly

Equivalent of D11323 for 2.83. Make `CMAKE_OSX_DEPLOYMENT_TARGET`
independent of buildbot settings and always set to 10.11.
That fixes the launch error on OS older than buildbot's.

Maniphest Tasks: T88419
Differential Revision: https://developer.blender.org/D11328

===

M   build_files/cmake/platform/platform_apple_xcode.cmake

===

diff --git a/build_files/cmake/platform/platform_apple_xcode.cmake 
b/build_files/cmake/platform/platform_apple_xcode.cmake
index f1f02c151ee..8cf5245e336 100644
--- a/build_files/cmake/platform/platform_apple_xcode.cmake
+++ b/build_files/cmake/platform/platform_apple_xcode.cmake
@@ -134,14 +134,7 @@ endif()
 unset(OSX_SDKROOT)
 
 # 10.11 is our min. target, if you use higher sdk, weak linking happens
-if(CMAKE_OSX_DEPLOYMENT_TARGET)
-  if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.11)
-message(STATUS "Setting deployment target to 10.11, lower versions are not 
supported")
-set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "" FORCE)
-  endif()
-else()
-  set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "" FORCE)
-endif()
+set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "" FORCE)
 
 if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
   # Force CMAKE_OSX_DEPLOYMENT_TARGET for makefiles, will not work else (CMake 
bug?)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [677909cdc3c] master: Merge branch 'blender-v2.93-release' into master

2021-05-20 Thread Ankit Meel
Commit: 677909cdc3c2380819a987a80c623a45dde5c40c
Author: Ankit Meel
Date:   Thu May 20 21:58:34 2021 +0530
Branches: master
https://developer.blender.org/rB677909cdc3c2380819a987a80c623a45dde5c40c

Merge branch 'blender-v2.93-release' into master

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2e7d3ad7b51] blender-v2.93-release: macOS build: set minimum deployment target correctly

2021-05-20 Thread Ankit Meel
Commit: 2e7d3ad7b51bbc05cdcbbc3c055f961f3a2c28a8
Author: Ankit Meel
Date:   Thu May 20 21:55:58 2021 +0530
Branches: blender-v2.93-release
https://developer.blender.org/rB2e7d3ad7b51bbc05cdcbbc3c055f961f3a2c28a8

macOS build: set minimum deployment target correctly

Make `CMAKE_OSX_DEPLOYMENT_TARGET` independent of buildbot settings and
always set to `OSX_MIN_DEPLOYMENT_TARGET`. That fixes the launch error
on OS older than buildbot's.
Remove unused `MACOSX_DEPLOYMENT_TARGET`.

Fix T88419
Diff D11323

===

M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_apple_xcode.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a5eee46349a..fe9dd6a58de 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -20,12 +20,6 @@
 
 # Libraries configuration for Apple.
 
-if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
-  set(MACOSX_DEPLOYMENT_TARGET 11.00)
-else()
-  set(MACOSX_DEPLOYMENT_TARGET 10.13)
-endif()
-
 macro(find_package_wrapper)
 # do nothing, just satisfy the macro
 endmacro()
diff --git a/build_files/cmake/platform/platform_apple_xcode.cmake 
b/build_files/cmake/platform/platform_apple_xcode.cmake
index 4d15fee75b7..639d7e43afd 100644
--- a/build_files/cmake/platform/platform_apple_xcode.cmake
+++ b/build_files/cmake/platform/platform_apple_xcode.cmake
@@ -168,21 +168,15 @@ endif()
 unset(OSX_SDKROOT)
 
 
-# 10.13 is our min. target, if you use higher sdk, weak linking happens
 if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
+  # M1 chips run Big Sur onwards.
   set(OSX_MIN_DEPLOYMENT_TARGET 11.00)
 else()
+  # 10.13 is our min. target, if you use higher sdk, weak linking happens
   set(OSX_MIN_DEPLOYMENT_TARGET 10.13)
 endif()
 
-if(CMAKE_OSX_DEPLOYMENT_TARGET)
-  if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS ${OSX_MIN_DEPLOYMENT_TARGET})
-message(STATUS "Setting deployment target to ${OSX_MIN_DEPLOYMENT_TARGET}, 
lower versions are not supported")
-set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE 
STRING "" FORCE)
-  endif()
-else()
-  set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING 
"" FORCE)
-endif()
+set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING "" 
FORCE)
 
 if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
   # Force CMAKE_OSX_DEPLOYMENT_TARGET for makefiles, will not work else (CMake 
bug?)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d405d7c87e3] tmp-macminver: macOS: set minimum deployment target correctly

2021-05-20 Thread Ankit Meel
Commit: d405d7c87e3e6c65c33773ee07834f39c0976762
Author: Ankit Meel
Date:   Thu May 20 15:47:06 2021 +0530
Branches: tmp-macminver
https://developer.blender.org/rBd405d7c87e3e6c65c33773ee07834f39c0976762

macOS: set minimum deployment target correctly

Fix T88419

`CMAKE_OSX_DEPLOYMENT_TARGET` is now always the same as
`OSX_MIN_DEPLOYMENT_TARGET`. I don't know the historical reason of
why they were allowed to be different.

`MACOSX_DEPLOYMENT_TARGET` has been moved to platform_apple_xcode
because it's helpful to deduce `CMAKE_OSX_DEPLOYMENT_TARGET` and
platform_apple is included after platform_apple_xcode. Although it seems
useless now that we're explicitly setting `CMAKE_OSX_DEPLOYMENT_TARGET`.
Remove it ? `man clang` says that `MACOSX_DEPLOYMENT_TARGET` is used
if `mmacosx-version-min` is not present.

Docs suggest that `CMAKE_OSX_DEPLOYMENT_TARGET` should be set before
project call. Should we do that, like in D10838, using
`blender_project_hack_pre` ?

Maniphest Tasks: T88419

Differential Revision: https://developer.blender.org/D11323

===

M   build_files/cmake/platform/platform_apple.cmake
M   build_files/cmake/platform/platform_apple_xcode.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index a5eee46349a..fe9dd6a58de 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -20,12 +20,6 @@
 
 # Libraries configuration for Apple.
 
-if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
-  set(MACOSX_DEPLOYMENT_TARGET 11.00)
-else()
-  set(MACOSX_DEPLOYMENT_TARGET 10.13)
-endif()
-
 macro(find_package_wrapper)
 # do nothing, just satisfy the macro
 endmacro()
diff --git a/build_files/cmake/platform/platform_apple_xcode.cmake 
b/build_files/cmake/platform/platform_apple_xcode.cmake
index 4d15fee75b7..38d74b5613e 100644
--- a/build_files/cmake/platform/platform_apple_xcode.cmake
+++ b/build_files/cmake/platform/platform_apple_xcode.cmake
@@ -171,18 +171,13 @@ unset(OSX_SDKROOT)
 # 10.13 is our min. target, if you use higher sdk, weak linking happens
 if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
   set(OSX_MIN_DEPLOYMENT_TARGET 11.00)
+  set($ENV{MACOSX_DEPLOYMENT_TARGET}  11.00)
 else()
   set(OSX_MIN_DEPLOYMENT_TARGET 10.13)
+  set($ENV{MACOSX_DEPLOYMENT_TARGET}  10.13)
 endif()
 
-if(CMAKE_OSX_DEPLOYMENT_TARGET)
-  if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS ${OSX_MIN_DEPLOYMENT_TARGET})
-message(STATUS "Setting deployment target to ${OSX_MIN_DEPLOYMENT_TARGET}, 
lower versions are not supported")
-set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE 
STRING "" FORCE)
-  endif()
-else()
-  set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING 
"" FORCE)
-endif()
+set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING "" 
FORCE)
 
 if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
   # Force CMAKE_OSX_DEPLOYMENT_TARGET for makefiles, will not work else (CMake 
bug?)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [133b84a8fd4] tmp-macos-min-version: Find CMAKE_OSX_DEPLOYMENT_TARGET's value

2021-05-20 Thread Ankit Meel
Commit: 133b84a8fd47c287118de79f6d67110f38a398ed
Author: Ankit Meel
Date:   Thu May 20 12:31:00 2021 +0530
Branches: tmp-macos-min-version
https://developer.blender.org/rB133b84a8fd47c287118de79f6d67110f38a398ed

Find CMAKE_OSX_DEPLOYMENT_TARGET's value

===

M   build_files/cmake/platform/platform_apple_xcode.cmake

===

diff --git a/build_files/cmake/platform/platform_apple_xcode.cmake 
b/build_files/cmake/platform/platform_apple_xcode.cmake
index 4d15fee75b7..55d23c28880 100644
--- a/build_files/cmake/platform/platform_apple_xcode.cmake
+++ b/build_files/cmake/platform/platform_apple_xcode.cmake
@@ -184,6 +184,9 @@ else()
   set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING 
"" FORCE)
 endif()
 
+message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET: 
${CMAKE_OSX_DEPLOYMENT_TARGET},"
+" OSX_MIN_DEPLOYMENT_TARGET: ${OSX_MIN_DEPLOYMENT_TARGET}")
+
 if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
   # Force CMAKE_OSX_DEPLOYMENT_TARGET for makefiles, will not work else (CMake 
bug?)
   string(APPEND CMAKE_C_FLAGS " 
-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [49cb30bb0c0] master: Cleanup: Fix inconsistent-missing-override warning macOS Clang

2021-05-15 Thread Ankit Meel
Commit: 49cb30bb0c0c7b326243349c2293e4723c5268c5
Author: Ankit Meel
Date:   Sun May 16 11:19:04 2021 +0530
Branches: master
https://developer.blender.org/rB49cb30bb0c0c7b326243349c2293e4723c5268c5

Cleanup: Fix inconsistent-missing-override warning
macOS Clang

===

M   source/blender/functions/FN_generic_virtual_array.hh

===

diff --git a/source/blender/functions/FN_generic_virtual_array.hh 
b/source/blender/functions/FN_generic_virtual_array.hh
index c89423375c9..d530d10b3c8 100644
--- a/source/blender/functions/FN_generic_virtual_array.hh
+++ b/source/blender/functions/FN_generic_virtual_array.hh
@@ -562,7 +562,7 @@ template class GVMutableArray_For_VMutableArray 
: public GVMutableAr
 varray_->set(index, std::move(value_));
   }
 
-  void set_all_impl(const void *src)
+  void set_all_impl(const void *src) override
   {
 varray_->set_all(Span((T *)src, size_));
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0e581f61967] master: Cleanup: Fix missing-braces warning on macOS Clang

2021-05-15 Thread Ankit Meel
Commit: 0e581f6196702d303e78a5d8778a90530c33e890
Author: Ankit Meel
Date:   Sun May 16 11:19:21 2021 +0530
Branches: master
https://developer.blender.org/rB0e581f6196702d303e78a5d8778a90530c33e890

Cleanup: Fix missing-braces warning on macOS Clang

===

M   source/blender/sequencer/SEQ_iterator.h

===

diff --git a/source/blender/sequencer/SEQ_iterator.h 
b/source/blender/sequencer/SEQ_iterator.h
index b015bb6133a..d566ff7c4c4 100644
--- a/source/blender/sequencer/SEQ_iterator.h
+++ b/source/blender/sequencer/SEQ_iterator.h
@@ -35,7 +35,7 @@ struct GSet;
 struct GSetIterator;
 
 #define SEQ_ITERATOR_FOREACH(var, collection) \
-  for (SeqIterator iter = {NULL}; SEQ_iterator_ensure(collection, , ) 
&& var != NULL; \
+  for (SeqIterator iter = {{NULL}}; SEQ_iterator_ensure(collection, , 
) && var != NULL; \
var = SEQ_iterator_yield())
 
 #define SEQ_ALL_BEGIN(ed, var) \

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [193425ce1db] master: Cycles: fix inconsistent-missing-override warnings LLVM Clang 13, macOS.

2021-05-11 Thread Ankit Meel
Commit: 193425ce1db168735c3d6532d9582e5f1aacdc00
Author: Ankit Meel
Date:   Wed May 12 10:27:37 2021 +0530
Branches: master
https://developer.blender.org/rB193425ce1db168735c3d6532d9582e5f1aacdc00

Cycles: fix inconsistent-missing-override warnings
LLVM Clang 13, macOS.

Reviewed By: brecht
Differential Revision: https://developer.blender.org/D11207

===

M   intern/cycles/render/osl.h
M   intern/cycles/render/svm.h

===

diff --git a/intern/cycles/render/osl.h b/intern/cycles/render/osl.h
index c9eaf26e70a..f6aa98d867a 100644
--- a/intern/cycles/render/osl.h
+++ b/intern/cycles/render/osl.h
@@ -72,9 +72,9 @@ class OSLShaderManager : public ShaderManager {
 
   static void free_memory();
 
-  void reset(Scene *scene);
+  void reset(Scene *scene) override;
 
-  bool use_osl()
+  bool use_osl() override
   {
 return true;
   }
@@ -83,7 +83,7 @@ class OSLShaderManager : public ShaderManager {
   DeviceScene *dscene,
   Scene *scene,
   Progress ) override;
-  void device_free(Device *device, DeviceScene *dscene, Scene *scene);
+  void device_free(Device *device, DeviceScene *dscene, Scene *scene) override;
 
   /* osl compile and query */
   static bool osl_compile(const string , const string );
diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h
index 85b4b9c419f..d23ff3e2a47 100644
--- a/intern/cycles/render/svm.h
+++ b/intern/cycles/render/svm.h
@@ -44,13 +44,13 @@ class SVMShaderManager : public ShaderManager {
   SVMShaderManager();
   ~SVMShaderManager();
 
-  void reset(Scene *scene);
+  void reset(Scene *scene) override;
 
   void device_update_specific(Device *device,
   DeviceScene *dscene,
   Scene *scene,
   Progress ) override;
-  void device_free(Device *device, DeviceScene *dscene, Scene *scene);
+  void device_free(Device *device, DeviceScene *dscene, Scene *scene) override;
 
  protected:
   void device_update_shader(Scene *scene,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [08f4bab658c] master: System info: add OS version to sys_info.py

2021-05-04 Thread Ankit Meel
Commit: 08f4bab658cd8c930450c11862540ff2da434151
Author: Ankit Meel
Date:   Wed May 5 10:08:04 2021 +0530
Branches: master
https://developer.blender.org/rB08f4bab658cd8c930450c11862540ff2da434151

System info: add OS version to sys_info.py

Match the output to the prefilled bug report script's output.
Make the output file self-contained.

Reviewed By: lichtwerk
Differential Revision: https://developer.blender.org/D11144

===

M   release/scripts/modules/sys_info.py

===

diff --git a/release/scripts/modules/sys_info.py 
b/release/scripts/modules/sys_info.py
index cb80529f0f3..5116e0f0088 100644
--- a/release/scripts/modules/sys_info.py
+++ b/release/scripts/modules/sys_info.py
@@ -23,6 +23,7 @@
 
 def write_sysinfo(filepath):
 import sys
+import platform
 
 import subprocess
 
@@ -63,7 +64,7 @@ def write_sysinfo(filepath):
  ))
 
 output.write("build date: %s, %s\n" % (prepr(bpy.app.build_date), 
prepr(bpy.app.build_time)))
-output.write("platform: %s\n" % prepr(bpy.app.build_platform))
+output.write("platform: %s\n" % prepr(platform.platform()))
 output.write("binary path: %s\n" % prepr(bpy.app.binary_path))
 output.write("build cflags: %s\n" % prepr(bpy.app.build_cflags))
 output.write("build cxxflags: %s\n" % 
prepr(bpy.app.build_cxxflags))

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [aa95f8019e4] master: macOS: Fix unknown -Wsuggest-override warning

2021-04-23 Thread Ankit Meel
Commit: aa95f8019e4204ea50210add1b2c2ed1934b92c9
Author: Ankit Meel
Date:   Sat Apr 24 01:54:30 2021 +0530
Branches: master
https://developer.blender.org/rBaa95f8019e4204ea50210add1b2c2ed1934b92c9

macOS: Fix unknown -Wsuggest-override warning

Added in rB7cef01b090c4c2d2703274edb91886ae37d3ce82
and rB87bfa2b207b90b5e34ebd835a23c2a82afbed878

Reviewed by: jbakker, #platform_macos
Differential Revision: https://developer.blender.org/D11012

===

M   CMakeLists.txt
M   source/blender/compositor/CMakeLists.txt
M   source/blender/gpu/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba863cf32b6..f315fa87236 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1526,6 +1526,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_FORMAT_SIGN 
-Wformat-signedness)
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_RESTRICT -Wrestrict)
+  ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SUGGEST_OVERRIDE  
-Wno-suggest-override)
 
   # gcc 4.2 gives annoying warnings on every file with this
   if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -1589,6 +1590,8 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_OVERLOADED_VIRTUAL  
-Wno-overloaded-virtual)  # we get a lot of these, if its a problem a dev needs 
to look into it.
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE
-Wno-sign-compare)
   ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF
-Wno-invalid-offsetof)
+  # Apple Clang (tested on version 12) doesn't support this flag while LLVM 
Clang 11 does.
+  ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SUGGEST_OVERRIDE
-Wno-suggest-override)
 
   # gives too many unfixable warnings
   # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_MACROS  
-Wunused-macros)
diff --git a/source/blender/compositor/CMakeLists.txt 
b/source/blender/compositor/CMakeLists.txt
index 75e7408b0a0..65391794c12 100644
--- a/source/blender/compositor/CMakeLists.txt
+++ b/source/blender/compositor/CMakeLists.txt
@@ -608,7 +608,7 @@ endif()
 
 blender_add_lib(bf_compositor "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
 
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+if(CXX_WARN_NO_SUGGEST_OVERRIDE)
   target_compile_options(bf_compositor PRIVATE "-Wsuggest-override")
 endif()
 
diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index 923426c21a6..2ff72266a64 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -381,7 +381,7 @@ endif()
 
 blender_add_lib(bf_gpu "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
 
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+if(CXX_WARN_NO_SUGGEST_OVERRIDE)
   target_compile_options(bf_gpu PRIVATE 
$<$:-Wsuggest-override>)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [17fca62fff9] master: Merge branch 'blender-v2.93-release' into master

2021-04-23 Thread Ankit Meel
Commit: 17fca62fff9b5a6fa27fdf1d770b4e0315fa9448
Author: Ankit Meel
Date:   Sat Apr 24 01:55:49 2021 +0530
Branches: master
https://developer.blender.org/rB17fca62fff9b5a6fa27fdf1d770b4e0315fa9448

Merge branch 'blender-v2.93-release' into master

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [15670ebb954] master: Cleanup: Fix pessimizing move warning.

2021-04-07 Thread Ankit Meel
Commit: 15670ebb9549db77414e266324d33114fa3af468
Author: Ankit Meel
Date:   Wed Apr 7 15:20:45 2021 +0530
Branches: master
https://developer.blender.org/rB15670ebb9549db77414e266324d33114fa3af468

Cleanup: Fix pessimizing move warning.

===

M   source/blender/nodes/geometry/nodes/node_geo_boolean.cc

===

diff --git a/source/blender/nodes/geometry/nodes/node_geo_boolean.cc 
b/source/blender/nodes/geometry/nodes/node_geo_boolean.cc
index 6be5bc4f8b4..4b91a1ee2f2 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_boolean.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_boolean.cc
@@ -88,7 +88,7 @@ static void geo_node_boolean_exec(GeoNodeExecParams params)
 
   if (operation < 0 || operation > 2) {
 BLI_assert(false);
-params.set_output("Geometry", std::move(GeometrySet()));
+params.set_output("Geometry", GeometrySet());
 return;
   }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [548d16d4a50] master: BKE: attempt to fix build error on windows

2021-04-02 Thread Ankit Meel
Commit: 548d16d4a50ba5cdd2d6aa7e62a9ca86ef6d24b0
Author: Ankit Meel
Date:   Fri Apr 2 17:06:24 2021 +0530
Branches: master
https://developer.blender.org/rB548d16d4a50ba5cdd2d6aa7e62a9ca86ef6d24b0

BKE: attempt to fix build error on windows

===

M   source/blender/blenkernel/intern/object_dupli.cc

===

diff --git a/source/blender/blenkernel/intern/object_dupli.cc 
b/source/blender/blenkernel/intern/object_dupli.cc
index 17800b12b12..8884593d6bd 100644
--- a/source/blender/blenkernel/intern/object_dupli.cc
+++ b/source/blender/blenkernel/intern/object_dupli.cc
@@ -1003,7 +1003,7 @@ static DupliObject *face_dupli_from_mesh(const 
DupliContext *ctx,
  const MVert *mvert)
 {
   const int coords_len = mpoly->totloop;
-  float(*coords)[3] = BLI_array_alloca(coords, (size_t)coords_len);
+  float(*coords)[3] = (float(*)[3])BLI_array_alloca(coords, 
(size_t)coords_len);
 
   const MLoop *ml = mloopstart;
   for (int i = 0; i < coords_len; i++, ml++) {
@@ -1026,7 +1026,7 @@ static DupliObject *face_dupli_from_editmesh(const 
DupliContext *ctx,
  const float (*vert_coords)[3])
 {
   const int coords_len = f->len;
-  float(*coords)[3] = BLI_array_alloca(coords, (size_t)coords_len);
+  float(*coords)[3] = (float(*)[3])BLI_array_alloca(coords, 
(size_t)coords_len);
 
   BMLoop *l_first, *l_iter;
   int i = 0;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [6578f9d1e99] master: Modifiers: Fix build error with GMP

2021-04-02 Thread Ankit Meel
Commit: 6578f9d1e9981f2c52824654fb6ad267ba8ca3b4
Author: Ankit Meel
Date:   Fri Apr 2 13:48:22 2021 +0530
Branches: master
https://developer.blender.org/rB6578f9d1e9981f2c52824654fb6ad267ba8ca3b4

Modifiers: Fix build error with GMP

===

M   source/blender/modifiers/CMakeLists.txt

===

diff --git a/source/blender/modifiers/CMakeLists.txt 
b/source/blender/modifiers/CMakeLists.txt
index 5fc88846527..54caaed9231 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -181,6 +181,14 @@ endif()
 
 if(WITH_GMP)
   add_definitions(-DWITH_GMP)
+
+  list(APPEND INC_SYS
+${GMP_INCLUDE_DIRS}
+  )
+
+  list(APPEND LIB
+${GMP_LIBRARIES}
+  )
 endif()
 
 if(WITH_OPENVDB)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f061de9b3e6] master: Cleanup/CMake: warning to status to reduce noise

2021-03-31 Thread Ankit Meel
Commit: f061de9b3e6b717e393ac5740927965b329668c7
Author: Ankit Meel
Date:   Thu Apr 1 01:12:48 2021 +0530
Branches: master
https://developer.blender.org/rBf061de9b3e6b717e393ac5740927965b329668c7

Cleanup/CMake: warning to status to reduce noise

Correction in e5f0d176d4cfa020bfb4de78086007dcfd02e8f9

===

M   CMakeLists.txt
M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98e57bce01a..ba863cf32b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -706,7 +706,7 @@ set_and_warn_dependency(WITH_PYTHON WITH_CYCLESOFF)
 set_and_warn_dependency(WITH_PYTHON WITH_DRACO OFF)
 
 if(WITH_DRACO AND NOT WITH_PYTHON_INSTALL)
-  message(WARNING "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling 
WITH_DRACO for now")
+  message(STATUS "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling 
WITH_DRACO for now")
   set(WITH_DRACO OFF)
 endif()
 
@@ -725,7 +725,7 @@ set_and_warn_dependency(WITH_PUGIXML WITH_OPENIMAGEIO  OFF)
 
 if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
-  message(WARNING "No dependencies need 'WITH_BOOST' forcing WITH_BOOST=OFF")
+  message(STATUS "No dependencies need 'WITH_BOOST' forcing WITH_BOOST=OFF")
   set(WITH_BOOST OFF)
 endif()
 
@@ -775,7 +775,7 @@ if(WITH_INSTALL_PORTABLE)
 endif()
 
 if(WITH_GHOST_SDL OR WITH_HEADLESS)
-  message(WARNING "Disabling Ghost Wayland, X11, Input IME, and OpenXR")
+  message(STATUS "Disabling Ghost Wayland, X11, Input IME, and OpenXR")
   set(WITH_GHOST_WAYLAND OFF)
   set(WITH_GHOST_X11 OFF)
   set(WITH_X11_XINPUTOFF)
@@ -806,7 +806,7 @@ endif()
 if(NOT WITH_CUDA_DYNLOAD)
   find_package(CUDA)
   if(NOT CUDA_FOUND)
-message(WARNING "CUDA toolkit not found, using dynamic runtime loading of 
libraries (WITH_CUDA_DYNLOAD) instead")
+message(STATUS "CUDA toolkit not found, using dynamic runtime loading of 
libraries (WITH_CUDA_DYNLOAD) instead")
 set(WITH_CUDA_DYNLOAD ON)
   endif()
 endif()
@@ -1243,7 +1243,7 @@ if(WITH_OPENMP)
   find_library_static(OpenMP_LIBRARIES gomp 
${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
 endif()
   else()
-message(WARNING "OpenMP not found, disabling WITH_OPENMP")
+message(STATUS "OpenMP not found, disabling WITH_OPENMP")
 set(WITH_OPENMP OFF)
   endif()
 
@@ -1319,7 +1319,7 @@ list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
 if(WITH_BULLET AND WITH_SYSTEM_BULLET)
   find_package(Bullet)
   if(NOT BULLET_FOUND)
-message(WARNING "Bullet not found, disabling WITH_BULLET")
+message(STATUS "Bullet not found, disabling WITH_BULLET")
 set(WITH_BULLET OFF)
   endif()
 else()
diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 0a9a41bc26f..fd3f1f6f6a8 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -66,7 +66,7 @@ if(WITH_JACK)
 NAMES jackmp
   )
   if(NOT JACK_FRAMEWORK)
-message(WARNING "JACK not found, disabling WITH_JACK")
+message(STATUS "JACK not found, disabling WITH_JACK")
 set(WITH_JACK OFF)
   else()
 set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1a100d2d78c] master: Cleanup/CMake: tweak messages in platform_apple

2021-03-31 Thread Ankit Meel
Commit: 1a100d2d78c75c9a6ac015606cc16698e7775682
Author: Ankit Meel
Date:   Thu Apr 1 01:13:22 2021 +0530
Branches: master
https://developer.blender.org/rB1a100d2d78c75c9a6ac015606cc16698e7775682

Cleanup/CMake: tweak messages in platform_apple

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index fd3f1f6f6a8..a5eee46349a 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -104,6 +104,7 @@ endif()
 if(WITH_USD)
   find_package(USD)
   if(NOT USD_FOUND)
+message(STATUS "USD not found, disabling WITH_USD")
 set(WITH_USD OFF)
   endif()
 endif()
@@ -310,7 +311,7 @@ if(WITH_OPENCOLORIO)
 
   if(NOT OPENCOLORIO_FOUND)
 set(WITH_OPENCOLORIO OFF)
-message(STATUS "OpenColorIO not found")
+message(STATUS "OpenColorIO not found, disabling WITH_OPENCOLORIO")
   endif()
 endif()
 
@@ -387,7 +388,7 @@ if(WITH_OPENIMAGEDENOISE)
 
   if(NOT OPENIMAGEDENOISE_FOUND)
 set(WITH_OPENIMAGEDENOISE OFF)
-message(STATUS "OpenImageDenoise not found")
+message(STATUS "OpenImageDenoise not found, disabling 
WITH_OPENIMAGEDENOISE")
   endif()
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [e5f0d176d4c] master: CMake: issue warnings when changing options

2021-03-30 Thread Ankit Meel
Commit: e5f0d176d4cfa020bfb4de78086007dcfd02e8f9
Author: Ankit Meel
Date:   Tue Mar 30 20:28:45 2021 +0530
Branches: master
https://developer.blender.org/rBe5f0d176d4cfa020bfb4de78086007dcfd02e8f9

CMake: issue warnings when changing options

Only done in top level CMakeLists, and platform_apple.

Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D10343

===

M   CMakeLists.txt
M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f3057bccf1..98e57bce01a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -236,9 +236,7 @@ option(WITH_SYSTEM_AUDASPACE "Build with external audaspace 
library installed on
 mark_as_advanced(WITH_AUDASPACE)
 mark_as_advanced(WITH_SYSTEM_AUDASPACE)
 
-if(NOT WITH_AUDASPACE)
-  set(WITH_SYSTEM_AUDASPACE OFF)
-endif()
+set_and_warn_dependency(WITH_AUDASPACE WITH_SYSTEM_AUDASPACE OFF)
 
 option(WITH_OPENMP"Enable OpenMP (has to be supported by the 
compiler)" ON)
 if(UNIX AND NOT APPLE)
@@ -704,13 +702,11 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
   message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be 
OFF")
 endif()
 
-if(NOT WITH_PYTHON)
-  set(WITH_CYCLES OFF)
-  set(WITH_DRACO OFF)
-endif()
+set_and_warn_dependency(WITH_PYTHON WITH_CYCLESOFF)
+set_and_warn_dependency(WITH_PYTHON WITH_DRACO OFF)
 
 if(WITH_DRACO AND NOT WITH_PYTHON_INSTALL)
-  message(STATUS "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling 
WITH_DRACO for now")
+  message(WARNING "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling 
WITH_DRACO for now")
   set(WITH_DRACO OFF)
 endif()
 
@@ -729,7 +725,7 @@ set_and_warn_dependency(WITH_PUGIXML WITH_OPENIMAGEIO  OFF)
 
 if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
-  message(STATUS "No dependencies need 'WITH_BOOST' forcing WITH_BOOST=OFF")
+  message(WARNING "No dependencies need 'WITH_BOOST' forcing WITH_BOOST=OFF")
   set(WITH_BOOST OFF)
 endif()
 
@@ -779,6 +775,7 @@ if(WITH_INSTALL_PORTABLE)
 endif()
 
 if(WITH_GHOST_SDL OR WITH_HEADLESS)
+  message(WARNING "Disabling Ghost Wayland, X11, Input IME, and OpenXR")
   set(WITH_GHOST_WAYLAND OFF)
   set(WITH_GHOST_X11 OFF)
   set(WITH_X11_XINPUTOFF)
@@ -809,7 +806,7 @@ endif()
 if(NOT WITH_CUDA_DYNLOAD)
   find_package(CUDA)
   if(NOT CUDA_FOUND)
-message("CUDA toolkit not found, using dynamic runtime loading of 
libraries instead")
+message(WARNING "CUDA toolkit not found, using dynamic runtime loading of 
libraries (WITH_CUDA_DYNLOAD) instead")
 set(WITH_CUDA_DYNLOAD ON)
   endif()
 endif()
@@ -1246,6 +1243,7 @@ if(WITH_OPENMP)
   find_library_static(OpenMP_LIBRARIES gomp 
${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
 endif()
   else()
+message(WARNING "OpenMP not found, disabling WITH_OPENMP")
 set(WITH_OPENMP OFF)
   endif()
 
@@ -1321,6 +1319,7 @@ list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
 if(WITH_BULLET AND WITH_SYSTEM_BULLET)
   find_package(Bullet)
   if(NOT BULLET_FOUND)
+message(WARNING "Bullet not found, disabling WITH_BULLET")
 set(WITH_BULLET OFF)
   endif()
 else()
diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index c4caff74966..0a9a41bc26f 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -56,6 +56,7 @@ list(APPEND ZLIB_LIBRARIES ${BZIP2_LIBRARIES})
 if(WITH_OPENAL)
   find_package(OpenAL)
   if(NOT OPENAL_FOUND)
+message(WARNING "OpenAL not found, disabling WITH_OPENAL")
 set(WITH_OPENAL OFF)
   endif()
 endif()
@@ -65,6 +66,7 @@ if(WITH_JACK)
 NAMES jackmp
   )
   if(NOT JACK_FRAMEWORK)
+message(WARNING "JACK not found, disabling WITH_JACK")
 set(WITH_JACK OFF)
   else()
 set(JACK_INCLUDE_DIRS ${JACK_FRAMEWORK}/headers)
@@ -357,7 +359,7 @@ if(WITH_CYCLES_OSL)
   if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER AND OSL_SHADER_DIR)
 set(OSL_FOUND TRUE)
   else()
-message(STATUS "OSL not found")
+message(WARNING "OSL not found, disabling WITH_CYCLES_OSL")
 set(WITH_CYCLES_OSL OFF)
   endif()
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7fd3b07da1b] master: Build Environment: set MAKE_THREADS as per the CPU

2021-03-30 Thread Ankit Meel
Commit: 7fd3b07da1b8e4a30dcf0c1fc74b503322735749
Author: Ankit Meel
Date:   Tue Mar 30 16:42:19 2021 +0530
Branches: master
https://developer.blender.org/rB7fd3b07da1b8e4a30dcf0c1fc74b503322735749

Build Environment: set MAKE_THREADS as per the CPU

It is a better default.

Reviewed By: sebbas, sybren
Differential Revision: https://developer.blender.org/D10652

===

M   build_files/build_environment/cmake/options.cmake

===

diff --git a/build_files/build_environment/cmake/options.cmake 
b/build_files/build_environment/cmake/options.cmake
index 5091a5d9496..15ceb693ae0 100644
--- a/build_files/build_environment/cmake/options.cmake
+++ b/build_files/build_environment/cmake/options.cmake
@@ -21,7 +21,8 @@ if(WIN32)
 endif()
 option(WITH_WEBP "Enable building of oiio with webp support" OFF)
 option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
-set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
+cmake_host_system_information(RESULT NUM_CORES QUERY NUMBER_OF_LOGICAL_CORES)
+set(MAKE_THREADS ${NUM_CORES} CACHE STRING "Number of threads to run make 
with")
 
 if(NOT BUILD_MODE)
   set(BUILD_MODE "Release")

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a702ca3faa9] master: Tests/bpy: Add installation verification test

2021-03-29 Thread Ankit Meel
Commit: a702ca3faa9bde7cb3a439a07d8893a692be9ca6
Author: Ankit Meel
Date:   Mon Mar 29 22:26:54 2021 +0530
Branches: master
https://developer.blender.org/rBa702ca3faa9bde7cb3a439a07d8893a692be9ca6

Tests/bpy: Add installation verification test

Makes it slightly easier to test whether the installed module works
or not. Depends on D10656

Ref T86579
Reviewed By: mont29, campbellbarton
Differential Revision: https://developer.blender.org/D10665

===

M   tests/CMakeLists.txt
A   tests/blender_as_python_module/CMakeLists.txt
A   tests/blender_as_python_module/import_bpy.py

===

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 00883a03174..3d9201bec04 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -51,5 +51,10 @@ if(WITH_BLENDER AND WITH_PYTHON AND NOT WITH_PYTHON_MODULE)
   add_subdirectory(python)
 endif()
 
+# Blender as python module tests.
+if(WITH_PYTHON_MODULE)
+  add_subdirectory(blender_as_python_module)
+endif()
+
 # GTest
 add_subdirectory(gtests)
diff --git a/tests/blender_as_python_module/CMakeLists.txt 
b/tests/blender_as_python_module/CMakeLists.txt
new file mode 100644
index 000..98e081672e9
--- /dev/null
+++ b/tests/blender_as_python_module/CMakeLists.txt
@@ -0,0 +1,33 @@
+# * BEGIN GPL LICENSE BLOCK *
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2021, Blender Foundation
+# All rights reserved.
+#
+# * END GPL LICENSE BLOCK *
+
+function(add_blender_as_python_module_test testname testscript)
+  if(NOT TEST_PYTHON_EXE)
+message(FATAL_ERROR "No Python configured for running tests, set 
TEST_PYTHON_EXE.")
+  endif()
+
+  add_test(
+NAME ${testname}
+COMMAND ${TEST_PYTHON_EXE} ${testscript} ${ARGN}
+  )
+endfunction()
+
+add_blender_as_python_module_test(import_bpy 
${CMAKE_CURRENT_LIST_DIR}/import_bpy.py)
diff --git a/tests/blender_as_python_module/import_bpy.py 
b/tests/blender_as_python_module/import_bpy.py
new file mode 100644
index 000..bdc0277cfec
--- /dev/null
+++ b/tests/blender_as_python_module/import_bpy.py
@@ -0,0 +1,19 @@
+# * BEGIN GPL LICENSE BLOCK *
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# * END GPL LICENSE BLOCK *
+
+# Just import bpy and see if there are any dynamic loader errors.
+import bpy

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [fbe2c3f4227] master: Tests: disable python tests for blender as python module

2021-03-29 Thread Ankit Meel
Commit: fbe2c3f4227d2f2373e459cb800868f9b8edafda
Author: Ankit Meel
Date:   Mon Mar 29 22:25:52 2021 +0530
Branches: master
https://developer.blender.org/rBfbe2c3f4227d2f2373e459cb800868f9b8edafda

Tests: disable python tests for blender as python module

Avoid CTest errors and exit codes due to test failures which depend
on Blender executable.

Ref T86579
Reviewed By: mont29, campbellbarton
Differential Revision: https://developer.blender.org/D10656

===

M   tests/CMakeLists.txt

===

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 8941cc671dd..00883a03174 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -47,7 +47,7 @@ unset(_default_test_python_exe)
 set(TEST_BLENDER_EXE_PARAMS --background -noaudio --factory-startup 
--debug-memory --debug-exit-on-error --python-exit-code 1)
 
 # Python CTests
-if(WITH_BLENDER AND WITH_PYTHON)
+if(WITH_BLENDER AND WITH_PYTHON AND NOT WITH_PYTHON_MODULE)
   add_subdirectory(python)
 endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [241f05d53c3] master: macOS/bpy: accommodate portable builds, and multi-config generators.

2021-03-29 Thread Ankit Meel
Commit: 241f05d53c32323c6d4bb8b179b87ec62b5f3a57
Author: Ankit Meel
Date:   Mon Mar 29 22:25:13 2021 +0530
Branches: master
https://developer.blender.org/rB241f05d53c32323c6d4bb8b179b87ec62b5f3a57

macOS/bpy: accommodate portable builds, and multi-config generators.

Old code's `install` step did not guarantee that all script files
will be copied from source folder to build folder _before_ copying from
build folder to site-packages. That caused incomplete installation.
Fixed by copying scripts etc., only once. Also match the behavior on
Linux: install to site-packages only if `WITH_INSTALL_PORTABLE` is OFF.

Also fix install and launch issues with Xcode.

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 43533d55f55..d9064682203 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -326,7 +326,14 @@ elseif(WIN32)
 
 elseif(APPLE)
   if(WITH_PYTHON_MODULE)
-set(TARGETDIR_VER ${BLENDER_VERSION})
+if(WITH_INSTALL_PORTABLE)
+  set(TARGETDIR_VER 
$/../Resources/${BLENDER_VERSION})
+  # Keep the `BLENDER_VERSION` folder and bpy.so in the build folder.
+  set(INSTALL_BPY_TO_SITE_PACKAGES OFF)
+else()
+  set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
+  set(INSTALL_BPY_TO_SITE_PACKAGES ON)
+endif()
   else()
 set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
   endif()
@@ -1007,8 +1014,6 @@ elseif(APPLE)
 )
 if(WITH_PYTHON_MODULE)
   # Move the dylib in a Blender version folder to keep the corresponding 
OpenMP version.
-  # Also for easy copying of a single folder, `TARGETDIR_VER` to 
site-packages
-  # during installation.
   install(
 DIRECTORY   ${CMAKE_BINARY_DIR}/Resources/lib
 DESTINATION ${TARGETDIR_VER}
@@ -1018,9 +1023,7 @@ elseif(APPLE)
 # Change it to support multiple rpaths.
 COMMAND xcrun install_name_tool -change 
"@executable_path/../Resources/lib/libomp.dylib" "@rpath/libomp.dylib" 
"$"
 # For installation into site-packages.
-COMMAND xcrun install_name_tool -add_rpath 
"@loader_path/../Resources/${TARGETDIR_VER}/lib" "$"
-# For in-build-folder experiments.
-COMMAND xcrun install_name_tool -add_rpath 
"@loader_path/${TARGETDIR_VER}/lib" "$"
+COMMAND xcrun install_name_tool -add_rpath 
"@loader_path/../Resources/${BLENDER_VERSION}/lib" "$"
   )
 endif()
   endif()
@@ -1055,13 +1058,12 @@ elseif(APPLE)
 unset(_py_inc_suffix)
   endif()
   if(WITH_PYTHON_MODULE)
-install(
-  TARGETS blender
-  LIBRARY DESTINATION ${PYTHON_LIBPATH}/site-packages
-)
-install_dir(
-  ${CMAKE_INSTALL_PREFIX}/${TARGETDIR_VER}
-  ${PYTHON_LIBPATH}/Resources)
+if(INSTALL_BPY_TO_SITE_PACKAGES)
+  install(
+TARGETS blender
+LIBRARY DESTINATION ${PYTHON_LIBPATH}/site-packages
+  )
+endif()
   endif()
 
   if(WITH_DRACO)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [77ac67dae4b] master: Cleanup/CMake: remove trailing `/`; whitespace.

2021-03-29 Thread Ankit Meel
Commit: 77ac67dae4bcbcd861b1ab15aa22fab769bb0e0c
Author: Ankit Meel
Date:   Mon Mar 29 22:24:33 2021 +0530
Branches: master
https://developer.blender.org/rB77ac67dae4bcbcd861b1ab15aa22fab769bb0e0c

Cleanup/CMake: remove trailing `/`; whitespace.

===

M   build_files/cmake/platform/platform_apple.cmake

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index af745db63b5..c4caff74966 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -146,7 +146,7 @@ if(WITH_PYTHON)
 
 set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}")
 set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}")
-set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}/")
+set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}")
 # set(PYTHON_LIBRARY python${PYTHON_VERSION})
 # set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python")  # won't  
build with this enabled
 
@@ -413,7 +413,7 @@ if(WITH_OPENMP)
 set(OpenMP_LINKER_FLAGS "-L'${LIBDIR}/openmp/lib' -lomp")
 
 # Copy libomp.dylib to allow executables like datatoc and tests to work.
-# `@executable_path/../Resources/lib/` `LC_ID_DYLIB`is added by the deps 
builder.
+# `@executable_path/../Resources/lib/` `LC_ID_DYLIB` is added by the deps 
builder.
 # For single config generator datatoc, tests etc.
 execute_process(
   COMMAND mkdir -p ${CMAKE_BINARY_DIR}/Resources/lib

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0ec82477af9] master: macOS/bpy: install into site-packages

2021-03-26 Thread Ankit Meel
Commit: 0ec82477af9bc55e933694300ccd9666fd9534de
Author: Ankit Meel
Date:   Sat Mar 27 01:14:45 2021 +0530
Branches: master
https://developer.blender.org/rB0ec82477af9bc55e933694300ccd9666fd9534de

macOS/bpy: install into site-packages

Reviewed By: #platform_macos, brecht
Maniphest Tasks: T86579
Differential Revision: https://developer.blender.org/D10664

===

M   build_files/cmake/platform/platform_apple.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/cmake/platform/platform_apple.cmake 
b/build_files/cmake/platform/platform_apple.cmake
index 6276032d85c..af745db63b5 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -146,7 +146,7 @@ if(WITH_PYTHON)
 
 set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}")
 set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}")
-set(PYTHON_LIBPATH 
"${_py_framework}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}")
+set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}/")
 # set(PYTHON_LIBRARY python${PYTHON_VERSION})
 # set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python")  # won't  
build with this enabled
 
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 07bc1d5d83d..43533d55f55 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1054,6 +1054,15 @@ elseif(APPLE)
 )
 unset(_py_inc_suffix)
   endif()
+  if(WITH_PYTHON_MODULE)
+install(
+  TARGETS blender
+  LIBRARY DESTINATION ${PYTHON_LIBPATH}/site-packages
+)
+install_dir(
+  ${CMAKE_INSTALL_PREFIX}/${TARGETDIR_VER}
+  ${PYTHON_LIBPATH}/Resources)
+  endif()
 
   if(WITH_DRACO)
 install(

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [ad31b13f91e] master: macOS/bpy: add support for OpenMP

2021-03-26 Thread Ankit Meel
Commit: ad31b13f91e40b40d75222923ac48f6682476b0c
Author: Ankit Meel
Date:   Sat Mar 27 01:08:51 2021 +0530
Branches: master
https://developer.blender.org/rBad31b13f91e40b40d75222923ac48f6682476b0c

macOS/bpy: add support for OpenMP

Changes made:
* Add OpenMP linker flags.
* Copy the libomp.dylib to `2.93/lib/libomp.dylib`.
* Change the `LC_LOAD_DYLIB` item such that
  the lib is found at `bpy.so/../../Resources/2.93/lib/libomp.dylib`.
Installation is done by D10664.

Reviewed By: #platform_macos, brecht
Maniphest Tasks: T86579
Differential Revision: https://developer.blender.org/D10657

===

M   CMakeLists.txt
M   source/creator/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2743d2d334c..4d224eaf46c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1235,6 +1235,7 @@ if(WITH_OPENMP)
   string(APPEND CMAKE_C_FLAGS " ${OpenMP_C_FLAGS}")
   string(APPEND CMAKE_CXX_FLAGS " ${OpenMP_CXX_FLAGS}")
   string(APPEND CMAKE_EXE_LINKER_FLAGS " ${OpenMP_LINKER_FLAGS}")
+  string(APPEND CMAKE_MODULE_LINKER_FLAGS " ${OpenMP_LINKER_FLAGS}")
 else()
   # Typically avoid adding flags as defines but we can't
   # pass OpenMP flags to the linker for static builds, meaning
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index c7b940d0012..07bc1d5d83d 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1005,6 +1005,24 @@ elseif(APPLE)
   FILES ${LIBDIR}/openmp/lib/libomp.dylib
   DESTINATION Blender.app/Contents/Resources/lib
 )
+if(WITH_PYTHON_MODULE)
+  # Move the dylib in a Blender version folder to keep the corresponding 
OpenMP version.
+  # Also for easy copying of a single folder, `TARGETDIR_VER` to 
site-packages
+  # during installation.
+  install(
+DIRECTORY   ${CMAKE_BINARY_DIR}/Resources/lib
+DESTINATION ${TARGETDIR_VER}
+  )
+  add_custom_command(TARGET blender POST_BUILD
+# The old `LC_LOAD_DYLIB` is the `LC_ID_DYLIB` of the LIBDIR OpenMP 
dylib.
+# Change it to support multiple rpaths.
+COMMAND xcrun install_name_tool -change 
"@executable_path/../Resources/lib/libomp.dylib" "@rpath/libomp.dylib" 
"$"
+# For installation into site-packages.
+COMMAND xcrun install_name_tool -add_rpath 
"@loader_path/../Resources/${TARGETDIR_VER}/lib" "$"
+# For in-build-folder experiments.
+COMMAND xcrun install_name_tool -add_rpath 
"@loader_path/${TARGETDIR_VER}/lib" "$"
+  )
+endif()
   endif()
 
   if(WITH_LLVM AND NOT LLVM_STATIC)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0083a7615eb] master: Revert "Cleanup: Fix unused-private-field warning."

2021-03-25 Thread Ankit Meel
Commit: 0083a7615eb4928f470c6400bfc52af8154d4ef0
Author: Ankit Meel
Date:   Thu Mar 25 17:23:46 2021 +0530
Branches: master
https://developer.blender.org/rB0083a7615eb4928f470c6400bfc52af8154d4ef0

Revert "Cleanup: Fix unused-private-field warning."

This reverts commit 43c48965d7cf87dd00ccf8714d2f6d08ffa4c474.
It created a new warning on GCC: -Wattribute (ignored attribute) as
GCC doesn't warn about unused private fields.

===

M   source/blender/editors/space_outliner/tree/tree_element_overrides.hh

===

diff --git 
a/source/blender/editors/space_outliner/tree/tree_element_overrides.hh 
b/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
index 4f7025610ed..b5c772f5b33 100644
--- a/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
+++ b/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
@@ -39,7 +39,7 @@ class TreeElementOverridesBase final : public 
AbstractTreeElement {
 };
 
 class TreeElementOverridesProperty final : public AbstractTreeElement {
-  [[maybe_unused]] ID _;
+  ID _;
   IDOverrideLibraryProperty _prop_;
 
  public:

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [43c48965d7c] master: Cleanup: Fix unused-private-field warning.

2021-03-24 Thread Ankit Meel
Commit: 43c48965d7cf87dd00ccf8714d2f6d08ffa4c474
Author: Ankit Meel
Date:   Wed Mar 24 22:45:43 2021 +0530
Branches: master
https://developer.blender.org/rB43c48965d7cf87dd00ccf8714d2f6d08ffa4c474

Cleanup: Fix unused-private-field warning.

===

M   source/blender/editors/space_outliner/tree/tree_element_overrides.hh

===

diff --git 
a/source/blender/editors/space_outliner/tree/tree_element_overrides.hh 
b/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
index b5c772f5b33..4f7025610ed 100644
--- a/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
+++ b/source/blender/editors/space_outliner/tree/tree_element_overrides.hh
@@ -39,7 +39,7 @@ class TreeElementOverridesBase final : public 
AbstractTreeElement {
 };
 
 class TreeElementOverridesProperty final : public AbstractTreeElement {
-  ID _;
+  [[maybe_unused]] ID _;
   IDOverrideLibraryProperty _prop_;
 
  public:

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [2600b27d264] master: Cleanup/CMake: Fix comment, sort order of options.

2021-03-23 Thread Ankit Meel
Commit: 2600b27d2647acfc9ddc19084b10db673b46a95a
Author: Ankit Meel
Date:   Tue Mar 23 12:11:46 2021 +0530
Branches: master
https://developer.blender.org/rB2600b27d2647acfc9ddc19084b10db673b46a95a

Cleanup/CMake: Fix comment, sort order of options.

===

M   CMakeLists.txt
M   build_files/cmake/config/blender_developer.cmake
M   build_files/cmake/config/blender_full.cmake
M   build_files/cmake/config/blender_headless.cmake
M   build_files/cmake/config/blender_lite.cmake
M   build_files/cmake/config/blender_release.cmake
M   build_files/cmake/config/bpy_module.cmake
M   build_files/cmake/platform/platform_apple.cmake
M   release/scripts/addons_contrib

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f30b946aca..2743d2d334c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1955,10 +1955,10 @@ if(FIRST_RUN)
   info_cfg_option(WITH_JACK)
   info_cfg_option(WITH_JACK_DYNLOAD)
   info_cfg_option(WITH_OPENAL)
-  info_cfg_option(WITH_SDL)
-  info_cfg_option(WITH_SDL_DYNLOAD)
   info_cfg_option(WITH_PULSEAUDIO)
   info_cfg_option(WITH_PULSEAUDIO_DYNLOAD)
+  info_cfg_option(WITH_SDL)
+  info_cfg_option(WITH_SDL_DYNLOAD)
   info_cfg_option(WITH_WASAPI)
 
   info_cfg_text("Compression:")
diff --git a/build_files/cmake/config/blender_developer.cmake 
b/build_files/cmake/config/blender_developer.cmake
index 29092b8c7c8..94f87a2d362 100644
--- a/build_files/cmake/config/blender_developer.cmake
+++ b/build_files/cmake/config/blender_developer.cmake
@@ -9,10 +9,10 @@ set(WITH_BUILDINFOOFF CACHE BOOL "" FORCE)
 set(WITH_COMPILER_ASANON  CACHE BOOL "" FORCE)
 set(WITH_CYCLES_DEBUG ON  CACHE BOOL "" FORCE)
 set(WITH_CYCLES_NATIVE_ONLY   ON  CACHE BOOL "" FORCE)
+set(WITH_DOC_MANPAGE  OFF CACHE BOOL "" FORCE)
 set(WITH_GTESTS   ON  CACHE BOOL "" FORCE)
 set(WITH_LIBMV_SCHUR_SPECIALIZATIONS  OFF CACHE BOOL "" FORCE)
 set(WITH_PYTHON_SAFETYON  CACHE BOOL "" FORCE)
-set(WITH_DOC_MANPAGE  OFF CACHE BOOL "" FORCE)
 if(WIN32)
   set(WITH_WINDOWS_BUNDLE_CRT OFF CACHE BOOL "" FORCE)
 endif()
diff --git a/build_files/cmake/config/blender_full.cmake 
b/build_files/cmake/config/blender_full.cmake
index 7d8ca9ec98d..ee6413774aa 100644
--- a/build_files/cmake/config/blender_full.cmake
+++ b/build_files/cmake/config/blender_full.cmake
@@ -37,6 +37,7 @@ set(WITH_LZO ON  CACHE BOOL "" FORCE)
 set(WITH_MOD_FLUID   ON  CACHE BOOL "" FORCE)
 set(WITH_MOD_OCEANSIMON  CACHE BOOL "" FORCE)
 set(WITH_MOD_REMESH  ON  CACHE BOOL "" FORCE)
+set(WITH_NANOVDB ON  CACHE BOOL "" FORCE)
 set(WITH_OPENAL  ON  CACHE BOOL "" FORCE)
 set(WITH_OPENCOLLADA ON  CACHE BOOL "" FORCE)
 set(WITH_OPENCOLORIO ON  CACHE BOOL "" FORCE)
@@ -47,8 +48,6 @@ set(WITH_OPENVDB ON  CACHE BOOL "" FORCE)
 set(WITH_OPENVDB_BLOSC   ON  CACHE BOOL "" FORCE)
 set(WITH_POTRACE ON  CACHE BOOL "" FORCE)
 set(WITH_PUGIXML ON  CACHE BOOL "" FORCE)
-set(WITH_NANOVDB ON  CACHE BOOL "" FORCE)
-set(WITH_POTRACE ON  CACHE BOOL "" FORCE)
 set(WITH_PYTHON_INSTALL  ON  CACHE BOOL "" FORCE)
 set(WITH_QUADRIFLOW  ON  CACHE BOOL "" FORCE)
 set(WITH_SDL ON  CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_headless.cmake 
b/build_files/cmake/config/blender_headless.cmake
index 72921c0e390..83253b28afc 100644
--- a/build_files/cmake/config/blender_headless.cmake
+++ b/build_files/cmake/config/blender_headless.cmake
@@ -10,14 +10,14 @@ set(WITH_HEADLESSON  CACHE BOOL "" FORCE)
 # disable audio, its possible some devs may want this but for now disable
 # so the python module doesn't hold the audio device and loads quickly.
 set(WITH_AUDASPACE   OFF CACHE BOOL "" FORCE)
+set(WITH_CODEC_FFMPEGOFF CACHE BOOL "" FORCE)
+set(WITH_CODEC_SNDFILE   OFF CACHE BOOL "" FORCE)
 set(WITH_COREAUDIO   OFF CACHE BOOL "" FORCE)
 set(WITH_JACKOFF CACHE BOOL "" FORCE)
+set(WITH_OPENAL  OFF CACHE BOOL "" FORCE)
 set(WITH_PULSEAUDIO  OFF CACHE BOOL "" FORCE)
 set(WITH_SDL OFF CACHE BOOL "" FORCE)
-set(WITH_OPENAL  OFF CACHE BOOL "" FORCE)
 set(WITH_WASAPI  OFF CACHE BOOL "" FORCE)
-set(WITH_CODEC_FFMPEGOFF CACHE BOOL "&quo

[Bf-blender-cvs] [448cb5d55b1] master: CMake/guardedalloc: add header file to TEST_SRC

2021-03-14 Thread Ankit Meel
Commit: 448cb5d55b119d8030cfef078952fdca373bb3e8
Author: Ankit Meel
Date:   Sun Mar 14 18:11:24 2021 +0530
Branches: master
https://developer.blender.org/rB448cb5d55b119d8030cfef078952fdca373bb3e8

CMake/guardedalloc: add header file to TEST_SRC

===

M   intern/guardedalloc/CMakeLists.txt

===

diff --git a/intern/guardedalloc/CMakeLists.txt 
b/intern/guardedalloc/CMakeLists.txt
index b47565b8ef9..88c6e7ca2c5 100644
--- a/intern/guardedalloc/CMakeLists.txt
+++ b/intern/guardedalloc/CMakeLists.txt
@@ -77,6 +77,7 @@ if(WITH_GTESTS)
   set(TEST_SRC
 tests/guardedalloc_alignment_test.cc
 tests/guardedalloc_overflow_test.cc
+tests/guardedalloc_test_base.h
   )
   set(TEST_INC
 ../../source/blender/blenlib

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [fced6f19be4] tmp-vulkan: Attempt 2 to silence warning.

2021-03-11 Thread Ankit Meel
Commit: fced6f19be49de9024de2c0fa657f1849dfb54a8
Author: Ankit Meel
Date:   Fri Mar 12 00:41:13 2021 +0530
Branches: tmp-vulkan
https://developer.blender.org/rBfced6f19be49de9024de2c0fa657f1849dfb54a8

Attempt 2 to silence warning.

===

M   source/blender/gpu/CMakeLists.txt

===

diff --git a/source/blender/gpu/CMakeLists.txt 
b/source/blender/gpu/CMakeLists.txt
index 60071741e86..2b22ce64478 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -419,6 +419,13 @@ endif()
 
 blender_add_lib(bf_gpu "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
 
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+  target_compile_options(bf_gpu
+PRIVATE "-Wno-nullability-completeness"
+  )
+endif()
+
+
 if(WITH_GTESTS)
   if(WITH_OPENGL_DRAW_TESTS)
 set(TEST_SRC

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [402e19ddc82] tmp-vulkan: Attempt to silence warning.

2021-03-11 Thread Ankit Meel
Commit: 402e19ddc82c76963d83f5d4be0a99f2dd0fd70d
Author: Ankit Meel
Date:   Fri Mar 12 00:37:55 2021 +0530
Branches: tmp-vulkan
https://developer.blender.org/rB402e19ddc82c76963d83f5d4be0a99f2dd0fd70d

Attempt to silence warning.

===

M   extern/vulkan_memory_allocator/CMakeLists.txt

===

diff --git a/extern/vulkan_memory_allocator/CMakeLists.txt 
b/extern/vulkan_memory_allocator/CMakeLists.txt
index b85255e800a..e920a22cbb3 100644
--- a/extern/vulkan_memory_allocator/CMakeLists.txt
+++ b/extern/vulkan_memory_allocator/CMakeLists.txt
@@ -18,13 +18,6 @@
 # All rights reserved.
 # * END GPL LICENSE BLOCK *
 
-# avoid noisy warnings
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
-  # This is not working! Find a way to suppress -Wnullability-completeness 
warnings
-  remove_cc_flag(
-"-Wnullability-completeness"
-  )
-endif()
 
 set(INC
   .
@@ -41,3 +34,9 @@ set(SRC
 )
 
 blender_add_lib(extern_vulkan_memory_allocator "${SRC}" "${INC}" "${INC_SYS}" 
"${LIB}")
+
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+  target_compile_options(extern_vulkan_memory_allocator
+PRIVATE "-Wno-nullability-completeness"
+  )
+endif()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7f07eff5881] master: Cryptomatte tests: Fix layer_from_manifest failure.

2021-03-10 Thread Ankit Meel
Commit: 7f07eff5881a6418a178399d082c6061ca88feae
Author: Ankit Meel
Date:   Wed Mar 10 20:13:20 2021 +0530
Branches: master
https://developer.blender.org/rB7f07eff5881a6418a178399d082c6061ca88feae

Cryptomatte tests: Fix layer_from_manifest failure.

Error in rBc6a831cfbc9b24fa8b1ed4852178c139e6ed79a6

===

M   source/blender/blenkernel/intern/cryptomatte_test.cc

===

diff --git a/source/blender/blenkernel/intern/cryptomatte_test.cc 
b/source/blender/blenkernel/intern/cryptomatte_test.cc
index faf1ad91cdc..7a86002cf6a 100644
--- a/source/blender/blenkernel/intern/cryptomatte_test.cc
+++ b/source/blender/blenkernel/intern/cryptomatte_test.cc
@@ -76,7 +76,7 @@ TEST(cryptomatte, layer_from_manifest)
 {
   test_cryptomatte_manifest("{}", "{}");
   test_cryptomatte_manifest(R"({"Object":"12345678"})", R"({"Object": 
"12345678"})");
-  test_cryptomatte_manifest(R"({"Object":"12345678","Object2":"87654321")})",
+  test_cryptomatte_manifest(R"({"Object":"12345678","Object2":"87654321"})",
 R"({"Object":"12345678","Object2":"87654321"})");
   test_cryptomatte_manifest(R"({"Object":"12345678","Object2":"87654321"})",
 R"(  {  "Object"  :  "12345678"  ,  "Object2"  :  
"87654321"  }  )");

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [cdb0b3cedc9] master: Compositor: Silence -Wself-assign

2021-03-09 Thread Ankit Meel
Commit: cdb0b3cedc9b242b75affadf0a0a33959320ab77
Author: Ankit Meel
Date:   Tue Mar 9 19:19:21 2021 +0530
Branches: master
https://developer.blender.org/rBcdb0b3cedc9b242b75affadf0a0a33959320ab77

Compositor: Silence -Wself-assign

Use member initializer list for constructor.
Use `this->` for member function.
Introduced in rBef53859d24a9720882e3ca6c5415faefec6fb82c

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10653

===

M   source/blender/compositor/intern/COM_ChunkOrderHotspot.cc
M   source/blender/compositor/intern/COM_ChunkOrderHotspot.h

===

diff --git a/source/blender/compositor/intern/COM_ChunkOrderHotspot.cc 
b/source/blender/compositor/intern/COM_ChunkOrderHotspot.cc
index bbc98d086a6..d31ff518ecd 100644
--- a/source/blender/compositor/intern/COM_ChunkOrderHotspot.cc
+++ b/source/blender/compositor/intern/COM_ChunkOrderHotspot.cc
@@ -19,18 +19,11 @@
 #include "COM_ChunkOrderHotspot.h"
 #include 
 
-ChunkOrderHotspot::ChunkOrderHotspot(int x, int y, float addition)
-{
-  x = x;
-  y = y;
-  addition = addition;
-}
-
 double ChunkOrderHotspot::calc_distance(int x, int y)
 {
-  int dx = x - x;
-  int dy = y - y;
+  int dx = this->x - x;
+  int dy = this->y - y;
   double result = sqrt((double)(dx * dx + dy * dy));
-  result += (double)addition;
+  result += (double)this->addition;
   return result;
 }
diff --git a/source/blender/compositor/intern/COM_ChunkOrderHotspot.h 
b/source/blender/compositor/intern/COM_ChunkOrderHotspot.h
index af0cf897673..d7f40921836 100644
--- a/source/blender/compositor/intern/COM_ChunkOrderHotspot.h
+++ b/source/blender/compositor/intern/COM_ChunkOrderHotspot.h
@@ -27,8 +27,9 @@ struct ChunkOrderHotspot {
   int y;
   float addition;
 
- public:
-  ChunkOrderHotspot(int x, int y, float addition);
+  ChunkOrderHotspot(int x, int y, float addition) : x(x), y(y), 
addition(addition)
+  {
+  }
 
   double calc_distance(int x, int y);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [be6b3923f57] master: Compositor: silence clang/clang-tidy override warnings

2021-03-09 Thread Ankit Meel
Commit: be6b3923f5732e3da9d1ef432c092d90f9343fdf
Author: Ankit Meel
Date:   Tue Mar 9 19:19:08 2021 +0530
Branches: master
https://developer.blender.org/rBbe6b3923f5732e3da9d1ef432c092d90f9343fdf

Compositor: silence clang/clang-tidy override warnings

`-Winconsistent-missing-override` and `modernize-use-override`.

Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10654

===

M   source/blender/compositor/operations/COM_MultilayerImageOperation.h

===

diff --git 
a/source/blender/compositor/operations/COM_MultilayerImageOperation.h 
b/source/blender/compositor/operations/COM_MultilayerImageOperation.h
index f5176b0a4db..bfc59cabdbf 100644
--- a/source/blender/compositor/operations/COM_MultilayerImageOperation.h
+++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.h
@@ -28,7 +28,7 @@ class MultilayerBaseOperation : public BaseImageOperation {
  protected:
   RenderLayer *m_renderLayer;
   RenderPass *m_renderPass;
-  ImBuf *getImBuf();
+  ImBuf *getImBuf() override;
 
  public:
   /**
@@ -44,7 +44,7 @@ class MultilayerColorOperation : public 
MultilayerBaseOperation {
   {
 this->addOutputSocket(COM_DT_COLOR);
   }
-  void executePixelSampled(float output[4], float x, float y, PixelSampler 
sampler);
+  void executePixelSampled(float output[4], float x, float y, PixelSampler 
sampler) override;
   std::unique_ptr getMetaData() const override;
 };
 
@@ -55,7 +55,7 @@ class MultilayerValueOperation : public 
MultilayerBaseOperation {
   {
 this->addOutputSocket(COM_DT_VALUE);
   }
-  void executePixelSampled(float output[4], float x, float y, PixelSampler 
sampler);
+  void executePixelSampled(float output[4], float x, float y, PixelSampler 
sampler) override;
 };
 
 class MultilayerVectorOperation : public MultilayerBaseOperation {
@@ -65,5 +65,5 @@ class MultilayerVectorOperation : public 
MultilayerBaseOperation {
   {
 this->addOutputSocket(COM_DT_VECTOR);
   }
-  void executePixelSampled(float output[4], float x, float y, PixelSampler 
sampler);
+  void executePixelSampled(float output[4], float x, float y, PixelSampler 
sampler) override;
 };

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [67856d8c4af] master: macOS/GTests: add_dependencies to fix build error

2021-03-03 Thread Ankit Meel
Commit: 67856d8c4afa6a35b15f00ce24ebe54f403c9fc7
Author: Ankit Meel
Date:   Thu Mar 4 08:04:17 2021 +0530
Branches: master
https://developer.blender.org/rB67856d8c4afa6a35b15f00ce24ebe54f403c9fc7

macOS/GTests: add_dependencies to fix build error

When building `install`, linking blender_test fails because
test libraries do not exist. This happened on lite + Xcode. Error in
{rBdcb2821292f962951e88f146cb304160f21f73da}.

Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10607

===

M   tests/gtests/runner/CMakeLists.txt

===

diff --git a/tests/gtests/runner/CMakeLists.txt 
b/tests/gtests/runner/CMakeLists.txt
index 1fe8cf21810..b18eff59016 100644
--- a/tests/gtests/runner/CMakeLists.txt
+++ b/tests/gtests/runner/CMakeLists.txt
@@ -82,6 +82,7 @@ elseif(APPLE)
   # are used as dependencies of other test libraries.
   foreach(_lib ${_test_libs})
 list(REMOVE_ITEM _test_libs_dependencies ${_lib})
+add_dependencies(blender_test ${_lib})
 target_link_options(blender_test PRIVATE 
"LINKER:-force_load,$")
   endforeach()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9fe53bd4a1a] master: Build Environment/macOS/Python: link against zlib statically

2021-02-22 Thread Ankit Meel
Commit: 9fe53bd4a1ac0eaa63fcf1ebd151fe4db0411b49
Author: Ankit Meel
Date:   Tue Feb 23 08:34:33 2021 +0530
Branches: master
https://developer.blender.org/rB9fe53bd4a1ac0eaa63fcf1ebd151fe4db0411b49

Build Environment/macOS/Python: link against zlib statically

rBc70eb30240f8b5d5a8f2ac509f0eb585936142b5 added patch to use static
zlib on Linux. But also added flags to use the zlib in LIBDIR for
Python on macOS. That causes some shared libraries (binascii for one)
to link against libz.1.dylib which will not be there on users' systems.
Reuse the said patch for macOS also to avoid rpath issues.

Fix T85648.
Reviewed By: #platform_macos, brecht
Differential Revision: https://developer.blender.org/D10479

===

M   build_files/build_environment/cmake/python.cmake
R100build_files/build_environment/patches/python_linux.diff 
build_files/build_environment/patches/python_unix.diff

===

diff --git a/build_files/build_environment/cmake/python.cmake 
b/build_files/build_environment/cmake/python.cmake
index 5731a0e0ae8..fa1498dda82 100644
--- a/build_files/build_environment/cmake/python.cmake
+++ b/build_files/build_environment/cmake/python.cmake
@@ -77,9 +77,9 @@ else()
   else()
 set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
 set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
-set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d 
${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
   endif()
-
+  # Link against zlib statically (Unix). Avoid rpath issues (macOS).
+  set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d 
${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_unix.diff)
   set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
   set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include 
-I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
   set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib 
-L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib")
diff --git a/build_files/build_environment/patches/python_linux.diff 
b/build_files/build_environment/patches/python_unix.diff
similarity index 100%
rename from build_files/build_environment/patches/python_linux.diff
rename to build_files/build_environment/patches/python_unix.diff

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [9abc78c3f2a] soc-2020-io-performance: Writer: some tests

2021-02-22 Thread Ankit Meel
Commit: 9abc78c3f2a75d54a05a1b8c32713c15261e220e
Author: Ankit Meel
Date:   Wed Dec 16 18:08:36 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB9abc78c3f2a75d54a05a1b8c32713c15261e220e

Writer: some tests

===

M   source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc

===

diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc 
b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
index 8ed6efdd7ae..bf9b47514b9 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -1,18 +1,25 @@
 /* Apache License, Version 2.0 */
 
+#include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include "testing/testing.h"
 #include "tests/blendfile_loading_base_test.h"
 
+#include "BKE_blender_version.h"
+
 #include "BLI_index_range.hh"
 #include "BLI_string_utf8.h"
 #include "BLI_vector.hh"
 
 #include "DEG_depsgraph.h"
 
+#include "obj_export_file_writer.hh"
 #include "obj_export_mesh.hh"
 #include "obj_export_nurbs.hh"
 #include "obj_exporter.hh"
@@ -43,6 +50,8 @@ const std::string all_objects_file = 
"io_tests/blend_scene/all_objects_2_92.blen
 // https://developer.blender.org/F9278970
 const std::string all_curve_objects_file = 
"io_tests/blend_scene/all_curves_2_92.blend";
 
+const std::string some_meshes_file = "io_tests/blend_scene/all_meshes.blend";
+
 TEST_F(obj_exporter_test, filter_objects_curves_as_mesh)
 {
   OBJExportParamsDefault _export;
@@ -162,4 +171,62 @@ TEST_F(obj_exporter_test, curve_coordinates)
 }
   }
 }
+
+static std::unique_ptr init_writer(const OBJExportParams ,
+  const std::string out_filepath)
+{
+  try {
+auto writer = std::make_unique(out_filepath.c_str(), params);
+return writer;
+  }
+  catch (const std::system_error ) {
+std::cerr << ex.code().category().name() << ": " << ex.what() << ": " << 
ex.code().message()
+  << std::endl;
+return nullptr;
+  }
+}
+
+const char *const temp_file_path =
+"/Users/ankitkumar/blender-build/build_darwin_lite/Testing/output.OBJ";
+
+static std::string read_temp_file_in_string(const std::string _path)
+{
+  std::ifstream temp_stream(file_path);
+  std::ostringstream input_ss;
+  input_ss << temp_stream.rdbuf();
+  return input_ss.str();
+}
+
+TEST_F(obj_exporter_test, header)
+{
+  {
+OBJExportParamsDefault _export;
+std::unique_ptr writer = init_writer(_export.params, 
temp_file_path);
+if (!writer) {
+  ADD_FAILURE();
+  return;
+}
+writer->write_header();
+  }
+  const std::string result = read_temp_file_in_string(temp_file_path);
+  using namespace std::string_literals;
+  ASSERT_EQ(result, "# Blender "s + BKE_blender_version_string() + "\n" + "# 
www.blender.org\n");
+}
+
+TEST_F(obj_exporter_test, mtllib)
+{
+  {
+OBJExportParamsDefault _export;
+std::unique_ptr writer = init_writer(_export.params, 
temp_file_path);
+if (!writer) {
+  ADD_FAILURE();
+  return;
+}
+writer->write_mtllib_name("/Users/blah.mtl");
+writer->write_mtllib_name("\\C:\\blah.mtl");
+  }
+  const std::string result = read_temp_file_in_string(temp_file_path);
+  ASSERT_EQ(result, "mtllib blah.mtl\nmtllib blah.mtl\n");
+}
+
 }  // namespace blender::io::obj

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3ce42cb9596] soc-2020-io-performance: Cleanup

2021-02-22 Thread Ankit Meel
Commit: 3ce42cb9596f15707b2dcaed299cc083f70cbe3c
Author: Ankit Meel
Date:   Wed Dec 16 18:08:42 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB3ce42cb9596f15707b2dcaed299cc083f70cbe3c

Cleanup

===

M   source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc

===

diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc 
b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
index bf9b47514b9..eec9749b443 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -92,7 +92,7 @@ TEST_F(obj_exporter_test, filter_objects_selected)
   EXPECT_EQ(objcurves.size(), 2);
 }
 
-TEST(obj_exporter_test_utils, append_negative_frame_to_filename)
+TEST(obj_exporter_utils, append_negative_frame_to_filename)
 {
   const char path_original[FILE_MAX] = "/my_file.obj";
   const char path_truth[FILE_MAX] = "/my_file-123.obj";
@@ -103,7 +103,7 @@ TEST(obj_exporter_test_utils, 
append_negative_frame_to_filename)
   EXPECT_EQ_ARRAY(path_with_frame, path_truth, BLI_strlen_utf8(path_truth));
 }
 
-TEST(obj_exporter_test_utils, append_positive_frame_to_filename)
+TEST(obj_exporter_utils, append_positive_frame_to_filename)
 {
   const char path_original[FILE_MAX] = "/my_file.obj";
   const char path_truth[FILE_MAX] = "/my_file123.obj";
@@ -197,7 +197,7 @@ static std::string read_temp_file_in_string(const 
std::string _path)
   return input_ss.str();
 }
 
-TEST_F(obj_exporter_test, header)
+TEST(obj_exporter_writer, header)
 {
   {
 OBJExportParamsDefault _export;
@@ -213,7 +213,7 @@ TEST_F(obj_exporter_test, header)
   ASSERT_EQ(result, "# Blender "s + BKE_blender_version_string() + "\n" + "# 
www.blender.org\n");
 }
 
-TEST_F(obj_exporter_test, mtllib)
+TEST(obj_exporter_writer, mtllib)
 {
   {
 OBJExportParamsDefault _export;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a9cf4042237] soc-2020-io-performance: Cleanup: fix typos

2021-02-22 Thread Ankit Meel
Commit: a9cf40422375af986c011830a81c8939ffb34627
Author: Ankit Meel
Date:   Tue Dec 15 23:43:52 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rBa9cf40422375af986c011830a81c8939ffb34627

Cleanup: fix typos

===

M   source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
M   source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
M   source/blender/io/wavefront_obj/exporter/obj_exporter.cc

===

diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc 
b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
index 7a77095aad8..a79166b3d66 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
@@ -120,7 +120,7 @@ void OBJWriter::write_vert_indices(Span vert_indices,
   file_handler_->write();
 }
 
-void OBJWriter::writer_header() const
+void OBJWriter::write_header() const
 {
   using namespace std::string_literals;
   file_handler_->write("# Blender "s + 
BKE_blender_version_string() +
@@ -310,10 +310,10 @@ int16_t OBJWriter::write_vertex_group(const OBJMesh 
_mesh_data,
  * \return Writer function with appropriate polygon-element syntax.
  */
 OBJWriter::func_vert_uv_normal_indices OBJWriter::get_poly_element_writer(
-const OBJMesh _mesh_data) const
+const int total_uv_vertices) const
 {
   if (export_params_.export_normals) {
-if (export_params_.export_uv && (obj_mesh_data.tot_uv_vertices() > 0)) {
+if (export_params_.export_uv && (total_uv_vertices > 0)) {
   /* Write both normals and UV indices. */
   return ::write_vert_uv_normal_indices;
 }
@@ -321,7 +321,7 @@ OBJWriter::func_vert_uv_normal_indices 
OBJWriter::get_poly_element_writer(
 return ::write_vert_normal_indices;
   }
   /* Write UV indices. */
-  if (export_params_.export_uv && (obj_mesh_data.tot_uv_vertices() > 0)) {
+  if (export_params_.export_uv && (total_uv_vertices > 0)) {
 return ::write_vert_uv_indices;
   }
   /* Write neither normals nor UV indices. */
@@ -339,7 +339,8 @@ void OBJWriter::write_poly_elements(const OBJMesh 
_mesh_data)
   int16_t last_poly_vertex_group = NEGATIVE_INIT;
   int16_t last_poly_mat_nr = NEGATIVE_INIT;
 
-  const func_vert_uv_normal_indices poly_element_writer = 
get_poly_element_writer(obj_mesh_data);
+  const func_vert_uv_normal_indices poly_element_writer = 
get_poly_element_writer(
+  obj_mesh_data.tot_uv_vertices());
 
   /* Number of normals may not be equal to number of polygons due to smooth 
shading. */
   int per_object_tot_normals = 0;
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh 
b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
index e30ea39638c..b882a28bd0f 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
@@ -62,7 +62,7 @@ class OBJWriter : NonMovable, NonCopyable {
 file_handler_ = std::make_unique>(filepath);
   }
 
-  void writer_header() const;
+  void write_header() const;
 
   void write_object_name(const OBJMesh _mesh_data) const;
   void write_object_group(const OBJMesh _mesh_data) const;
@@ -89,7 +89,7 @@ class OBJWriter : NonMovable, NonCopyable {
   using func_vert_uv_normal_indices = void (OBJWriter::*)(Span 
vert_indices,
   Span uv_indices,
   Span 
normal_indices) const;
-  func_vert_uv_normal_indices get_poly_element_writer(const OBJMesh 
_mesh_data) const;
+  func_vert_uv_normal_indices get_poly_element_writer(const int 
total_uv_vertices) const;
 
   void write_vert_uv_normal_indices(Span vert_indices,
 Span uv_indices,
diff --git a/source/blender/io/wavefront_obj/exporter/obj_exporter.cc 
b/source/blender/io/wavefront_obj/exporter/obj_exporter.cc
index 06a92285f1a..28d9c97d30b 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_exporter.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_exporter.cc
@@ -228,7 +228,7 @@ static void export_frame(Depsgraph *depsgraph,
 return;
   }
 
-  frame_writer->writer_header();
+  frame_writer->write_header();
 
   auto [exportable_as_mesh, exportable_as_nurbs] = 
filter_supported_objects(depsgraph,
 
export_params);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [29d51498437] soc-2020-io-performance: Tests: Cleanup

2021-02-22 Thread Ankit Meel
Commit: 29d514984379c319157de0e5bb42d87d179b760c
Author: Ankit Meel
Date:   Tue Dec 15 19:47:57 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB29d514984379c319157de0e5bb42d87d179b760c

Tests: Cleanup

===

M   source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc

===

diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc 
b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
index 7fd9f7c725b..8ed6efdd7ae 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -105,7 +105,7 @@ TEST(obj_exporter_test_utils, 
append_positive_frame_to_filename)
   EXPECT_EQ_ARRAY(path_with_frame, path_truth, BLI_strlen_utf8(path_truth));
 }
 
-TEST_F(obj_exporter_test, OBJCurve_nurbs_points)
+TEST_F(obj_exporter_test, curve_nurbs_points)
 {
   if (!load_file_and_depsgraph(all_curve_objects_file)) {
 ADD_FAILURE();
@@ -134,7 +134,7 @@ TEST_F(obj_exporter_test, OBJCurve_nurbs_points)
   }
 }
 
-TEST_F(obj_exporter_test, OBJCurve_coordinates)
+TEST_F(obj_exporter_test, curve_coordinates)
 {
   if (!load_file_and_depsgraph(all_curve_objects_file)) {
 ADD_FAILURE();

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [30def30420e] soc-2020-io-performance: Cleanup

2021-02-22 Thread Ankit Meel
Commit: 30def30420e61c1a2ba38a1a14b320580a014d10
Author: Ankit Meel
Date:   Sat Dec 12 20:47:53 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB30def30420e61c1a2ba38a1a14b320580a014d10

Cleanup

===

M   source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
M   source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
M   source/blender/io/wavefront_obj/exporter/obj_export_io.hh

===

diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc 
b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
index 4be07be14a9..7a77095aad8 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
@@ -464,7 +464,7 @@ static std::string float3_to_string(const float3 )
 /*
  * Create the .MTL file.
  */
-MTLWriter::MTLWriter(const char *obj_filepath)
+MTLWriter::MTLWriter(const char *obj_filepath) noexcept(false)
 {
   mtl_filepath_ = obj_filepath;
   const bool ok = BLI_path_extension_replace(mtl_filepath_.data(), FILE_MAX, 
".mtl");
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh 
b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
index b1f0e29f3d4..e30ea39638c 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.hh
@@ -56,7 +56,7 @@ class OBJWriter : NonMovable, NonCopyable {
   IndexOffsets index_offsets_{0, 0, 0};
 
  public:
-  OBJWriter(const char *filepath, const OBJExportParams _params)
+  OBJWriter(const char *filepath, const OBJExportParams _params) 
noexcept(false)
   : export_params_(export_params)
   {
 file_handler_ = std::make_unique>(filepath);
@@ -114,7 +114,7 @@ class MTLWriter : NonMovable, NonCopyable {
   std::string mtl_filepath_;
 
  public:
-  MTLWriter(const char *obj_filepath);
+  MTLWriter(const char *obj_filepath) noexcept(false);
 
   void write_header() const;
   StringRefNull mtl_file_path() const;
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_io.hh 
b/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
index 1665414b027..a51e94a38e5 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_io.hh
@@ -136,7 +136,7 @@ syntax_elem_to_formatting(const eOBJSyntaxElement key)
   return {"vn %f %f %f\n", 3, is_type_float};
 }
 case eOBJSyntaxElement::poly_element_begin: {
-  return {"f ", 0, is_type_string_related};
+  return {"f", 0, is_type_string_related};
 }
 case eOBJSyntaxElement::vertex_uv_normal_indices: {
   return {" %d/%d/%d", 3, is_type_integral};

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [7baf796886b] master: macOS Deps: NumPy: Remove buggy Accelerate framework

2021-02-15 Thread Ankit Meel
Commit: 7baf796886b26e638c87c8c6533b7dc6e9b3803c
Author: Ankit Meel
Date:   Tue Feb 16 00:47:50 2021 +0530
Branches: master
https://developer.blender.org/rB7baf796886b26e638c87c8c6533b7dc6e9b3803c

macOS Deps: NumPy: Remove buggy Accelerate framework

Building NumPy from source with default options of builder
causes it to link against Accelerate framework which is buggy and
raises a warning mentioned in [2].
"RankWarning: Polyfit may be poorly conditioned"
Accelerate is deprecated with NumPy 1.20+.[1]

So either we build OpenBLAS in dependencies also and set appropriate
env variables suggested in [1] while building NumPy for it to find
OpenBLAS. Or download NumPy wheel from pip and never allow pip to
build NumPy from source while installing.

After this change, pip wheels are used for NumPy for macOS with x86_64.

[1] https://numpy.org/doc/stable/user/building.html#lapack
[2] https://github.com/numpy/numpy/issues/15947
Reviewed By: #platform_macos, sebbas
Differential Revision: https://developer.blender.org/D10368

===

M   build_files/build_environment/CMakeLists.txt
M   build_files/build_environment/cmake/python_site_packages.cmake

===

diff --git a/build_files/build_environment/CMakeLists.txt 
b/build_files/build_environment/CMakeLists.txt
index 8d6fd3ab4c3..10dbc41bef4 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -86,9 +86,14 @@ include(cmake/tbb.cmake)
 include(cmake/openvdb.cmake)
 include(cmake/nanovdb.cmake)
 include(cmake/python.cmake)
+option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from 
source" OFF)
+if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
+  set(USE_PIP_NUMPY ON)
+else()
+  include(cmake/numpy.cmake)
+endif()
 include(cmake/python_site_packages.cmake)
 include(cmake/package_python.cmake)
-include(cmake/numpy.cmake)
 include(cmake/usd.cmake)
 include(cmake/potrace.cmake)
 include(cmake/haru.cmake)
diff --git a/build_files/build_environment/cmake/python_site_packages.cmake 
b/build_files/build_environment/cmake/python_site_packages.cmake
index a3b9c3bf796..2b75a6a244f 100644
--- a/build_files/build_environment/cmake/python_site_packages.cmake
+++ b/build_files/build_environment/cmake/python_site_packages.cmake
@@ -28,6 +28,15 @@ ExternalProject_Add(external_python_site_packages
   INSTALL_COMMAND ${PYTHON_BINARY} -m pip install ${SITE_PACKAGES_EXTRA} 
cython==${CYTHON_VERSION} idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} 
urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} 
requests==${REQUESTS_VERSION} --no-binary :all:
 )
 
+if(USE_PIP_NUMPY)
+  # Use only wheel (and not build from source) to stop NumPy from linking 
against buggy
+  # Accelerate framework backend on macOS. Official wheels are built with 
OpenBLAS.
+  ExternalProject_Add_Step(external_python_site_packages after_install
+COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir 
numpy==${NUMPY_VERSION} --only-binary :all:
+DEPENDEES install
+  )
+endif()
+
 add_dependencies(
   external_python_site_packages
   external_python

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


  1   2   3   4   5   6   7   >