diff --git a/CMakeLists.txt b/CMakeLists.txt index f24b57b8..71a7875b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" diff --git a/coord/ops.hpp b/coord/ops.hpp index c2ccd407..d8093bf8 100644 --- a/coord/ops.hpp +++ b/coord/ops.hpp @@ -17,9 +17,10 @@ #include "../tuple/value.hpp" #include "../debug.hpp" #include "../maths.hpp" -#include "../preprocessor.hpp" #include "../types/bits.hpp" +#include + #include #include #include diff --git a/coord/store.hpp b/coord/store.hpp index 841b06c6..0707d1f0 100644 --- a/coord/store.hpp +++ b/coord/store.hpp @@ -11,9 +11,10 @@ #include "fwd.hpp" -#include "../preprocessor.hpp" #include "../platform.hpp" +#include + #include #include diff --git a/debug.cpp b/debug.cpp index 725436dd..d8c95170 100644 --- a/debug.cpp +++ b/debug.cpp @@ -9,7 +9,8 @@ #include "backtrace.hpp" #include "debug.hpp" #include "log.hpp" -#include "preprocessor.hpp" + +#include #include #include diff --git a/introspection.hpp b/introspection.hpp index 262a3226..fd9d2f8a 100644 --- a/introspection.hpp +++ b/introspection.hpp @@ -9,9 +9,10 @@ #ifndef __UTIL_INTROSPECTION_HPP #define __UTIL_INTROSPECTION_HPP -#include "preprocessor.hpp" #include "variadic.hpp" +#include + #include #include #include diff --git a/log.hpp b/log.hpp index 6ba71ce5..30cc284c 100644 --- a/log.hpp +++ b/log.hpp @@ -11,9 +11,10 @@ #include "nocopy.hpp" -#include "preprocessor.hpp" #include "format.hpp" +#include + #include #include diff --git a/test/preprocessor.cpp b/test/preprocessor.cpp index 4279de8c..14852c0e 100644 --- a/test/preprocessor.cpp +++ b/test/preprocessor.cpp @@ -1,5 +1,5 @@ -#include "tap.hpp" -#include "preprocessor.hpp" +#include +#include #define PLUS(X,Y) ((X)+(Y))