mirror of
https://github.com/reactos/reactos.git
synced 2025-01-02 20:43:18 +00:00
[CMAKE] Zap builddir.h.cmake and instead define macros globally
This changes __RELFILE__ to always be relative and not rely on a GCC extension, since __FILE__ is *always* relative to the root.
This commit is contained in:
parent
73aa420f0e
commit
79ad68ddc3
6 changed files with 9 additions and 21 deletions
|
@ -56,6 +56,9 @@ endif()
|
||||||
include(sdk/cmake/compilerflags.cmake)
|
include(sdk/cmake/compilerflags.cmake)
|
||||||
|
|
||||||
add_definitions(-D__REACTOS__)
|
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)
|
if(MSVC_IDE)
|
||||||
add_compile_flags("/MP")
|
add_compile_flags("/MP")
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
/* Do not edit - Machine generated */
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#define REACTOS_SOURCE_DIR "@REACTOS_SOURCE_DIR@"
|
|
||||||
#define REACTOS_BINARY_DIR "@REACTOS_BINARY_DIR@"
|
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define __RELFILE__ \
|
|
||||||
(!__builtin_strncmp(__FILE__, REACTOS_SOURCE_DIR, sizeof(REACTOS_SOURCE_DIR) - 1) \
|
|
||||||
? __FILE__ + sizeof(REACTOS_SOURCE_DIR) : __FILE__)
|
|
||||||
#else
|
|
||||||
#define __RELFILE__ __FILE__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -14,7 +14,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <builddir.h>
|
#ifndef __RELFILE__
|
||||||
|
#define __RELFILE__ __FILE__
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define DbgPrint/DbgPrintEx/RtlAssert unless the NDK is used */
|
/* Define DbgPrint/DbgPrintEx/RtlAssert unless the NDK is used */
|
||||||
#if !defined(_RTLFUNCS_H) && !defined(_NTDDK_)
|
#if !defined(_RTLFUNCS_H) && !defined(_NTDDK_)
|
||||||
|
|
|
@ -53,4 +53,3 @@ endif()
|
||||||
|
|
||||||
configure_file(sdk/include/reactos/version.h.cmake ${REACTOS_BINARY_DIR}/sdk/include/reactos/version.h)
|
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/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)
|
|
||||||
|
|
|
@ -27,7 +27,9 @@
|
||||||
#include <guiddef.h>
|
#include <guiddef.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <builddir.h>
|
#ifndef __RELFILE__
|
||||||
|
#define __RELFILE__ __FILE__
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __WINE_WINE_TEST_H
|
#ifdef __WINE_WINE_TEST_H
|
||||||
#error This file should not be used in Wine tests
|
#error This file should not be used in Wine tests
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
|
|
||||||
#if DBG
|
#if DBG
|
||||||
|
|
||||||
#include <builddir.h>
|
|
||||||
|
|
||||||
#if !defined(__RELFILE__)
|
#if !defined(__RELFILE__)
|
||||||
#define __RELFILE__ __FILE__
|
#define __RELFILE__ __FILE__
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue