From f5cf6c1b2c49bc60e036e5700a6c3b0ebfa73f87 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Tue, 20 Mar 2018 14:03:28 +0100 Subject: [PATCH] Include source root directory All headers and sources are in src/. To avoid using relative includes from subdirectories ("../../"), include the source root directory. --- app/meson.build | 5 ++--- app/src/sys/unix/command.c | 2 +- app/src/sys/unix/net.c | 2 +- app/src/sys/win/command.c | 6 +++--- app/src/sys/win/net.c | 4 ++-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/meson.build b/app/meson.build index 917d1eff..a206dd58 100644 --- a/app/meson.build +++ b/app/meson.build @@ -85,7 +85,8 @@ conf.set('HIDPI_SUPPORT', get_option('hidpi_support')) configure_file(configuration: conf, output: 'config.h') -executable('scrcpy', src, dependencies: dependencies, install: true) +src_dir = include_directories('src') +executable('scrcpy', src, dependencies: dependencies, include_directories: src_dir, install: true) ### TESTS @@ -96,8 +97,6 @@ tests = [ ['test_strutil', ['tests/test_strutil.c', 'src/strutil.c']], ] -src_dir = include_directories('src') - foreach t : tests exe = executable(t[0], t[1], include_directories: src_dir, dependencies: dependencies) test(t[0], exe) diff --git a/app/src/sys/unix/command.c b/app/src/sys/unix/command.c index 45f116ed..89295e57 100644 --- a/app/src/sys/unix/command.c +++ b/app/src/sys/unix/command.c @@ -1,4 +1,4 @@ -#include "../../command.h" +#include "command.h" #include #include diff --git a/app/src/sys/unix/net.c b/app/src/sys/unix/net.c index f50fbe2e..f2c82505 100644 --- a/app/src/sys/unix/net.c +++ b/app/src/sys/unix/net.c @@ -1,4 +1,4 @@ -#include "../../net.h" +#include "net.h" # include diff --git a/app/src/sys/win/command.c b/app/src/sys/win/command.c index 06ecf7c8..719d985d 100644 --- a/app/src/sys/win/command.c +++ b/app/src/sys/win/command.c @@ -1,7 +1,7 @@ -#include "../../command.h" +#include "command.h" -#include "../../log.h" -#include "../../strutil.h" +#include "log.h" +#include "strutil.h" HANDLE cmd_execute(const char *path, const char *const argv[]) { STARTUPINFO si; diff --git a/app/src/sys/win/net.c b/app/src/sys/win/net.c index 1837e0d1..140c1bce 100644 --- a/app/src/sys/win/net.c +++ b/app/src/sys/win/net.c @@ -1,6 +1,6 @@ -#include "../../net.h" +#include "net.h" -#include "../../log.h" +#include "log.h" SDL_bool net_init(void) { WSADATA wsa;