The CMake parts look okay. Instead of adding the source files to the list conditionally, I would add them both unconditionally and guard them with a preprocessor define. I prefer GEOCLUE_API_VERSION_2 to be named WTF_USE_GEOCLUE2. The GTK+ version one is not a great example to follow. The last general comment I have is that we avoid polluting the command-line flags any further, if we can avoid it. Can you try to make this option available in the config.h file. I can show you how to do it for CMake.
You should split off the conditional includes at the end of the list instead of trying to keep them alphabetical. This will make it a bit simpler here. :)
Comment on attachment 225775
Patch proposal
View in context: https:/ /bugs.webkit. org/attachment. cgi?id= 225775& action= review
The CMake parts look okay. Instead of adding the source files to the list conditionally, I would add them both unconditionally and guard them with a preprocessor define. I prefer GEOCLUE_ API_VERSION_ 2 to be named WTF_USE_GEOCLUE2. The GTK+ version one is not a great example to follow. The last general comment I have is that we avoid polluting the command-line flags any further, if we can avoid it. Can you try to make this option available in the config.h file. I can show you how to do it for CMake.
> Source/ Platform/ GNUmakefile. am:109 API_VERSION_ 2 la_CPPFLAGS += \ la_CPPFLAGS += \
> +if GEOCLUE_
> +libPlatform_
> + $(GEOCLUE2_CFLAGS)
> +else
> +libPlatform_
> + $(GEOCLUE_CFLAGS)
> +endif
You can use GEOCLUE_CFLAGS for both GeoClue1 and GeoClue2 and avoid this change.
> Source/ WebCore/ platform/ geoclue/ GeolocationProv iderGeoclue. h:37 GEOCLUE_ API_VERSION_ 2) ace.h" geoclue- master. h> geoclue- position. h> GRefPtr. h> GEOCLUE_ API_VERSION_ 2) WTFString. h>
> +#if defined(
> +#include "Geoclue2Interf
> +#else
> #include <geoclue/
> #include <geoclue/
> +#endif
> #include <wtf/gobject/
> +#if defined(
> +#include <wtf/text/
> +#endif
You should split off the conditional includes at the end of the list instead of trying to keep them alphabetical. This will make it a bit simpler here. :)
> Source/ WebCore/ platform/ geoclue/ GeolocationProv iderGeoclue2. cpp:36 p.GeoClue2" MANAGER_ PATH "/org/freedeskt op/GeoClue2/ Manager"
> +#define GEOCLUE_BUS_NAME "org.freedeskto
> +#define GEOCLUE_
Please use static const char* for these.
> Source/ WebCore/ platform/ geoclue/ GeolocationProv iderGeoclue2. cpp:44 velCountry = 1, velCity = 4, velStreet = 6, velExact = 8,
> + GClueAccuracyLe
> + GClueAccuracyLe
> + GClueAccuracyLe
> + GClueAccuracyLe
GClue -> GeoClue.