https://git.reactos.org/?p=reactos.git;a=commitdiff;h=07bd6089ec96b068d92f4…
commit 07bd6089ec96b068d92f42e764cc7336a7de24a0
Author: Jérôme Gardou <zefklop(a)users.noreply.github.com>
AuthorDate: Fri Oct 26 13:47:22 2018 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Oct 26 13:47:22 2018 +0200
[CMAKE] Use configured include files to define the __RELFILE__ hack (#979)
[CMAKE] Use configured include files to define the __RELFILE__ hack
It's easier on the command line and the eyes looking at it
---
CMakeLists.txt | 3 ---
sdk/include/reactos/builddir.h.cmake | 7 +++++++
sdk/include/reactos/debug.h | 7 ++++++-
sdk/include/reactos/version.cmake | 1 +
sdk/include/reactos/wine/debug.h | 7 ++++++-
5 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2e8b861ee..f79577f65d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,9 +57,6 @@ endif()
include(sdk/cmake/compilerflags.cmake)
add_definitions(-D__REACTOS__)
-add_definitions(-DREACTOS_SOURCE_DIR="\\"${REACTOS_SOURCE_DIR}\\"")
-add_definitions(-DREACTOS_BINARY_DIR="\\"${REACTOS_BINARY_DIR}\\"")
-add_compile_flags(-D__RELFILE__="&__FILE__[sizeof REACTOS_SOURCE_DIR]")
if(MSVC_IDE)
add_compile_flags("/MP")
diff --git a/sdk/include/reactos/builddir.h.cmake b/sdk/include/reactos/builddir.h.cmake
new file mode 100644
index 0000000000..8bd5b44ac5
--- /dev/null
+++ b/sdk/include/reactos/builddir.h.cmake
@@ -0,0 +1,7 @@
+/* Do not edit - Machine generated */
+#pragma once
+
+#define REACTOS_SOURCE_DIR "@REACTOS_SOURCE_DIR@"
+#define REACTOS_BINARY_DIR "@REACTOS_BINARY_DIR@"
+
+/* EOF */
diff --git a/sdk/include/reactos/debug.h b/sdk/include/reactos/debug.h
index ab332fda18..f56090b65c 100644
--- a/sdk/include/reactos/debug.h
+++ b/sdk/include/reactos/debug.h
@@ -15,7 +15,12 @@
#pragma once
#ifndef __RELFILE__
-#define __RELFILE__ __FILE__
+# ifdef __REACTOS__
+# include <reactos/builddir.h>
+# define __RELFILE__ &__FILE__[sizeof(REACTOS_SOURCE_DIR)]
+# else
+# define __RELFILE__ __FILE__
+# endif
#endif
/* Define DbgPrint/DbgPrintEx/RtlAssert unless the NDK is used */
diff --git a/sdk/include/reactos/version.cmake b/sdk/include/reactos/version.cmake
index 9314a56cfc..46a424728a 100644
--- a/sdk/include/reactos/version.cmake
+++ b/sdk/include/reactos/version.cmake
@@ -53,3 +53,4 @@ endif()
configure_file(sdk/include/reactos/version.h.cmake
${REACTOS_BINARY_DIR}/sdk/include/reactos/version.h)
configure_file(sdk/include/reactos/buildno.h.cmake
${REACTOS_BINARY_DIR}/sdk/include/reactos/buildno.h)
+configure_file(sdk/include/reactos/builddir.h.cmake
${REACTOS_BINARY_DIR}/sdk/include/reactos/builddir.h)
diff --git a/sdk/include/reactos/wine/debug.h b/sdk/include/reactos/wine/debug.h
index 35aefc9852..23f402a13f 100644
--- a/sdk/include/reactos/wine/debug.h
+++ b/sdk/include/reactos/wine/debug.h
@@ -28,7 +28,12 @@
#endif
#ifndef __RELFILE__
-#define __RELFILE__ __FILE__
+# ifdef __REACTOS__
+# include <reactos/builddir.h>
+# define __RELFILE__ &__FILE__[sizeof(REACTOS_SOURCE_DIR)]
+# else
+# define __RELFILE__ __FILE__
+# endif
#endif
#ifdef __WINE_WINE_TEST_H