From 955213eb33f28f619bebc22d6b1c1b2935a18ba5 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 3 Nov 2017 21:09:20 +0000 Subject: [PATCH 1/3] build: version 39.0 should be enough this brings edi to ubuntu 17.04 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 00e1ff3..cf4c08f 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'edi', 'c', version : '0.6.99', default_options: [ 'c_std=gnu99', 'warning_level=2' ], - meson_version : '>= 0.40.0') + meson_version : '>= 0.39.0') add_global_arguments('-DHAVE_CONFIG_H=1', '-DHAVE_CONFIG=1', language: 'c') From 2c062ef0bbbfae6b29e79e6c69d6266e40e765cc Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 3 Nov 2017 21:09:37 +0000 Subject: [PATCH 2/3] Revert "meson: remove exposure of lookup paths" This reverts commit a7a6b9cb7fa0cd0f880e21c2d2f7853754fff95e. This brings back the option for settings the path, ubuntu decides to hide the headers in a none standard directory, so they need to be spectified. --- meson.build | 22 +++++++++++++--------- meson_options.txt | 2 ++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index cf4c08f..2800a46 100644 --- a/meson.build +++ b/meson.build @@ -40,20 +40,24 @@ else config_h.set_quoted('BEAR_COMMAND', '') endif -clang_header_dir = '' -clang_link_dir = '' +opt_clang_header_dir = get_option('libclang-headerdir') +opt_clang_link_dir = get_option('libclang-libdir') if build_machine.system() == 'darwin' - clang_header_dir = '/usr/local/opt/llvm/include' - clang_link_dir = '/usr/local/opt/llvm/lib' + if opt_clang_header_dir == '' + opt_clang_header_dir = '/usr/local/opt/llvm/include' + endif + if opt_clang_link_dir == '' + opt_clang_link_dir = '/usr/local/opt/llvm/lib' + endif endif if get_option('libclang') == true #check for the header found = false - if clang_header_dir != '' - found = cc.has_header('clang-c/Index.h', args : '-I'+clang_header_dir) + if opt_clang_header_dir != '' + found = cc.has_header('clang-c/Index.h', args : '-I'+opt_clang_header_dir) else found = cc.has_header('clang-c/Index.h') endif @@ -62,11 +66,11 @@ if get_option('libclang') == true error('Clang header not found!') endif - clang_inc = include_directories(clang_header_dir) + clang_inc = include_directories(opt_clang_header_dir) #check for the library to link - if clang_link_dir != '' - clang = cc.find_library('clang', dirs : [clang_link_dir]) + if opt_clang_link_dir != '' + clang = cc.find_library('clang', dirs : [opt_clang_link_dir]) else clang = cc.find_library('clang') endif diff --git a/meson_options.txt b/meson_options.txt index 10ae169..61f4286 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,4 @@ option('libclang', type : 'boolean', value : true, description : 'Weather to have libclang support') option('bear', type : 'boolean', value : true, description : 'Weather to have bear support') +option('libclang-libdir', type : 'string', value : '', description : 'Specify a none default location for your clang installation') +option('libclang-headerdir', type : 'string', value : '', description : 'Specify a none default location for your clang installation') From f488057e322b1c0a805a7ce52fa5e4237d177a32 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 4 Nov 2017 10:32:28 +0000 Subject: [PATCH 3/3] build: use a include directory and not relative paths in older meson versions relative paths are sometimes evalulated from the build directory and sometimes from the source diretory. --- src/bin/meson.build | 2 ++ src/lib/meson.build | 2 ++ src/tests/meson.build | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/meson.build b/src/bin/meson.build index 809c4c2..c8d8308 100644 --- a/src/bin/meson.build +++ b/src/bin/meson.build @@ -21,6 +21,8 @@ src = files([ 'edi_searchpanel.h', ]) +bin_dir = include_directories('.') + foreach package : packages subdir(package) endforeach diff --git a/src/lib/meson.build b/src/lib/meson.build index 33a1992..691a47d 100644 --- a/src/lib/meson.build +++ b/src/lib/meson.build @@ -23,6 +23,8 @@ src = files([ 'md5.h', ]) +lib_dir = include_directories('.') + edi_lib_lib = shared_library('edi', src, dependencies : [elm], include_directories : top_inc, diff --git a/src/tests/meson.build b/src/tests/meson.build index 5c50f9a..482acd1 100644 --- a/src/tests/meson.build +++ b/src/tests/meson.build @@ -12,7 +12,7 @@ src = files([ check = dependency('check') deps = [elm, check, edi_lib, intl] -incls = [include_directories('../../../src/bin'), include_directories('../../../src/lib'), top_inc] +incls = [lib_dir, bin_dir, top_inc] if get_option('libclang') == true deps += [clang]