From ebc9ace4259c71350582bafa8cc502a78866d8f4 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Fri, 9 Aug 2024 21:54:43 +0800
Subject: Download sse2neon.h automatically

---
 indra/llcommon/CMakeLists.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'indra/llcommon')

diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 38fd05fae6..9811e705a0 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -294,6 +294,16 @@ target_link_libraries(
 target_include_directories(llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
 target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
 
+if (CMAKE_OSX_ARCHITECTURES MATCHES "(x86_64;)*arm64(;x86_64)*")
+  execute_process(COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/include/sse2neon)
+  execute_process(COMMAND curl
+    -OL
+    https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h
+    WORKING_DIRECTORY ${AUTOBUILD_INSTALL_DIR}/include/sse2neon
+    )
+  target_include_directories(llcommon PUBLIC ${AUTOBUILD_INSTALL_DIR}/include/sse2neon)
+endif ()
+
 if (USE_AUTOBUILD_3P OR USE_CONAN)
 add_dependencies(llcommon stage_third_party_libs)
 else ()
-- 
cgit v1.2.3


From 0f72582a734dcd585627341ddb16678d18e373ac Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Mon, 12 Aug 2024 15:26:16 +0800
Subject: Don't redownload sse2neon if already installed

---
 indra/llcommon/CMakeLists.txt | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

(limited to 'indra/llcommon')

diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 9811e705a0..a62a72c79c 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -294,13 +294,19 @@ target_link_libraries(
 target_include_directories(llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
 target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
 
-if (CMAKE_OSX_ARCHITECTURES MATCHES "(x86_64;)*arm64(;x86_64)*")
-  execute_process(COMMAND mkdir -p ${AUTOBUILD_INSTALL_DIR}/include/sse2neon)
-  execute_process(COMMAND curl
-    -OL
-    https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h
-    WORKING_DIRECTORY ${AUTOBUILD_INSTALL_DIR}/include/sse2neon
-    )
+if (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
+  if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/sse2neon_installed OR NOT ${sse2neon_installed} EQUAL 0)
+    execute_process(
+      COMMAND mkdir -p include/sse2neon
+      WORKING_DIRECTORY ${AUTOBUILD_INSTALL_DIR}
+      )
+    execute_process(
+      COMMAND curl -OL https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h
+      WORKING_DIRECTORY ${AUTOBUILD_INSTALL_DIR}/include/sse2neon
+      RESULT_VARIABLE sse2neon_installed
+      )
+    file(WRITE ${PREBUILD_TRACKING_DIR}/sse2neon_installed "${sse2neon_installed}")
+  endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/sse2neon_installed OR NOT ${sse2neon_installed} EQUAL 0)
   target_include_directories(llcommon PUBLIC ${AUTOBUILD_INSTALL_DIR}/include/sse2neon)
 endif ()
 
-- 
cgit v1.2.3


From 3d2c32c80562106169b78305315e2bd5945fdf09 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Tue, 13 Aug 2024 11:29:14 +0800
Subject: CMake file & try_compile replacing execute_process

file(DOWNLOAD) replacing execute_process(COMMAND curl),
file(ARCHIVE_EXTRACT) replacing execute_process(COMMAND tar xf),
file(MAKE_DIRECTORY) replacing execute_process(COMMAND mkdir -p),
file(COPY) replacing execute_process(COMMAND cp),
file(RENAME) replacing execute_process(COMMAND mv),
try_compile replacing execute_process(COMMAND cmake/make),
LIBS_PREBUILT_DIR replacing AUTOBUILD_INSTALL_DIR,
0 replacing ${${_binary}_installed} where appropriate,
no FMOD reinstallation when it's already installed,
and archives & unarchived source/build directories are in CMake
root binary directory, instead of /tmp.
SHOW_PROGRESS is on for downloading Dullahan from the Megapahit
website cause it can be slow.
---
 indra/llcommon/CMakeLists.txt | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

(limited to 'indra/llcommon')

diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index a62a72c79c..41e2a6ebf3 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -296,18 +296,14 @@ target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
 
 if (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
   if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/sse2neon_installed OR NOT ${sse2neon_installed} EQUAL 0)
-    execute_process(
-      COMMAND mkdir -p include/sse2neon
-      WORKING_DIRECTORY ${AUTOBUILD_INSTALL_DIR}
+    file(MAKE_DIRECTORY ${LIBS_PREBUILT_DIR}/include/sse2neon)
+    file(DOWNLOAD
+      https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h
+      ${LIBS_PREBUILT_DIR}/include/sse2neon
       )
-    execute_process(
-      COMMAND curl -OL https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h
-      WORKING_DIRECTORY ${AUTOBUILD_INSTALL_DIR}/include/sse2neon
-      RESULT_VARIABLE sse2neon_installed
-      )
-    file(WRITE ${PREBUILD_TRACKING_DIR}/sse2neon_installed "${sse2neon_installed}")
+    file(WRITE ${PREBUILD_TRACKING_DIR}/sse2neon_installed "0")
   endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/sse2neon_installed OR NOT ${sse2neon_installed} EQUAL 0)
-  target_include_directories(llcommon PUBLIC ${AUTOBUILD_INSTALL_DIR}/include/sse2neon)
+  target_include_directories(llcommon PUBLIC ${LIBS_PREBUILT_DIR}/include/sse2neon)
 endif ()
 
 if (USE_AUTOBUILD_3P OR USE_CONAN)
-- 
cgit v1.2.3


From 39eb5087ab54328f8f066c251f68a2cde00ef16d Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Tue, 13 Aug 2024 14:50:17 +0800
Subject: Path to file for sse2neon, not just the directory

---
 indra/llcommon/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/llcommon')

diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 41e2a6ebf3..3c8c8031f2 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -299,7 +299,7 @@ if (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
     file(MAKE_DIRECTORY ${LIBS_PREBUILT_DIR}/include/sse2neon)
     file(DOWNLOAD
       https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h
-      ${LIBS_PREBUILT_DIR}/include/sse2neon
+      ${LIBS_PREBUILT_DIR}/include/sse2neon/sse2neon.h
       )
     file(WRITE ${PREBUILD_TRACKING_DIR}/sse2neon_installed "0")
   endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/sse2neon_installed OR NOT ${sse2neon_installed} EQUAL 0)
-- 
cgit v1.2.3


From 712b4d935dad7cab52a482994b9e999cc3675d40 Mon Sep 17 00:00:00 2001
From: Erik Kundiman <erik@megapahit.org>
Date: Tue, 13 Aug 2024 22:51:01 +0800
Subject: Only download when there aren't the files yet

---
 indra/llcommon/CMakeLists.txt | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'indra/llcommon')

diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 3c8c8031f2..3cf12408b4 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -297,10 +297,12 @@ target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
 if (CMAKE_OSX_ARCHITECTURES MATCHES arm64)
   if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/sse2neon_installed OR NOT ${sse2neon_installed} EQUAL 0)
     file(MAKE_DIRECTORY ${LIBS_PREBUILT_DIR}/include/sse2neon)
-    file(DOWNLOAD
-      https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h
-      ${LIBS_PREBUILT_DIR}/include/sse2neon/sse2neon.h
-      )
+    if (NOT EXISTS ${LIBS_PREBUILT_DIR}/include/sse2neon/sse2neon.h)
+      file(DOWNLOAD
+        https://raw.githubusercontent.com/DLTcollab/sse2neon/master/sse2neon.h
+        ${LIBS_PREBUILT_DIR}/include/sse2neon/sse2neon.h
+        )
+    endif (NOT EXISTS ${LIBS_PREBUILT_DIR}/include/sse2neon/sse2neon.h)
     file(WRITE ${PREBUILD_TRACKING_DIR}/sse2neon_installed "0")
   endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/sse2neon_installed OR NOT ${sse2neon_installed} EQUAL 0)
   target_include_directories(llcommon PUBLIC ${LIBS_PREBUILT_DIR}/include/sse2neon)
-- 
cgit v1.2.3