Make logic of gyp equivalent to CMakeLists.txt.