==========================
Qthreads README for Chapel
==========================

This copy of Qthreads 1.23 is being released with Chapel for
convenience and was obtained from:

  https://github.com/sandialabs/qthreads

Any Chapel issues that seem to be related to Qthreads should be directed
to the Chapel team at https://chapel-lang.org/bugs.html.


Upgrading versions
============================

The directory $CHPL_HOME/third-party/qthread/qthread-src contains
a copy of the Qthreads repository. Version updates should be done
as follows, assuming the CWD is $CHPL_HOME/third-party/qthread/:

1. download the latest qthread version: e.g. `wget https://github.com/sandialabs/qthreads/archive/refs/tags/1.23.tar.gz -O qthread-src.tar.gz`
2. `git rm -r qthread-src`
3. `tar xf qthread-src.tar.gz`
4. `git add --force qthread-src` (--force to ignore our .gitignore)
5. update the version number mentioned above
6. test
7. commit, PR, merge, etc

The modifications that we have made to the official Qthreads release are
as follows:

Prevent CMake from overriding the OSX deployment target
--- a/third-party/qthread/qthread-src/CMakeLists.txt
+++ b/third-party/qthread/qthread-src/CMakeLists.txt
@@ -16,6 +16,11 @@ else()
     LANGUAGES C ASM CXX)
 endif()

+# This must be done after `project` or it gets overridden by cmake
+if(APPLE)
+  set(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "" FORCE)
+endif()
+
 include(GNUInstallDirs)

 set(THREADS_PREFER_PTHREAD_FLAG ON)

