Fix Visual Studio 2015 builds, fix error handling printouts / exceptions, fix constexpr usage that trips up Visual Studio 2015.

This commit is contained in:
ThePhD 2018-04-17 20:08:07 -04:00
parent 42fe70f081
commit c72a012927
5 changed files with 17 additions and 19 deletions

View File

@ -25,7 +25,7 @@
cmake_minimum_required(VERSION 3.5.0) cmake_minimum_required(VERSION 3.5.0)
# # # project declaration # # # project declaration
project(sol2 VERSION 2.19.0 LANGUAGES CXX C) project(sol2 VERSION 2.20.0 LANGUAGES CXX C)
include(GNUInstallDirs) include(GNUInstallDirs)

View File

@ -20,7 +20,7 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # 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. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
version: 2.19.0-{build} version: 2.20.0-{build}
max_jobs: 4 max_jobs: 4

View File

@ -2,7 +2,7 @@
#include <sol.hpp> #include <sol.hpp>
// Something that can't be collided with // Something that can't be collided with
constexpr static const auto& script_key = "GlobalResource.MySpecialIdentifier123"; static const auto& script_key = "GlobalResource.MySpecialIdentifier123";
struct GlobalResource { struct GlobalResource {
int value = 2; int value = 2;

View File

@ -149,7 +149,6 @@ namespace sol {
std::cerr << err; std::cerr << err;
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
#if !(defined(SOL_NO_EXCEPTIONS) && SOL_NO_EXCEPTIONS)
// replacing information of stack error into pfr // replacing information of stack error into pfr
int target = result.stack_index(); int target = result.stack_index();
if (result.pop_count() > 0) { if (result.pop_count() > 0) {
@ -161,11 +160,12 @@ namespace sol {
if (towards != 0) { if (towards != 0) {
lua_rotate(L, top, towards); lua_rotate(L, top, towards);
} }
#if defined(SOL_NO_EXCEPTIONS) && SOL_NO_EXCEPTIONS
return result;
#else #else
// just throw our error // just throw our error
throw error(detail::direct_error, err); throw error(detail::direct_error, err);
#endif #endif // If exceptions are allowed
return result;
} }
inline protected_function_result script_default_on_error(lua_State* L, protected_function_result pfr) { inline protected_function_result script_default_on_error(lua_State* L, protected_function_result pfr) {

View File

@ -23,7 +23,7 @@
# # # # sol2 tests # # # # sol2 tests
if (CMAKE_GENERATOR MATCHES "Visual Studio 14 2015") if (CMAKE_GENERATOR MATCHES "Visual Studio 14 2015")
find_package(Catch 1.1.12 REQUIRED) find_package(Catch 1.12.1 REQUIRED)
else() else()
find_package(Catch 2.1.2 REQUIRED) find_package(Catch 2.1.2 REQUIRED)
endif() endif()
@ -71,8 +71,6 @@ function(CREATE_TEST test_target_name test_name is_single)
target_compile_definitions(${test_target_name} target_compile_definitions(${test_target_name}
PRIVATE SOL2_CI) PRIVATE SOL2_CI)
endif() endif()
target_compile_features(${test_target_name}
PRIVATE ${CXX_FEATURES})
if (CMAKE_DL_LIBS) if (CMAKE_DL_LIBS)
target_link_libraries(${test_target_name} target_link_libraries(${test_target_name}
${CMAKE_DL_LIBS}) ${CMAKE_DL_LIBS})