$NetBSD: patch-sql_CMakeLists.txt,v 1.2 2022/11/02 17:02:10 jperkin Exp $

* use a provided ffsll implementation if the system does not have one
* use noop implementation (apple) for binding threads to a cpu
TODO: netbsd and irix has apis for this, perhaps implement this.

--- sql/CMakeLists.txt.orig	2022-09-13 16:15:16.000000000 +0000
+++ sql/CMakeLists.txt
@@ -648,6 +648,10 @@ IF(BUILD_IS_SINGLE_CONFIG)
   ENDIF()
 ENDIF()
 
+IF(NOT HAVE_FFSLL)
+LIST(APPEND SQL_SHARED_SOURCES ffsll.cc)
+ENDIF()
+
 # BISON_TARGET(<Name> <YaccInput> <CodeOutput>
 #              [COMPILE_FLAGS <flags>]
 #              [DEFINES_FILE <file>]
@@ -748,6 +752,9 @@ ELSEIF(SOLARIS)
 ELSEIF(WIN32)
   LIST(APPEND SQL_SHARED_SOURCES
     resourcegroups/platform/thread_attrs_api_win.cc)
+ELSE()
+  LIST(APPEND SQL_SHARED_SOURCES
+    resourcegroups/platform/thread_attrs_api_apple.cc)
 ENDIF()
 
 SET(SQL_SOURCE
