freedreno/rnn: rework RNN_DEF_PATH construction
authorRob Clark <robdclark@chromium.org>
Sun, 2 Aug 2020 17:16:47 +0000 (10:16 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 3 Aug 2020 19:46:49 +0000 (19:46 +0000)
No need for rnn_path.h, just construct the whole thing in meson and pass
via c_args.  Also move where the path is constructed up one level.  This
will be needed for syncing back to envytools, where the path will be
different.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6154>

src/freedreno/meson.build
src/freedreno/rnn/meson.build
src/freedreno/rnn/rnn.c
src/freedreno/rnn/rnn_path.h [deleted file]

index 0517c404ff4d3e1bdb25028d79f17f731469450a..4350aa8d526880ad5db9782c6b7bf56cbef9d868 100644 (file)
 inc_freedreno = include_directories(['.', './registers', './common'])
 inc_freedreno_rnn = include_directories('rnn')
 
+rnn_src_path = meson.source_root() + '/src/freedreno/registers'
+rnn_install_path = get_option('datadir') + '/freedreno/registers'
+rnn_path = rnn_src_path + ':' + get_option('prefix') + '/' + rnn_install_path
+
 subdir('common')
 subdir('registers')
 subdir('drm')
index 678683a87977a85dc1b6afe0f1765b0e1897dbee..4711d8f3198c56bb559e6b6a33f553b8293f3833 100644 (file)
@@ -27,7 +27,6 @@ libfreedreno_rnn_files = files(
   'rnn.h',
   'rnndec.c',
   'rnndec.h',
-  'rnn_path.h',
   'util.h',
 )
 
@@ -40,9 +39,7 @@ libfreedreno_rnn = static_library(
   ],
   c_args : [
     no_override_init_args,
-    '-DSOURCE_DIR="' + meson.source_root() + '"',
-# TODO how do we get install prefix??
-    '-DINSTALL_DIR=""',
+    '-DRNN_DEF_PATH="' + rnn_path + '"',
   ],
   gnu_symbol_visibility: 'hidden',
   dependencies: [ dep_libxml2 ],
index 5c6897e40b9cd507b9921401ba16cf180d78caed..d82d2a561b02bee61e86f9d519dd0fc9417dec70 100644 (file)
@@ -39,7 +39,6 @@
 #include <ctype.h>
 #include <stdio.h>
 #include "rnn.h"
-#include "rnn_path.h"
 #include "util.h"
 
 #include "util/u_debug.h"
diff --git a/src/freedreno/rnn/rnn_path.h b/src/freedreno/rnn/rnn_path.h
deleted file mode 100644 (file)
index 3582425..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#define RNN_DEF_PATH SOURCE_DIR "/src/freedreno/registers:" INSTALL_DIR "share/mesa/freedreno/registers"