maybe fix HHVM CMake incremental builds
commitb3553ed7d6bf7f667f10244008cea6f42ea4bd6f
authorJán <jjergus@fb.com>
Wed, 4 Mar 2020 02:34:03 +0000 (3 18:34 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 4 Mar 2020 02:50:19 +0000 (3 18:50 -0800)
tree86bebe0eb14de1fd33e447ee7692aae0d5d6e5d8
parentf9a08e2437affffc1700fb3032bc3477ca2b34d3
maybe fix HHVM CMake incremental builds

Summary:
Orvid it looks like you originally wrote these parts, maybe you can provide more context about how it works or suggest better solutions.

As far as I can tell, the high-level issue here is that:

1. Some time ago, we used to always do `target_link_libraries` and `target_include_directories` separately, so we had fine control over what gets passed to the linker and what include directories get passed to the compiler.
2. But now, in a bunch of places, we rely on the fact that `target_link_libraries` in CMake can also handle include directories automatically (AFAIK this depends on what's declared as PRIVATE/PUBLIC/INTERFACE in CMake). For example, we do `target_link_libraries(${target} libzip)` and rely on the fact that this also adds the correct include directories to `${target}` (since our libzip CMake config declares INTERFACE include directories).
3. This means that calling `hphp_link` conditionally here means that we sometimes don't correctly set include directories.

I might be misunderstanding some of it though, my CMake knowledge is very rudimentary.

Removing the `NOT ENABLE_LD_GOLD` seems to fix the Linux incremental build but MSVC is likely broken with no obvious way to fix it.

Reviewed By: fredemmott

Differential Revision: D20237234

fbshipit-source-id: 866a28b6feb869147f46eee598d7b2949a0c5d82
CMake/HPHPFunctions.cmake