preprocessor: build the header out of tree
This avoids unnecessary rebuilds when we have parallel configurations being built.
This commit is contained in:
parent
888d88a74d
commit
bfe0a92eec
@ -32,6 +32,17 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
###############################################################################
|
||||
add_library(cruft)
|
||||
|
||||
|
||||
# Setup a directory to hold built sources we may need to export to clients.
|
||||
set (PREFIX "cruft/util")
|
||||
file (MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/prefix/${PREFIX}")
|
||||
target_include_directories(
|
||||
cruft
|
||||
PUBLIC
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/prefix/"
|
||||
)
|
||||
|
||||
|
||||
# Preemptively define an identity panic macro so that TCL doens't fuck us over
|
||||
# by renaming a commonly used symbol.
|
||||
target_compile_definitions(cruft PUBLIC "-Dpanic=panic")
|
||||
@ -344,7 +355,7 @@ list (
|
||||
polynomial.hpp
|
||||
pool.cpp
|
||||
pool.hpp
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.hpp"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/prefix/${PREFIX}/preprocessor.hpp"
|
||||
quaternion.cpp
|
||||
quaternion.hpp
|
||||
rand/lcg.cpp
|
||||
@ -440,13 +451,13 @@ endif ()
|
||||
## to coax CMake into behaving here any longer. Feel free to fix it.
|
||||
add_custom_command (
|
||||
OUTPUT
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.hpp"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/prefix/${PREFIX}/preprocessor.hpp"
|
||||
COMMENT
|
||||
"[preprocessor.py] preprocessor.hpp"
|
||||
COMMAND
|
||||
"${PYTHON_EXECUTABLE}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.py"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.hpp"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/prefix/${PREFIX}/preprocessor.hpp"
|
||||
320
|
||||
DEPENDS
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.py"
|
||||
|
@ -17,9 +17,10 @@
|
||||
#include "../tuple/value.hpp"
|
||||
#include "../debug.hpp"
|
||||
#include "../maths.hpp"
|
||||
#include "../preprocessor.hpp"
|
||||
#include "../types/bits.hpp"
|
||||
|
||||
#include <cruft/util/preprocessor.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
|
@ -11,9 +11,10 @@
|
||||
|
||||
#include "fwd.hpp"
|
||||
|
||||
#include "../preprocessor.hpp"
|
||||
#include "../platform.hpp"
|
||||
|
||||
#include <cruft/util/preprocessor.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
|
@ -9,7 +9,8 @@
|
||||
#include "backtrace.hpp"
|
||||
#include "debug.hpp"
|
||||
#include "log.hpp"
|
||||
#include "preprocessor.hpp"
|
||||
|
||||
#include <cruft/util/preprocessor.hpp>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
@ -9,9 +9,10 @@
|
||||
#ifndef __UTIL_INTROSPECTION_HPP
|
||||
#define __UTIL_INTROSPECTION_HPP
|
||||
|
||||
#include "preprocessor.hpp"
|
||||
#include "variadic.hpp"
|
||||
|
||||
#include <cruft/util/preprocessor.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
3
log.hpp
3
log.hpp
@ -11,9 +11,10 @@
|
||||
|
||||
#include "nocopy.hpp"
|
||||
|
||||
#include "preprocessor.hpp"
|
||||
#include "format.hpp"
|
||||
|
||||
#include <cruft/util/preprocessor.hpp>
|
||||
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "tap.hpp"
|
||||
#include "preprocessor.hpp"
|
||||
#include <cruft/util/tap.hpp>
|
||||
#include <cruft/util/preprocessor.hpp>
|
||||
|
||||
|
||||
#define PLUS(X,Y) ((X)+(Y))
|
||||
|
Loading…
Reference in New Issue
Block a user