-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix moving Wren VM will corrupt the user pointer Add support for Wren native maps Update Wreb submodule to the latest master version Update documentation and replace Hugo-Learn theme with Hugo-Learn theme Add support for std::optional Add support for std::deque Refactor and format header files Remove broken lcov for uploading test coverage Move to GitHub actions Allow wrenbind17::Variable instance to be pushed into Wren VM Redesigned wrenbind17::Any from scrach and now uses the same mechanism as the rest of the code via push and pop helpers Added API documentation Updated Hugo to the latest version Updated Doxybook2 to the latest version
- Loading branch information
1 parent
90dfa2d
commit c72325a
Showing
65 changed files
with
4,081 additions
and
2,439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,42 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/modules") | ||
|
||
project(WrenBind17) | ||
|
||
option(WRENBIND17_BUILD_TESTS "Build with tests" OFF) | ||
option(WRENBIND17_BUILD_WREN "Build Wren library too" OFF) | ||
|
||
if(WRENBIND17_BUILD_TESTS) | ||
# Code Coverage Configuration | ||
add_library(coverage_config INTERFACE) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") | ||
# Add required flags (GCC & LLVM/Clang) | ||
target_compile_options(coverage_config INTERFACE | ||
-O0 # no optimization | ||
-g # generate debug info | ||
--coverage # sets all required flags | ||
) | ||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) | ||
target_link_options(coverage_config INTERFACE --coverage) | ||
else() | ||
target_link_libraries(coverage_config INTERFACE --coverage) | ||
endif() | ||
endif() | ||
endif() | ||
|
||
# Add WrenBind17 header only library | ||
add_library(${PROJECT_NAME} INTERFACE) | ||
set(WRENBIND17_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) | ||
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include) | ||
target_include_directories(${PROJECT_NAME} INTERFACE ${WRENBIND17_INCLUDE_DIR}) | ||
|
||
if(WRENBIND17_BUILD_TESTS OR WRENBIND17_BUILD_WREN) | ||
# Wren | ||
set(WREN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/wren/src/include) | ||
file(GLOB_RECURSE WREN_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/libs/wren/src/vm/*.c) | ||
set_source_files_properties(${WREN_SOURCES} PROPERTIES LANGUAGE C) | ||
add_library(Wren STATIC ${WREN_SOURCES}) | ||
target_include_directories(Wren PRIVATE ${WREN_INCLUDE_DIR}) | ||
target_include_directories(Wren PUBLIC ${WREN_INCLUDE_DIR}) | ||
target_compile_definitions(Wren PRIVATE WREN_OPT_META=0 WREN_OPT_RANDOM=0) | ||
# Find Wren library | ||
find_package(Wren REQUIRED) | ||
endif() | ||
|
||
if(WRENBIND17_BUILD_TESTS) | ||
target_link_libraries(${PROJECT_NAME} INTERFACE coverage_config) | ||
# Find Catch2 library | ||
find_package(Catch2 REQUIRED) | ||
|
||
# Add tests | ||
enable_testing() | ||
# Catch2 | ||
set(CATCH2_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/Catch2/single_include) | ||
|
||
set(TEST_TARGET ${PROJECT_NAME}_tests) | ||
file(GLOB TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp) | ||
file(GLOB TEST_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.hpp) | ||
file(GLOB LIB_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/wrenbind17/*.hpp) | ||
add_executable(${TEST_TARGET} ${TEST_SOURCES} ${TEST_HEADERS} ${LIB_HEADERS}) | ||
set_target_properties(${TEST_TARGET} PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) | ||
target_include_directories(${TEST_TARGET} PRIVATE ${CATCH2_INCLUDE_DIR}) | ||
target_link_libraries(${TEST_TARGET} PUBLIC Wren ${PROJECT_NAME}) | ||
target_link_libraries(${TEST_TARGET} PRIVATE coverage_config) | ||
add_executable(${PROJECT_NAME}_Tests ${TEST_SOURCES} ${TEST_HEADERS} ${LIB_HEADERS}) | ||
set_target_properties(${PROJECT_NAME}_Tests PROPERTIES CXX_STANDARD 17 CXX_EXTENSIONS OFF) | ||
target_include_directories(${PROJECT_NAME}_Tests PRIVATE ${CATCH2_INCLUDE_DIR}) | ||
target_link_libraries(${PROJECT_NAME}_Tests PUBLIC Wren ${PROJECT_NAME}) | ||
if(UNIX AND NOT APPLE) | ||
# Coverage info | ||
target_compile_options(${PROJECT_NAME}_Tests PRIVATE --coverage -g -O0) | ||
target_link_options(${PROJECT_NAME}_Tests PRIVATE --coverage) | ||
endif() | ||
if(MINGW) | ||
target_compile_options(${TEST_TARGET} PRIVATE -Wa,-mbig-obj) | ||
target_compile_options(${PROJECT_NAME}_Tests PRIVATE -Wa,-mbig-obj) | ||
endif() | ||
add_test(NAME ${TEST_TARGET} COMMAND ${TEST_TARGET}) | ||
add_test(NAME ${PROJECT_NAME}_Tests COMMAND ${PROJECT_NAME}_Tests) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Matus Novak | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
MIT License | ||
Copyright (c) 2019-2020 Matus Novak | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.