[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
This commit is contained in:
Jérôme Gardou 2018-10-26 13:47:22 +02:00 committed by GitHub
parent 3e00e7fb22
commit 07bd6089ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 5 deletions

View file

@ -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")

View file

@ -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 */

View file

@ -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 */

View file

@ -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)

View file

@ -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