Files
wxWidgets/build/cmake/modules/cotire_test/src/example.cpp
Maarten Bent e69755c203 CMake: check if the compiler supports using precompiled headers
Build the cotire test project and check if it succeeds. Also check if the
'had text segment at different address' warning does not appear in the build
output. If it does not succeed, disable usage of precompiled headers.

If the PCH option was changed, clean the project and rebuild it again. Do not
clean everytime the project is configured because (re)building the cotire test
project takes some time.
2020-05-17 20:01:01 +02:00

25 lines
460 B
C++

// cotire example project
#include "example.h"
#ifndef NDEBUG
#include <algorithm>
#include <iterator>
#endif
namespace example {
std::string get_message() {
char msg_chrs[] = { 'C', 'o', 't', 'i', 'r', 'e', 'd', '!' };
#ifdef NDEBUG
return std::string(&msg_chrs[0], &msg_chrs[sizeof(msg_chrs)]);
#else
std::string msg;
msg.reserve(sizeof(msg_chrs));
std::copy(msg_chrs, msg_chrs + sizeof(msg_chrs), std::back_inserter(msg));
return msg;
#endif
}
}