summaryrefslogtreecommitdiffstats
path: root/src/corelib/configure.cmake
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-02-12 16:40:33 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2021-02-15 13:45:14 +0100
commit18bf641777d1f4baf5eb63f552b63685958f02f4 (patch)
tree40a4cfe3ececd89193d9e083e525fd6ead33449d /src/corelib/configure.cmake
parentc462793d6751c17defbeeb1428510c35869755cc (diff)
Use newlines more consistently in generate compile-test code
The generated code contained many repeated blank lines. Most main()s were preceded by one, but not all. Only include blank lines for actual empty entries in lists, where configure.json specified them, plus one before main if anything else precedes it. Change-Id: I6e6c34940e08712a1aa848a3c9ad1b0fb5806d77 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/corelib/configure.cmake')
-rw-r--r--src/corelib/configure.cmake60
1 files changed, 21 insertions, 39 deletions
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake
index 6e189ad2dd..6dab11b5a5 100644
--- a/src/corelib/configure.cmake
+++ b/src/corelib/configure.cmake
@@ -40,8 +40,7 @@ qt_find_package(Slog2 PROVIDED_TARGETS Slog2::Slog2 MODULE_NAME core QMAKE_LIB s
qt_config_compile_test(atomicfptr
LABEL "working std::atomic for function pointers"
CODE
-"
-#include <atomic>
+"#include <atomic>
typedef void (*fptr)(int);
typedef std::atomic<fptr> atomicfptr;
void testfunction(int) { }
@@ -55,6 +54,7 @@ void test(volatile atomicfptr &a)
}
a.store(&testfunction, std::memory_order_release);
}
+
int main(void)
{
/* BEGIN TEST: */
@@ -71,8 +71,7 @@ qt_config_compile_test(clock_monotonic
LIBRARIES
WrapRt::WrapRt
CODE
-"
-#include <unistd.h>
+"#include <unistd.h>
#include <time.h>
int main(void)
@@ -126,8 +125,7 @@ qt_config_compile_test(cxx11_future
LIBRARIES
"${cxx11_future_TEST_LIBRARIES}"
CODE
-"
-#include <future>
+"#include <future>
int main(void)
{
@@ -144,8 +142,7 @@ std::future<int> f = std::async([]() { return 42; });
qt_config_compile_test(cxx11_random
LABEL "C++11 <random>"
CODE
-"
-#include <random>
+"#include <random>
int main(void)
{
@@ -160,8 +157,7 @@ std::mt19937 mt(0);
qt_config_compile_test(cxx17_filesystem
LABEL "C++17 <filesystem>"
CODE
-"
-#include <filesystem>
+"#include <filesystem>
int main(void)
{
@@ -179,8 +175,7 @@ std::filesystem::copy(
qt_config_compile_test(eventfd
LABEL "eventfd"
CODE
-"
-#include <sys/eventfd.h>
+"#include <sys/eventfd.h>
int main(void)
{
@@ -198,8 +193,7 @@ eventfd_write(fd, value);
qt_config_compile_test(futimens
LABEL "futimens()"
CODE
-"
-#include <sys/stat.h>
+"#include <sys/stat.h>
int main(void)
{
@@ -215,8 +209,7 @@ futimens(-1, 0);
qt_config_compile_test(futimes
LABEL "futimes()"
CODE
-"
-#include <sys/time.h>
+"#include <sys/time.h>
int main(void)
{
@@ -231,8 +224,7 @@ futimes(-1, 0);
qt_config_compile_test(getauxval
LABEL "getauxval()"
CODE
-"
-#include <sys/auxv.h>
+"#include <sys/auxv.h>
int main(void)
{
@@ -247,8 +239,7 @@ int main(void)
qt_config_compile_test(getentropy
LABEL "getentropy()"
CODE
-"
-#include <unistd.h>
+"#include <unistd.h>
int main(void)
{
@@ -264,8 +255,7 @@ char buf[32];
qt_config_compile_test(glibc
LABEL "GNU libc"
CODE
-"
-#include <stdlib.h>
+"#include <stdlib.h>
int main(void)
{
@@ -280,8 +270,7 @@ return __GLIBC__;
qt_config_compile_test(inotify
LABEL "inotify"
CODE
-"
-#include <sys/inotify.h>
+"#include <sys/inotify.h>
int main(void)
{
@@ -298,8 +287,7 @@ inotify_rm_watch(0, 1);
qt_config_compile_test(ipc_sysv
LABEL "SysV IPC"
CODE
-"
-#include <sys/types.h>
+"#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
@@ -326,8 +314,7 @@ qt_config_compile_test(ipc_posix
LIBRARIES
"${ipc_posix_TEST_LIBRARIES}"
CODE
-"
-#include <sys/types.h>
+"#include <sys/types.h>
#include <sys/mman.h>
#include <semaphore.h>
#include <fcntl.h>
@@ -364,8 +351,7 @@ linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW);
qt_config_compile_test(ppoll
LABEL "ppoll()"
CODE
-"
-#include <signal.h>
+"#include <signal.h>
#include <poll.h>
int main(void)
@@ -384,8 +370,7 @@ ppoll(&pfd, 1, &ts, &sig);
qt_config_compile_test(pollts
LABEL "pollts()"
CODE
-"
-#include <poll.h>
+"#include <poll.h>
#include <signal.h>
#include <time.h>
@@ -405,8 +390,7 @@ pollts(&pfd, 1, &ts, &sig);
qt_config_compile_test(poll
LABEL "poll()"
CODE
-"
-#include <poll.h>
+"#include <poll.h>
int main(void)
{
@@ -460,8 +444,7 @@ return statx(AT_FDCWD, \"\", AT_STATX_SYNC_AS_STAT, mask, &statxbuf);
qt_config_compile_test(syslog
LABEL "syslog"
CODE
-"
-#include <syslog.h>
+"#include <syslog.h>
int main(void)
{
@@ -478,9 +461,7 @@ closelog();
qt_config_compile_test(xlocalescanprint
LABEL "xlocale.h (or equivalents)"
CODE
-"
-
-#define QT_BEGIN_NAMESPACE
+"#define QT_BEGIN_NAMESPACE
#define QT_END_NAMESPACE
#ifdef _MSVC_VER
@@ -490,6 +471,7 @@ qt_config_compile_test(xlocalescanprint
#define QT_NO_DOUBLECONVERSION
#include QDSP_P_H
+
int main(void)
{
/* BEGIN TEST: */