mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-18 12:28:31 +01:00
Check for lambda support before using it.
This commit is contained in:
parent
303ef3ce2f
commit
875b297278
@ -25,8 +25,15 @@ check_cxx_source_compiles(
|
||||
}
|
||||
"
|
||||
USE_STD_UNORDERED_MAP)
|
||||
check_cxx_source_compiles(
|
||||
"int main() {
|
||||
[](){}();
|
||||
}
|
||||
"
|
||||
HAVE_LAMBDAS)
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
set(LINUX 1)
|
||||
endif (UNIX AND NOT APPLE)
|
||||
|
@ -44,5 +44,6 @@
|
||||
#cmakedefine USE_INSTALL_PREFIX
|
||||
#cmakedefine USE_SYSTEM_PROJECTM
|
||||
#cmakedefine USE_STD_UNORDERED_MAP
|
||||
#cmakedefine HAVE_LAMBDAS
|
||||
|
||||
#endif // CONFIG_H_IN
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <QSharedPointer>
|
||||
#include <QSignalSpy>
|
||||
|
||||
#include "config.h"
|
||||
#include "core/closure.h"
|
||||
#include "test_utils.h"
|
||||
|
||||
@ -63,6 +64,7 @@ TEST(ClosureTest, ClosureDoesNotCrashWithSharedPointerSender) {
|
||||
EXPECT_TRUE(closure.isNull());
|
||||
}
|
||||
|
||||
#ifdef HAVE_LAMBDAS
|
||||
TEST(ClosureTest, ClosureCallsLambda) {
|
||||
TestQObject sender;
|
||||
bool called = false;
|
||||
@ -73,3 +75,4 @@ TEST(ClosureTest, ClosureCallsLambda) {
|
||||
sender.Emit();
|
||||
EXPECT_TRUE(called);
|
||||
}
|
||||
#endif // HAVE_LAMBDAS
|
||||
|
Loading…
Reference in New Issue
Block a user