nimble/host: Build ble_hs_periodic_sync only when enabled

When periodic advertising support is disabled this code is never used.
diff --git a/nimble/host/src/ble_hs.c b/nimble/host/src/ble_hs.c
index 969a3e1..2e5451a 100644
--- a/nimble/host/src/ble_hs.c
+++ b/nimble/host/src/ble_hs.c
@@ -743,8 +743,10 @@
     rc = ble_hs_conn_init();
     SYSINIT_PANIC_ASSERT(rc == 0);
 
+#if MYNEWT_VAL(BLE_PERIODIC_ADV)
     rc = ble_hs_periodic_sync_init();
     SYSINIT_PANIC_ASSERT(rc == 0);
+#endif
 
     rc = ble_l2cap_init();
     SYSINIT_PANIC_ASSERT(rc == 0);
diff --git a/nimble/host/src/ble_hs_periodic_sync.c b/nimble/host/src/ble_hs_periodic_sync.c
index 1a77060..9fad653 100644
--- a/nimble/host/src/ble_hs_periodic_sync.c
+++ b/nimble/host/src/ble_hs_periodic_sync.c
@@ -24,6 +24,7 @@
 #include "host/ble_hs_id.h"

 #include "ble_hs_priv.h"

 

+#if MYNEWT_VAL(BLE_PERIODIC_ADV)

 static SLIST_HEAD(, ble_hs_periodic_sync) g_ble_hs_periodic_sync_handles;

 static struct os_mempool ble_hs_periodic_sync_pool;

 

@@ -150,3 +151,4 @@
 

     return 0;

 }

+#endif