Resolve CMAKE_* directories before saving as build defines

Since fish began resolving symlinks it broke the running-from-build-dir
detection in fish.cpp if the build directory were a symlink (which is
common on some platforms where the default user HOME directory is a
symlink in the first place, e.g. FreeBSD).
This commit is contained in:
Mahmoud Al-Qudsi 2019-01-30 14:24:59 -06:00
parent 09ca268d50
commit d15de117b9

View file

@ -105,8 +105,10 @@ ADD_DEFINITIONS(-D_UNICODE=1
INCLUDE(Version)
# Let fish pick up when we're running out of the build directory without installing
ADD_DEFINITIONS(-DCMAKE_BINARY_DIR="${CMAKE_BINARY_DIR}")
ADD_DEFINITIONS(-DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}")
GET_FILENAME_COMPONENT(REAL_CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}" REALPATH)
GET_FILENAME_COMPONENT(REAL_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}" REALPATH)
ADD_DEFINITIONS(-DCMAKE_BINARY_DIR="${REAL_CMAKE_BINARY_DIR}")
ADD_DEFINITIONS(-DCMAKE_SOURCE_DIR="${REAL_CMAKE_SOURCE_DIR}")
# Teach fish_version.o to rebuild when FBVF changes.
# The standard C++ include detection machinery misses this.