# Copyright 2017-2020 Fitbit, Inc
# SPDX-License-Identifier: Apache-2.0

# Platform specifics
set(GG_PLATFORM GG_PLATFORM_PYLON CACHE STRING "Target Platform")

# Enable/disable groups
set(GG_ENABLE_APPS FALSE CACHE BOOL "")
set(GG_ENABLE_EXAMPLES FALSE CACHE BOOL "")
set(GG_ENABLE_UNIT_TESTS FALSE CACHE BOOL "")

# Enable/disable libraries
set(GG_LIBS_ENABLE_BLAST_SERVICE TRUE CACHE BOOL "")
set(GG_LIBS_ENABLE_STACK_SERVICE TRUE CACHE BOOL "")

# Shared configuation options
set(GG_CONFIG_ENABLE_LOGGING TRUE CACHE BOOL "")
set(GG_CONFIG_GATTLINK_MAX_SIMULTANEOUS_CLIENTS "1" CACHE STRING "")
set(GG_CONFIG_LWIP_PORT "generic" CACHE STRING "")
set(GG_CONFIG_LWIP_MEM_SIZE "2048" CACHE STRING "")
set(GG_CONFIG_DEFAULT_SOCKETS_MODULE "Lwip" CACHE STRING "")
set(GG_CONFIG_MBEDTLS_USE_PLATFORM_RNG TRUE CACHE BOOL "")
set(GG_CONFIG_ENABLE_THREAD_GUARDS TRUE CACHE BOOL "")

# Ports selection
set(GG_PORTS_ENABLE_GENERIC_LOOP TRUE CACHE BOOL "")
set(GG_PORTS_ENABLE_NULL_ENVIRONMENT TRUE CACHE BOOL "")
set(GG_PORTS_ENABLE_STDC_RANDOM TRUE CACHE BOOL "")
set(GG_PORTS_ENABLE_LWIP TRUE CACHE BOOL "")
set(GG_PORTS_ENABLE_LWIP_SOCKETS TRUE CACHE BOOL "")
set(GG_PORTS_ENABLE_NIP FALSE CACHE BOOL "")
set(GG_PORTS_ENABLE_NIP_SOCKETS FALSE CACHE BOOL "")
set(GG_PORTS_ENABLE_MBEDTLS TRUE CACHE BOOL "")
set(GG_PORTS_ENABLE_MBEDTLS_TLS TRUE CACHE BOOL "")

# MbedTLS options
set(GG_MBEDTLS_CONFIG "gg_dtls_mynewt_config.h" CACHE STRING "")

# Build options
if(${CMAKE_VERSION} VERSION_LESS 3.6.0)
  include(CMakeForceCompiler)
  cmake_force_c_compiler(${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX} GNU)
  cmake_force_cxx_compiler(${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-g++${TOOL_EXECUTABLE_SUFFIX} GNU)
else()
  set(CMAKE_C_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gcc${TOOL_EXECUTABLE_SUFFIX})
  set(CMAKE_CXX_COMPILER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-g++${TOOL_EXECUTABLE_SUFFIX})
endif()
