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)
|
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
|
# Preemptively define an identity panic macro so that TCL doens't fuck us over
|
||||||
# by renaming a commonly used symbol.
|
# by renaming a commonly used symbol.
|
||||||
target_compile_definitions(cruft PUBLIC "-Dpanic=panic")
|
target_compile_definitions(cruft PUBLIC "-Dpanic=panic")
|
||||||
@ -344,7 +355,7 @@ list (
|
|||||||
polynomial.hpp
|
polynomial.hpp
|
||||||
pool.cpp
|
pool.cpp
|
||||||
pool.hpp
|
pool.hpp
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.hpp"
|
"${CMAKE_CURRENT_BINARY_DIR}/prefix/${PREFIX}/preprocessor.hpp"
|
||||||
quaternion.cpp
|
quaternion.cpp
|
||||||
quaternion.hpp
|
quaternion.hpp
|
||||||
rand/lcg.cpp
|
rand/lcg.cpp
|
||||||
@ -440,13 +451,13 @@ endif ()
|
|||||||
## to coax CMake into behaving here any longer. Feel free to fix it.
|
## to coax CMake into behaving here any longer. Feel free to fix it.
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
OUTPUT
|
OUTPUT
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.hpp"
|
"${CMAKE_CURRENT_BINARY_DIR}/prefix/${PREFIX}/preprocessor.hpp"
|
||||||
COMMENT
|
COMMENT
|
||||||
"[preprocessor.py] preprocessor.hpp"
|
"[preprocessor.py] preprocessor.hpp"
|
||||||
COMMAND
|
COMMAND
|
||||||
"${PYTHON_EXECUTABLE}"
|
"${PYTHON_EXECUTABLE}"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.py"
|
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.py"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.hpp"
|
"${CMAKE_CURRENT_BINARY_DIR}/prefix/${PREFIX}/preprocessor.hpp"
|
||||||
320
|
320
|
||||||
DEPENDS
|
DEPENDS
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.py"
|
"${CMAKE_CURRENT_SOURCE_DIR}/preprocessor.py"
|
||||||
|
@ -17,9 +17,10 @@
|
|||||||
#include "../tuple/value.hpp"
|
#include "../tuple/value.hpp"
|
||||||
#include "../debug.hpp"
|
#include "../debug.hpp"
|
||||||
#include "../maths.hpp"
|
#include "../maths.hpp"
|
||||||
#include "../preprocessor.hpp"
|
|
||||||
#include "../types/bits.hpp"
|
#include "../types/bits.hpp"
|
||||||
|
|
||||||
|
#include <cruft/util/preprocessor.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
@ -11,9 +11,10 @@
|
|||||||
|
|
||||||
#include "fwd.hpp"
|
#include "fwd.hpp"
|
||||||
|
|
||||||
#include "../preprocessor.hpp"
|
|
||||||
#include "../platform.hpp"
|
#include "../platform.hpp"
|
||||||
|
|
||||||
|
#include <cruft/util/preprocessor.hpp>
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
#include "backtrace.hpp"
|
#include "backtrace.hpp"
|
||||||
#include "debug.hpp"
|
#include "debug.hpp"
|
||||||
#include "log.hpp"
|
#include "log.hpp"
|
||||||
#include "preprocessor.hpp"
|
|
||||||
|
#include <cruft/util/preprocessor.hpp>
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
#ifndef __UTIL_INTROSPECTION_HPP
|
#ifndef __UTIL_INTROSPECTION_HPP
|
||||||
#define __UTIL_INTROSPECTION_HPP
|
#define __UTIL_INTROSPECTION_HPP
|
||||||
|
|
||||||
#include "preprocessor.hpp"
|
|
||||||
#include "variadic.hpp"
|
#include "variadic.hpp"
|
||||||
|
|
||||||
|
#include <cruft/util/preprocessor.hpp>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
3
log.hpp
3
log.hpp
@ -11,9 +11,10 @@
|
|||||||
|
|
||||||
#include "nocopy.hpp"
|
#include "nocopy.hpp"
|
||||||
|
|
||||||
#include "preprocessor.hpp"
|
|
||||||
#include "format.hpp"
|
#include "format.hpp"
|
||||||
|
|
||||||
|
#include <cruft/util/preprocessor.hpp>
|
||||||
|
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "tap.hpp"
|
#include <cruft/util/tap.hpp>
|
||||||
#include "preprocessor.hpp"
|
#include <cruft/util/preprocessor.hpp>
|
||||||
|
|
||||||
|
|
||||||
#define PLUS(X,Y) ((X)+(Y))
|
#define PLUS(X,Y) ((X)+(Y))
|
||||||
|
Loading…
Reference in New Issue
Block a user