initial commit
Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# cotire example project
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
if (POLICY CMP0058)
|
||||
# Ninja requires custom command byproducts to be explicit
|
||||
cmake_policy(SET CMP0058 NEW)
|
||||
endif()
|
||||
|
||||
project (CotireExample)
|
||||
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/..")
|
||||
|
||||
if (NOT CMAKE_VERSION VERSION_LESS "3.1.0")
|
||||
set (CMAKE_CXX_STANDARD "98")
|
||||
set (CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
include(cotire)
|
||||
|
||||
add_subdirectory(src)
|
||||
22
libs/wxWidgets-3.3.1/build/cmake/modules/cotire_test/license
Normal file
22
libs/wxWidgets-3.3.1/build/cmake/modules/cotire_test/license
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2012-2018 Sascha Kratky
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER 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.
|
||||
@@ -0,0 +1,31 @@
|
||||
# cotire example project
|
||||
|
||||
add_executable(example main.cpp example.cpp log.cpp log.h example.h)
|
||||
|
||||
# enable warnings
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set_target_properties(example PROPERTIES COMPILE_FLAGS "-Weverything")
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set_target_properties(example PROPERTIES COMPILE_FLAGS "-Wall -Wextra")
|
||||
endif()
|
||||
|
||||
cotire(example)
|
||||
|
||||
# cotire sets the following properties
|
||||
get_target_property(_unitySource example COTIRE_CXX_UNITY_SOURCE)
|
||||
get_target_property(_prefixHeader example COTIRE_CXX_PREFIX_HEADER)
|
||||
get_target_property(_precompiledHeader example COTIRE_CXX_PRECOMPILED_HEADER)
|
||||
get_target_property(_unityTargetName example COTIRE_UNITY_TARGET_NAME)
|
||||
|
||||
if (_unitySource)
|
||||
message(STATUS "example unity source: ${_unitySource}")
|
||||
endif()
|
||||
if (_prefixHeader)
|
||||
message(STATUS "example prefix header: ${_prefixHeader}")
|
||||
endif()
|
||||
if (_precompiledHeader)
|
||||
message(STATUS "example precompiled header: ${_precompiledHeader}")
|
||||
endif()
|
||||
if (TARGET ${_unityTargetName})
|
||||
message(STATUS "example unity target: ${_unityTargetName}")
|
||||
endif()
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// cotire example project
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace example {
|
||||
|
||||
std::string get_message();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// cotire example project
|
||||
|
||||
#include "log.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace logging {
|
||||
|
||||
void error(const std::string& msg) {
|
||||
std::cerr << msg << std::endl;
|
||||
}
|
||||
|
||||
void info(const std::string& msg) {
|
||||
std::cout << msg << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// cotire example project
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace logging {
|
||||
|
||||
void error(const std::string& msg);
|
||||
void info(const std::string& msg);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// cotire example project main
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "example.h"
|
||||
#include "log.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string msg = example::get_message();
|
||||
logging::info(msg);
|
||||
}
|
||||
Reference in New Issue
Block a user