mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
commit
92fdde2919
@ -3,10 +3,10 @@ cmake_minimum_required(VERSION 2.8.7)
|
||||
project(GSL CXX)
|
||||
|
||||
set(GSL_HEADERS
|
||||
"include/gsl.h"
|
||||
"include/gsl_assert.h"
|
||||
"include/span.h"
|
||||
"include/string_span.h"
|
||||
"gsl/gsl.h"
|
||||
"gsl/gsl_assert.h"
|
||||
"gsl/span.h"
|
||||
"gsl/string_span.h"
|
||||
)
|
||||
|
||||
include_directories(
|
||||
|
25
README.md
25
README.md
@ -6,10 +6,10 @@ This repo contains Microsoft's implementation of GSL.
|
||||
|
||||
The library includes types like `span<T>`, `string_span`, `owner<>` and others.
|
||||
|
||||
The entire implementation is provided inline in the headers under the [include](./include) directory. The implementation generally assumes a platform that implements C++14 support. There are specific workarounds to support MSVC 2013 and 2015.
|
||||
The entire implementation is provided inline in the headers under the [gsl](./gsl) directory. The implementation generally assumes a platform that implements C++14 support. There are specific workarounds to support MSVC 2013 and 2015.
|
||||
|
||||
While some types have been broken out into their own headers (e.g. [include/span.h](./include/span.h)),
|
||||
it is simplest to just include [gsl.h](./include/gsl.h) and gain access to the entire library.
|
||||
While some types have been broken out into their own headers (e.g. [gsl/span.h](./gsl/span.h)),
|
||||
it is simplest to just include [gsl/gsl.h](./gsl/gsl.h) and gain access to the entire library.
|
||||
|
||||
> NOTE: We encourage contributions that improve or refine any of the types in this library as well as ports to
|
||||
other platforms. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more information about contributing.
|
||||
@ -66,5 +66,20 @@ All tests should pass - indicating your platform is fully supported and you are
|
||||
## Using the libraries
|
||||
As the types are entirely implemented inline in headers, there are no linking requirements.
|
||||
|
||||
Just place the contents of the [include](./include) directory within your source tree so it is available
|
||||
to your compiler, then include the appropriate headers in your program, and away you go!
|
||||
You can copy the [gsl](./gsl) directory into your source tree so it is available
|
||||
to your compiler, then include the appropriate headers in your program.
|
||||
|
||||
Alternatively set your compiler's *include path* flag to point to the GSL development folder (`c:\GSL` in the example above) or installation folder (after running the install). Eg.
|
||||
|
||||
MSVC++
|
||||
|
||||
/I c:\GSL
|
||||
|
||||
GCC/clang
|
||||
|
||||
-I$HOME/dev/GSL
|
||||
|
||||
|
||||
Include the library using:
|
||||
|
||||
#include <gsl/gsl.h>
|
||||
|
@ -9,7 +9,7 @@ endif()
|
||||
add_subdirectory(unittest-cpp)
|
||||
|
||||
include_directories(
|
||||
../include
|
||||
..
|
||||
./unittest-cpp
|
||||
)
|
||||
|
||||
@ -33,7 +33,7 @@ else()
|
||||
endif()
|
||||
|
||||
function(add_gsl_test name)
|
||||
add_executable(${name} ${name}.cpp ../include/gsl.h ../include/gsl_assert.h ../include/gsl_util.h ../include/multi_span.h ../include/span.h ../include/string_span.h)
|
||||
add_executable(${name} ${name}.cpp ../gsl/gsl.h ../gsl/gsl_assert.h ../gsl/gsl_util.h ../gsl/multi_span.h ../gsl/span.h ../gsl/string_span.h)
|
||||
target_link_libraries(${name} UnitTest++)
|
||||
install(TARGETS ${name}
|
||||
RUNTIME DESTINATION bin
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <gsl.h>
|
||||
#include <gsl/gsl.h>
|
||||
|
||||
using namespace gsl;
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <gsl.h>
|
||||
#include <gsl/gsl.h>
|
||||
#include <vector>
|
||||
#include <initializer_list>
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <multi_span.h>
|
||||
#include <gsl/multi_span.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <gsl_byte.h>
|
||||
#include <gsl/gsl_byte.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <multi_span.h>
|
||||
#include <gsl/multi_span.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <gsl.h>
|
||||
#include <gsl/gsl.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace gsl;
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <gsl.h>
|
||||
#include <gsl/gsl.h>
|
||||
#include <functional>
|
||||
|
||||
using namespace gsl;
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <span.h>
|
||||
#include <gsl/span.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <multi_span.h>
|
||||
#include <gsl/multi_span.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <cstdlib>
|
||||
#include <string_span.h>
|
||||
#include <gsl/string_span.h>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
@ -15,7 +15,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <UnitTest++/UnitTest++.h>
|
||||
#include <gsl.h>
|
||||
#include <gsl/gsl.h>
|
||||
#include <functional>
|
||||
|
||||
using namespace gsl;
|
||||
|
Loading…
Reference in New Issue
Block a user