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