Skip to content

Commit

Permalink
soapy: initial commit of soapy sdr library
Browse files Browse the repository at this point in the history
  • Loading branch information
guruofquality committed Oct 4, 2014
0 parents commit 864d008
Show file tree
Hide file tree
Showing 9 changed files with 770 additions and 0 deletions.
40 changes: 40 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,40 @@
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.8)
project(SoapySDRLibrary)
enable_language(CXX)
enable_testing()

########################################################################
# Install headers
########################################################################
install(
DIRECTORY include/SoapySDR
DESTINATION include
)

########################################################################
# Build the library
########################################################################
set(SOAPY_SDR_SOURCES
lib/Interface.cpp
lib/Factory.cpp
lib/Registry.cpp
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

add_library(SoapySDR SHARED ${SOAPY_SDR_SOURCES})
#target_link_libraries(SoapySDR ...)
#set_target_properties(SoapySDR PROPERTIES VERSION ${SOAPY_SDR_VERSION})
set_target_properties(SoapySDR PROPERTIES DEFINE_SYMBOL "SOAPY_SDR_DLL_EXPORTS")

########################################################################
# Install the library
########################################################################
install(TARGETS SoapySDR
LIBRARY DESTINATION lib${LIB_SUFFIX} # .so file
ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
RUNTIME DESTINATION bin # .dll file
)
23 changes: 23 additions & 0 deletions LICENSE_1_0.txt
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
11 changes: 11 additions & 0 deletions README.md
@@ -0,0 +1,11 @@
# Soapy SDR - vendor and platform neutral SDR support library.

##Documentation

* https://github.com/pothosware/SoapySDR/wiki

## Licensing information

Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
53 changes: 53 additions & 0 deletions include/SoapySDR/Config.hpp
@@ -0,0 +1,53 @@
///
/// \file SoapySDR/Config.hpp
///
/// Common macro definitions for Soapy SDR library API export.
///
/// \copyright
/// Copyright (c) 2014-2014 Josh Blum
/// SPDX-License-Identifier: BSL-1.0
///

#pragma once
// http://gcc.gnu.org/wiki/Visibility
// Generic helper definitions for shared library support
#if defined _WIN32 || defined __CYGWIN__
#define SOAPY_SDR_HELPER_DLL_IMPORT __declspec(dllimport)
#define SOAPY_SDR_HELPER_DLL_EXPORT __declspec(dllexport)
#define SOAPY_SDR_HELPER_DLL_LOCAL
#else
#if __GNUC__ >= 4
#define SOAPY_SDR_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
#define SOAPY_SDR_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
#define SOAPY_SDR_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
#else
#define SOAPY_SDR_HELPER_DLL_IMPORT
#define SOAPY_SDR_HELPER_DLL_EXPORT
#define SOAPY_SDR_HELPER_DLL_LOCAL
#endif
#endif

// Now we use the generic helper definitions above to define SOAPY_SDR_API and SOAPY_SDR_LOCAL.
// SOAPY_SDR_API is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
// SOAPY_SDR_LOCAL is used for non-api symbols.

#define SOAPY_SDR_DLL //always building a DLL

#ifdef SOAPY_SDR_DLL // defined if SOAPY is compiled as a DLL
#ifdef SOAPY_SDR_DLL_EXPORTS // defined if we are building the SOAPY DLL (instead of using it)
#define SOAPY_SDR_API SOAPY_SDR_HELPER_DLL_EXPORT
#define SOAPY_SDR_EXTERN
#else
#define SOAPY_SDR_API SOAPY_SDR_HELPER_DLL_IMPORT
#define SOAPY_SDR_EXTERN extern
#endif // SOAPY_SDR_DLL_EXPORTS
#define SOAPY_SDR_LOCAL SOAPY_SDR_HELPER_DLL_LOCAL
#else // SOAPY_SDR_DLL is not defined: this means SOAPY is a static lib.
#define SOAPY_SDR_API
#define SOAPY_SDR_LOCAL
#define SOAPY_SDR_EXTERN
#endif // SOAPY_SDR_DLL

#include <ciso646>

#define SOAPY_SDR_BOOST

0 comments on commit 864d008

Please sign in to comment.