File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,12 @@ function(tablegen project ofn)
2222 endif ()
2323
2424 # Use depfile instead of globbing arbitrary *.td(s) for Ninja.
25- if (CMAKE_GENERATOR MATCHES "Ninja" )
25+ cmake_policy (GET CMP0116 CMP0116_STATE)
26+ if (CMAKE_GENERATOR MATCHES "Ninja" AND CMP0116_STATE STREQUAL NEW)
2627 # CMake emits build targets as relative paths but Ninja doesn't identify
2728 # absolute path (in *.d) as relative path (in build.ninja). Post CMP0116,
28- # CMake handles this discrepancy for us.
29+ # CMake handles this discrepancy for us, otherwise we use the fallback
30+ # logic.
2931 set (additional_cmdline
3032 -o ${ofn}
3133 -d ${ofn} .d
Original file line number Diff line number Diff line change @@ -43,12 +43,12 @@ function(_pdll_tablegen project ofn)
4343 endif ()
4444
4545 # Use depfile instead of globbing arbitrary *.td(s) for Ninja.
46- if (CMAKE_GENERATOR MATCHES "Ninja" )
47- # Make output path relative to build.ninja, assuming located on
48- # ${CMAKE_BINARY_DIR}.
46+ cmake_policy (GET CMP0116 CMP0116_STATE)
47+ if (CMAKE_GENERATOR MATCHES "Ninja" AND CMP0116_STATE STREQUAL NEW)
4948 # CMake emits build targets as relative paths but Ninja doesn't identify
5049 # absolute path (in *.d) as relative path (in build.ninja). Post CMP0116,
51- # CMake handles this discrepancy for us.
50+ # CMake handles this discrepancy for us. Otherwise, we use the fallback
51+ # logic.
5252 set (additional_cmdline
5353 -o ${ofn}
5454 -d ${ofn} .d
You can’t perform that action at this time.
0 commit comments