Skip to content

Commit 447b319

Browse files
committed
Import git submodules
1 parent 2cee07e commit 447b319

File tree

5,001 files changed

+2118714
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,001 files changed

+2118714
-0
lines changed

vendor/ChaiScript_Extras/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
cmake_minimum_required(VERSION 3.11) # FetchContent requires CMake 3.11
2+
project(chaiscript_extras)
3+
4+
# MINGW does not yet support C++11's concurrency features
5+
if(MINGW)
6+
option(MULTITHREAD_SUPPORT_ENABLED "Multithreaded Support Enabled" FALSE)
7+
else()
8+
option(MULTITHREAD_SUPPORT_ENABLED "Multithreaded Support Enabled" TRUE)
9+
endif()
10+
11+
option(BUILD_IN_CPP17_MODE "Build with C++17 flags" FALSE)
12+
13+
if(CMAKE_COMPILER_IS_GNUCC)
14+
option(ENABLE_COVERAGE "Enable Coverage Reporting in GCC" FALSE)
15+
16+
if(ENABLE_COVERAGE)
17+
add_definitions(--coverage -O0)
18+
set(LINKER_FLAGS "${LINKER_FLAGS} --coverage")
19+
endif()
20+
endif()
21+
22+
if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
23+
option(ENABLE_THREAD_SANITIZER "Enable thread sanitizer testing in gcc/clang" FALSE)
24+
if(ENABLE_THREAD_SANITIZER)
25+
add_definitions(-fsanitize=thread -g)
26+
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=thread")
27+
endif()
28+
29+
option(ENABLE_ADDRESS_SANITIZER "Enable address sanitizer testing in gcc/clang" FALSE)
30+
if(ENABLE_ADDRESS_SANITIZER)
31+
add_definitions(-fsanitize=address -g)
32+
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=address")
33+
endif()
34+
35+
option(ENABLE_MEMORY_SANITIZER "Enable memory sanitizer testing in gcc/clang" FALSE)
36+
if(ENABLE_MEMORY_SANITIZER)
37+
add_definitions(-fsanitize=memory -g)
38+
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=memory")
39+
endif()
40+
41+
option(ENABLE_UNDEFINED_SANITIZER "Enable undefined behavior sanitizer testing in gcc/clang" FALSE)
42+
if(ENABLE_UNDEFINED_SANITIZER)
43+
add_definitions(-fsanitize=undefined -g)
44+
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=undefined")
45+
endif()
46+
47+
option(ENABLE_LTO "Enable Link Time Optimization" FALSE)
48+
49+
if (ENABLE_LTO)
50+
add_definitions(-flto)
51+
set(LINKER_FLAGS "${LINKER_FLAGS} -flto")
52+
endif()
53+
54+
option(PROFILE_GENERATE "Generate profile data" FALSE)
55+
if (PROFILE_GENERATE)
56+
add_definitions(-fprofile-generate)
57+
set(LINKER_FLAGS "${LINKER_FLAGS} -fprofile-generate")
58+
endif()
59+
60+
option(PROFILE_USE "Use profile data" FALSE)
61+
if (PROFILE_USE)
62+
add_definitions(-fprofile-use)
63+
set(LINKER_FLAGS "${LINKER_FLAGS} -fprofile-use")
64+
endif()
65+
66+
67+
endif()
68+
69+
70+
include(CTest)
71+
enable_testing()
72+
73+
if(CMAKE_COMPILER_IS_GNUCC)
74+
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
75+
76+
if(GCC_VERSION VERSION_LESS 4.9)
77+
set(CPP14_FLAG "-std=c++1y")
78+
else()
79+
if (BUILD_IN_CPP17_MODE)
80+
set(CPP14_FLAG "-std=c++1z")
81+
else()
82+
set(CPP14_FLAG "-std=c++14")
83+
endif()
84+
endif()
85+
else()
86+
if (BUILD_IN_CPP17_MODE)
87+
set(CPP14_FLAG "-std=c++1z")
88+
else()
89+
set(CPP14_FLAG "-std=c++14")
90+
endif()
91+
endif()
92+
93+
if(MSVC)
94+
add_definitions(/W4 /w44640)
95+
add_definitions(/bigobj)
96+
# Note on MSVC compiler flags.
97+
# The code base selective disables warnings as necessary when the compiler is complaining too much
98+
# about something that is perfectly valid, or there is simply no technical way around it
99+
# This particular warning, C4503 is in regards to the decorated names that MSVC generates internally.
100+
# The error did not come up until the move to C++11, but the compiler doesn't give enough information
101+
# to determine where the error is coming from, and the internet provides no real information for
102+
# how to workaround or fix the error. So I'm disabling it globally.
103+
add_definitions(/wd4503)
104+
else()
105+
add_definitions(-Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wcast-qual -Wunused -Woverloaded-virtual -pedantic ${CPP14_FLAG})
106+
107+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
108+
add_definitions(-Weverything -Wno-c++98-compat -Wno-documentation -Wno-switch-enum -Wno-weak-vtables -Wno-sign-conversion -Wno-missing-prototypes -Wno-padded -Wno-missing-noreturn)
109+
else()
110+
add_definitions(-Wnoexcept)
111+
endif()
112+
113+
if(APPLE)
114+
add_definitions(-Wno-sign-compare)
115+
endif()
116+
endif()
117+
118+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
119+
option(USE_LIBCXX "Use clang's libcxx" TRUE)
120+
121+
if(USE_LIBCXX)
122+
add_definitions(-stdlib=libc++)
123+
set(LINKER_FLAGS "${LINKER_FLAGS} ${CPP14_FLAG} -stdlib=libc++")
124+
else()
125+
set(LINKER_FLAGS "${LINKER_FLAGS} ${CPP14_FLAG}")
126+
endif()
127+
elseif(CMAKE_COMPILER_IS_GNUCC)
128+
set(LINKER_FLAGS "${LINKER_FLAGS} ${CPP14_FLAG}")
129+
endif()
130+
131+
# limitations in MinGW require us to make an optimized build
132+
# for the sake of object sizes or something
133+
if(MINGW OR CYGWIN)
134+
add_definitions(-O3)
135+
endif()
136+
137+
if(NOT MULTITHREAD_SUPPORT_ENABLED)
138+
add_definitions(-DCHAISCRIPT_NO_THREADS)
139+
endif()
140+
141+
if(CMAKE_HOST_UNIX)
142+
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
143+
list(APPEND LIBS "dl")
144+
endif()
145+
146+
if(MULTITHREAD_SUPPORT_ENABLED)
147+
if(CMAKE_COMPILER_IS_GNUCC)
148+
execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE GCC_FULL_VERSION)
149+
if(GCC_FULL_VERSION MATCHES "4.8.1.*ubuntu")
150+
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--no-as-needed -pthread")
151+
else()
152+
set(LINKER_FLAGS "${LINKER_FLAGS} -pthread")
153+
endif()
154+
else()
155+
set(LINKER_FLAGS "${LINKER_FLAGS} -pthread")
156+
endif()
157+
158+
add_definitions(-pthread)
159+
endif()
160+
endif()
161+
162+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
163+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LINKER_FLAGS}")
164+
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}")
165+
166+
add_subdirectory(cmake)
167+
add_subdirectory(tests)

vendor/ChaiScript_Extras/LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright 2015 Jason Turner
2+
3+
All Rights Reserved.
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the above
11+
copyright notice, this list of conditions and the following
12+
disclaimer in the documentation and/or other materials provided
13+
with the distribution.
14+
* Neither the name of Jason Turner nor the
15+
name of contributors may be used to endorse or promote products derived
16+
from this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

vendor/ChaiScript_Extras/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# ChaiScript Extras
2+
3+
User contributed wrappers and modules for ChaiScript.
4+
5+
## Modules
6+
7+
- [Math](#math): Adds common math methods to ChaiScript.
8+
- [String ID](#string-id): String hashing with [string_id](https://github.com/foonathan/string_id)
9+
- [String](#string): Adds some extra string methods to ChaiScript strings
10+
11+
## Math
12+
13+
The Math module adds some standard math functions to ChaiScript.
14+
15+
### Install
16+
``` cpp
17+
#include "chaiscript/extras/math.hpp"
18+
```
19+
``` cpp
20+
chaiscript::ChaiScript chai;
21+
auto mathlib = chaiscript::extras::math::bootstrap();
22+
chai.add(mathlib);
23+
```
24+
25+
### Usage
26+
27+
``` chaiscript
28+
var result = cos(0.5f)
29+
```
30+
31+
### Options
32+
33+
Compile with one of the following flags to enable or disable features...
34+
- `CHAISCRIPT_EXTRAS_MATH_SKIP_ADVANCED` When enabled, will skip some of the advanced math functions.
35+
36+
## String ID
37+
38+
Adds [String ID](https://github.com/foonathan/string_id) support to ChaiScript.
39+
40+
### Install
41+
42+
``` cpp
43+
#include "chaiscript/extras/string_id.hpp"
44+
```
45+
46+
``` cpp
47+
auto string_idlib = chaiscript::extras::string_id::bootstrap();
48+
chai.add(string_idlib);
49+
```
50+
51+
## String
52+
53+
Adds various string methods to extend how strings can be used in ChaiScript:
54+
- `string::replace(string, string)`
55+
- `string::trim()`
56+
- `string::trimStart()`
57+
- `string::trimEnd()`
58+
- `string::split(string)`
59+
- `string::toLowerCase()`
60+
- `string::toUpperCase()`
61+
- `string::includes()`
62+
63+
### Install
64+
65+
``` cpp
66+
#include "chaiscript/extras/string_methods.hpp"
67+
```
68+
69+
``` cpp
70+
auto stringmethods = chaiscript::extras::string_methods::bootstrap();
71+
chai.add(stringmethods);
72+
```
73+
74+
### Usage
75+
76+
``` chaiscript
77+
var input = "Hello, World!"
78+
var output = input.replace("Hello", "Goodbye")
79+
// => "Goodbye, World!"
80+
```
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include(chaiscript.cmake)
2+
3+
# TODO: Fix string_id_test.
4+
#include(foonathan_string_id.cmake)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
set(CHAISCRIPT_VERSION 5.8.6)
2+
find_package(chaiscript ${CHAISCRIPT_VERSION} QUIET)
3+
4+
if (NOT chaiscript_FOUND)
5+
include(FetchContent)
6+
7+
FetchContent_Declare(
8+
chaiscript
9+
GIT_REPOSITORY https://github.com/ChaiScript/ChaiScript.git
10+
GIT_TAG v${CHAISCRIPT_VERSION}
11+
)
12+
13+
FetchContent_GetProperties(chaiscript)
14+
if (NOT chaiscript_POPULATED)
15+
set(FETCHCONTENT_QUIET NO)
16+
FetchContent_Populate(chaiscript)
17+
18+
set(BUILD_SAMPLES OFF CACHE BOOL "" FORCE)
19+
set(BUILD_MODULES ON CACHE BOOL "" FORCE)
20+
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
21+
set(BUILD_LIBFUZZ_TESTER OFF CACHE BOOL "" FORCE)
22+
23+
add_subdirectory(${chaiscript_SOURCE_DIR} ${chaiscript_BINARY_DIR})
24+
endif()
25+
endif()
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
set(STRING_ID_VERSION 6e2e5c48ee4a3ac0c54ba505f0a573561f2979ec)
2+
find_package(foonathan_string_id 2.0.3 QUIET)
3+
4+
if (NOT foonathan_string_id_FOUND)
5+
include(FetchContent)
6+
7+
FetchContent_Declare(
8+
foonathan_string_id
9+
GIT_REPOSITORY https://github.com/foonathan/string_id.git
10+
GIT_TAG ${STRING_ID_VERSION}
11+
)
12+
13+
FetchContent_GetProperties(foonathan_string_id)
14+
if (NOT foonathan_string_id_POPULATED)
15+
set(FETCHCONTENT_QUIET NO)
16+
FetchContent_Populate(foonathan_string_id)
17+
18+
add_subdirectory(${foonathan_string_id_SOURCE_DIR} ${foonathan_string_id_BINARY_DIR})
19+
endif()
20+
endif()

0 commit comments

Comments
 (0)