disable exeptions in cmake

This commit is contained in:
2026-03-18 09:30:28 +03:00
parent 2798d7de9c
commit ccbf86f781
5 changed files with 25 additions and 17 deletions

View File

@@ -97,8 +97,10 @@ public:
{
int code = lua_pcall (L, nargs, nresults, msgh);
if (code != LUABRIDGE_LUA_OK)
Throw (LuaException (L, code));
if (code != LUABRIDGE_LUA_OK) {
// Throw (LuaException (L, code));
assert(true);
}
}
//----------------------------------------------------------------------------
@@ -128,7 +130,8 @@ protected:
private:
static int throwAtPanic (lua_State* L)
{
throw LuaException (L, -1);
// throw LuaException (L, -1);
return -1;
}
};

View File

@@ -101,7 +101,8 @@ protected:
{
if (m_stackSize == 0)
{
throw std::logic_error ("Unable to continue registration");
std::cerr << ("Unable to continue registration");
assert(true);
}
}
};
@@ -1054,7 +1055,8 @@ public:
{
if (m_stackSize == 1)
{
throw std::logic_error ("endNamespace () called on global namespace");
std::cerr << ("endNamespace () called on global namespace");
assert(true);
}
assert (m_stackSize > 1);
@@ -1150,7 +1152,8 @@ public:
{
if (m_stackSize == 1)
{
throw std::logic_error ("addProperty () called on global namespace");
std::cerr << ("addProperty () called on global namespace");
assert(true);
}
assert (lua_istable (L, -1)); // Stack: namespace table (ns)

View File

@@ -33,6 +33,7 @@
#include <cassert>
#include <stdexcept>
#include <iostream>
namespace luabridge {
@@ -320,7 +321,8 @@ public:
lua_rawgetp (L, LUA_REGISTRYINDEX, ClassInfo <T>::getClassKey ());
if (!lua_istable (L, -1))
{
throw std::logic_error ("The class is not registered in LuaBridge");
std::cerr << ("The class is not registered in LuaBridge");
assert(true);
}
lua_setmetatable (L, -2);
return ud;
@@ -375,7 +377,8 @@ private:
lua_rawgetp (L, LUA_REGISTRYINDEX, key);
if (!lua_istable (L, -1))
{
throw std::logic_error ("The class is not registered in LuaBridge");
std::cerr << ("The class is not registered in LuaBridge");
assert(true);
}
lua_setmetatable (L, -2);
}

View File

@@ -363,7 +363,7 @@ if(WIN32)
set(CMAKE_CXX_FLAGS "/O2 /Ob2 /Ot /W0")
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fno-exceptions")
if(DEFINED ENV{QNX_HOST} OR PIP_FREERTOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-32")
endif()

View File

@@ -726,6 +726,7 @@ inline bool piDeleteSafety(T *& pointer) {
//! \~english In this example "Error!" will be printed on every \b false function return.
//! \~russian В данном примере будет выведен "Error!" при каждом \b false возврате из функции.
class PIP_EXPORT PIScopeExitCall {
NO_COPY_CLASS(PIScopeExitCall)
public:
//! \~\brief
//! \~english Constructor that takes a function to execute
@@ -758,8 +759,6 @@ public:
}
private:
NO_COPY_CLASS(PIScopeExitCall)
std::function<void()> func;
};
@@ -768,14 +767,14 @@ private:
//! \~english Inherit from this class to make your class non-trivially copyable.
//! \~russian Наследуйтесь от этого класса чтобы сделать свой класс нетривиально копируемым.
struct PIP_EXPORT PINonTriviallyCopyable {
PINonTriviallyCopyable() noexcept = default;
PINonTriviallyCopyable(const PINonTriviallyCopyable &) noexcept = default;
PINonTriviallyCopyable(PINonTriviallyCopyable &&) noexcept;
PINonTriviallyCopyable & operator=(const PINonTriviallyCopyable &) noexcept = default;
PINonTriviallyCopyable & operator=(PINonTriviallyCopyable &&) noexcept = default;
PINonTriviallyCopyable() = default;
PINonTriviallyCopyable(const PINonTriviallyCopyable &) = default;
PINonTriviallyCopyable(PINonTriviallyCopyable &&) ;
PINonTriviallyCopyable & operator=(const PINonTriviallyCopyable &) = default;
PINonTriviallyCopyable & operator=(PINonTriviallyCopyable &&) = default;
~PINonTriviallyCopyable() = default;
};
inline PINonTriviallyCopyable::PINonTriviallyCopyable(PINonTriviallyCopyable &&) noexcept = default;
inline PINonTriviallyCopyable::PINonTriviallyCopyable(PINonTriviallyCopyable &&) = default;
//! \~\brief