mirror of
https://github.com/reactos/CMake.git
synced 2024-11-23 11:39:48 +00:00
FindBISON: Fix CMP0088 NEW behavior for non-absolute input paths
Now that the working directory is in the build tree, relative input paths must be converted to an absolute path to remain relative to the source directory. Fixes: #19472
This commit is contained in:
parent
f3e9a6ff62
commit
f84d2045e9
@ -420,3 +420,11 @@ Changes made since CMake 3.14.0 include the following.
|
||||
from explicit use via :command:`include_directories` and
|
||||
:command:`target_include_directories` as they were in CMake 3.14.0
|
||||
through 3.14.4.
|
||||
|
||||
3.14.6
|
||||
------
|
||||
|
||||
* In CMake 3.14.0 through 3.14.5, the :module:`FindBISON` module
|
||||
policy :policy:`CMP0088` ``NEW`` behavior accidentally interpreted
|
||||
a relative path to the ``.y`` input as relative to the build tree
|
||||
directory instead of the source tree directory. This has been fixed.
|
||||
|
@ -257,15 +257,19 @@ if(BISON_EXECUTABLE)
|
||||
PARENT_SCOPE # undocumented, do not use outside of CMake
|
||||
)
|
||||
set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(_BisonInput "${BisonInput}")
|
||||
if("x${_BISON_CMP0088}x" STREQUAL "xNEWx")
|
||||
set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
if(NOT IS_ABSOLUTE "${_BisonInput}")
|
||||
set(_BisonInput "${CMAKE_CURRENT_SOURCE_DIR}/${_BisonInput}")
|
||||
endif()
|
||||
endif()
|
||||
unset(_BISON_CMP0088)
|
||||
|
||||
add_custom_command(OUTPUT ${BISON_TARGET_outputs}
|
||||
COMMAND ${BISON_EXECUTABLE} ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${BisonInput}
|
||||
COMMAND ${BISON_EXECUTABLE} ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${_BisonInput}
|
||||
VERBATIM
|
||||
DEPENDS ${BisonInput}
|
||||
DEPENDS ${_BisonInput}
|
||||
COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
|
||||
WORKING_DIRECTORY ${_BISON_WORKING_DIRECTORY})
|
||||
|
||||
@ -273,12 +277,14 @@ if(BISON_EXECUTABLE)
|
||||
|
||||
# define target variables
|
||||
set(BISON_${Name}_DEFINED TRUE)
|
||||
set(BISON_${Name}_INPUT ${BisonInput})
|
||||
set(BISON_${Name}_INPUT ${_BisonInput})
|
||||
set(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs} ${BISON_TARGET_extraoutputs})
|
||||
set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
|
||||
set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
|
||||
set(BISON_${Name}_OUTPUT_HEADER "${BISON_TARGET_output_header}")
|
||||
|
||||
unset(_BisonInput)
|
||||
|
||||
endif()
|
||||
endmacro()
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user