Provide CMake config files for CMake projects (#2057)
* Remove wrong librz.pc.in file * Add plugindir variable to .pc files to allow easy plugin configuration * Add CMake config files to find Rizin in CMake projects * Add CI jobs to check cmake files * Provide workaround for mesonbuild/meson#9702 * Use .lib suffix and no prefix on MSVC to make CMake files work * Disable cmake files on static libraries build
This commit is contained in:
parent
9465cca0f5
commit
47e1cb8335
37 changed files with 919 additions and 117 deletions
6
.github/cmake_test/CMakeLists.txt
vendored
Normal file
6
.github/cmake_test/CMakeLists.txt
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
project(RizinCMakeTest VERSION 1.0.0)
|
||||||
|
|
||||||
|
find_package(Rizin COMPONENTS Core)
|
||||||
|
add_executable(rizin_cmake_test rz_core_test.c)
|
||||||
|
target_link_libraries(rizin_cmake_test PRIVATE Rizin::Core)
|
||||||
10
.github/cmake_test/rz_core_test.c
vendored
Normal file
10
.github/cmake_test/rz_core_test.c
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <rz_core.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
RzCore *core = rz_core_new();
|
||||||
|
rz_cons_printf("hello %s\n", argv[0]);
|
||||||
|
rz_cons_flush();
|
||||||
|
rz_core_free(core);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
|
|
@ -545,11 +545,19 @@ jobs:
|
||||||
working-directory: rizin
|
working-directory: rizin
|
||||||
- name: Check that installed rizin runs
|
- name: Check that installed rizin runs
|
||||||
run: rizin -qcq /bin/ls
|
run: rizin -qcq /bin/ls
|
||||||
- name: Check that libraries can be used
|
- name: Check that libraries can be used with pkg-config
|
||||||
run: |
|
run: |
|
||||||
echo -e "#include <rz_util.h>\nint main(int argc, char **argv) { return rz_str_newf (\"%s\", argv[0]) != NULL? 0: 1; }" > test.c
|
echo -e "#include <rz_util.h>\nint main(int argc, char **argv) { return rz_str_newf (\"%s\", argv[0]) != NULL? 0: 1; }" > test.c
|
||||||
clang -o test test.c $(pkg-config --libs --cflags rz_util)
|
clang -o test test.c $(pkg-config --libs --cflags rz_util)
|
||||||
./test
|
./test
|
||||||
|
- name: Check CMake config files
|
||||||
|
run: |
|
||||||
|
cd .github/cmake_test
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake ..
|
||||||
|
make
|
||||||
|
./rizin_cmake_test
|
||||||
|
working-directory: rizin
|
||||||
|
|
||||||
build-osx-pkg:
|
build-osx-pkg:
|
||||||
name: Build OSX package
|
name: Build OSX package
|
||||||
|
|
@ -788,9 +796,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
- name: Install pkg-config
|
- name: Install pkg-config and cmake
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: choco install -y pkgconfiglite
|
run: choco install -y cmake pkgconfiglite
|
||||||
- name: Extract rizin version
|
- name: Extract rizin version
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: echo "##[set-output name=branch;]$( python sys\\version.py )"
|
run: echo "##[set-output name=branch;]$( python sys\\version.py )"
|
||||||
|
|
@ -805,7 +813,7 @@ jobs:
|
||||||
- name: Check that installed rizin runs
|
- name: Check that installed rizin runs
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: ~\AppData\Local\Programs\rizin\bin\rizin.exe -qcq .\rizin.exe
|
run: ~\AppData\Local\Programs\rizin\bin\rizin.exe -qcq .\rizin.exe
|
||||||
- name: Check that libraries can be used
|
- name: Check that libraries can be used with pkg-config
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
.\dist\windows\vsdevenv.ps1 ${{ matrix.bits }}
|
.\dist\windows\vsdevenv.ps1 ${{ matrix.bits }}
|
||||||
|
|
@ -816,6 +824,18 @@ jobs:
|
||||||
echo "#include <rz_util.h>`nint main(int argc, char **argv) { return rz_str_newf (`"%s`", argv[0]) != NULL? 0: 1; }" > test.c
|
echo "#include <rz_util.h>`nint main(int argc, char **argv) { return rz_str_newf (`"%s`", argv[0]) != NULL? 0: 1; }" > test.c
|
||||||
cl -IC:$env:HOMEPATH\AppData\Local\Programs\rizin\include\librz -IC:$env:HOMEPATH\AppData\Local\Programs\rizin\include\librz\sdb /Fetest.exe test.c /link /libpath:C:$env:HOMEPATH\AppData\Local\Programs\rizin\lib rz_util.lib
|
cl -IC:$env:HOMEPATH\AppData\Local\Programs\rizin\include\librz -IC:$env:HOMEPATH\AppData\Local\Programs\rizin\include\librz\sdb /Fetest.exe test.c /link /libpath:C:$env:HOMEPATH\AppData\Local\Programs\rizin\lib rz_util.lib
|
||||||
.\test.exe
|
.\test.exe
|
||||||
|
- name: Check CMake config files
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
.\dist\windows\vsdevenv.ps1 ${{ matrix.bits }}
|
||||||
|
$env:PATH = "$env:PATH;C:$env:HOMEPATH\AppData\Local\Programs\rizin\bin"
|
||||||
|
$env:PKG_CONFIG_PATH = "C:$env:HOMEPATH\AppData\Local\Programs\rizin\lib\pkgconfig"
|
||||||
|
$env:PKG_CONFIG_PATH
|
||||||
|
cd .github/cmake_test
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake -G Ninja ..
|
||||||
|
ninja
|
||||||
|
.\rizin_cmake_test
|
||||||
|
|
||||||
create-release:
|
create-release:
|
||||||
name: Create draft release and upload artifacts
|
name: Create draft release and upload artifacts
|
||||||
|
|
|
||||||
|
|
@ -167,10 +167,6 @@ Files: pkgcfg/*.pc.acr
|
||||||
Copyright: 2009 RadareOrg <pancake@nopcode.org>
|
Copyright: 2009 RadareOrg <pancake@nopcode.org>
|
||||||
License: LGPL-3.0-only
|
License: LGPL-3.0-only
|
||||||
|
|
||||||
Files: librz/librz.pc.in
|
|
||||||
Copyright: 2009 RadareOrg <pancake@nopcode.org>
|
|
||||||
License: LGPL-3.0-only
|
|
||||||
|
|
||||||
Files: subprojects/*.wrap
|
Files: subprojects/*.wrap
|
||||||
Copyright: 2021 RizinOrg <info@rizin.re>
|
Copyright: 2021 RizinOrg <info@rizin.re>
|
||||||
License: LGPL-3.0-only
|
License: LGPL-3.0-only
|
||||||
|
|
|
||||||
108
librz/RizinConfig.cmake.in
Normal file
108
librz/RizinConfig.cmake.in
Normal file
|
|
@ -0,0 +1,108 @@
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# This module provides the Rizin package, which is composed of multiple
|
||||||
|
# components, such as:
|
||||||
|
#
|
||||||
|
# Analysis
|
||||||
|
# Asm
|
||||||
|
# Bin
|
||||||
|
# Bp
|
||||||
|
# Config
|
||||||
|
# Cons
|
||||||
|
# Core
|
||||||
|
# Crypto
|
||||||
|
# Debug
|
||||||
|
# Demangler
|
||||||
|
# Diff
|
||||||
|
# Egg
|
||||||
|
# Flag
|
||||||
|
# Hash
|
||||||
|
# Il
|
||||||
|
# IO
|
||||||
|
# Lang
|
||||||
|
# Librz
|
||||||
|
# Magic
|
||||||
|
# Main
|
||||||
|
# Parse
|
||||||
|
# Reg
|
||||||
|
# Search
|
||||||
|
# Signature
|
||||||
|
# Socket
|
||||||
|
# Syscall
|
||||||
|
# Type
|
||||||
|
# Util
|
||||||
|
#
|
||||||
|
# This file is intended to be consumed by clients who wish to use Rizin libraries
|
||||||
|
# from CMake. It can be used by doing `find_package(Rizin COMPONENTS Bin IO)` from
|
||||||
|
# within a `CMakeLists.txt` file.
|
||||||
|
|
||||||
|
# Provides the following variables:
|
||||||
|
#
|
||||||
|
# Rizin_PLUGINDIR - Directory where plugins are placed, without the prefix part
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
set(Rizin_VERSION @RZ_VERSION@)
|
||||||
|
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
if(NOT Rizin_FIND_COMPONENTS)
|
||||||
|
set(Rizin_FIND_COMPONENTS Core)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(_supported_components
|
||||||
|
Analysis
|
||||||
|
Asm
|
||||||
|
Bin
|
||||||
|
Bp
|
||||||
|
Config
|
||||||
|
Cons
|
||||||
|
Core
|
||||||
|
Crypto
|
||||||
|
Debug
|
||||||
|
Demangler
|
||||||
|
Diff
|
||||||
|
Egg
|
||||||
|
Flag
|
||||||
|
Hash
|
||||||
|
Il
|
||||||
|
IO
|
||||||
|
Lang
|
||||||
|
Librz
|
||||||
|
Magic
|
||||||
|
Main
|
||||||
|
Parse
|
||||||
|
Reg
|
||||||
|
Search
|
||||||
|
Signature
|
||||||
|
Socket
|
||||||
|
Syscall
|
||||||
|
Type
|
||||||
|
Util
|
||||||
|
)
|
||||||
|
|
||||||
|
get_filename_component(_rizin_cmake_path "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
|
||||||
|
|
||||||
|
foreach(_comp ${Rizin_FIND_COMPONENTS})
|
||||||
|
string(TOLOWER ${_comp} _comp_lower)
|
||||||
|
if(NOT ";${_supported_components};" MATCHES ";${_comp};")
|
||||||
|
set(Rizin_FOUND False)
|
||||||
|
set(Rizin_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
find_package(rz_${_comp_lower} PATHS ${_rizin_cmake_path})
|
||||||
|
if (NOT rz_${_comp_lower}_FOUND)
|
||||||
|
set(Rizin_FOUND False)
|
||||||
|
set(Rizin_NOT_FOUND_MESSAGE "Failed to find Rizin component ${_comp}")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
add_library(Rizin::${_comp} UNKNOWN IMPORTED)
|
||||||
|
get_target_property(Rizin_${_comp}_LOCATION rz_${_comp_lower}::rz_${_comp_lower} IMPORTED_LOCATION)
|
||||||
|
set_target_properties(Rizin::${_comp} PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${Rizin_${_comp}_LOCATION}"
|
||||||
|
IMPORTED_LINK_INTERFACE_LIBRARIES "${rz_${_comp_lower}_LIBRARIES}"
|
||||||
|
INTERFACE_LINK_DIRECTORIES "${rz_${_comp_lower}_LIBRARY_DIRS}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${rz_${_comp_lower}_INCLUDE_DIRS}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set(Rizin_PLUGINDIR @INSTALL_PLUGDIR@)
|
||||||
65
librz/RzModulesConfig.cmake.in
Normal file
65
librz/RzModulesConfig.cmake.in
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# This module provides the following imported targets, if found:
|
||||||
|
#
|
||||||
|
# @RIZIN_MODULE@::@RIZIN_MODULE@
|
||||||
|
#
|
||||||
|
# This file is intended to be consumed by clients who wish to use @rizin_libname@ from CMake.
|
||||||
|
# The recommended way to use find this module is using `find_package(Rizin COMPONENTS ...)`.
|
||||||
|
#
|
||||||
|
# Provides the following variables
|
||||||
|
# @RIZIN_MODULE@_FOUND - Flag for indicating that @RIZIN_MODULE@ package has been found
|
||||||
|
# @RIZIN_MODULE@_VERSION - Version of @RIZIN_MODULE@
|
||||||
|
# @RIZIN_MODULE@_INCLUDE_DIRS - Directories to include
|
||||||
|
# @RIZIN_MODULE@_LIBRARY - Path to the single library that this module represents, without dependencies
|
||||||
|
# @RIZIN_MODULE@_LIBRARIES - Libraries to link
|
||||||
|
# @RIZIN_MODULE@_LIBRARY_DIRS - Library directories to search for link libraries
|
||||||
|
# @RIZIN_MODULE@_PLUGINDIR - Directory where plugins are placed, without the prefix part
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
set(RIZIN_MODULE_PREFIXED @RIZIN_MODULE@)
|
||||||
|
set(@RIZIN_MODULE@_VERSION @RZ_VERSION@)
|
||||||
|
|
||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
# FIXME: workaround for https://github.com/mesonbuild/meson/issues/9702 (see https://github.com/rizinorg/rizin/issues/2102)
|
||||||
|
get_filename_component(PACKAGE_PREFIX_DIR_WORKAROUND "${CMAKE_CURRENT_LIST_DIR}/@PACKAGE_RELATIVE_PATH@" ABSOLUTE)
|
||||||
|
|
||||||
|
set(@RIZIN_MODULE@_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR_WORKAROUND}/@INSTALL_INCDIR@" "${PACKAGE_PREFIX_DIR_WORKAROUND}/@INSTALL_INCDIR@/sdb")
|
||||||
|
set_and_check(@RIZIN_MODULE@_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR_WORKAROUND}/@INSTALL_LIBDIR@")
|
||||||
|
find_library(@RIZIN_MODULE@_LIBRARY NAMES @RIZIN_MODULE@ HINTS "${@RIZIN_MODULE@_LIBRARY_DIRS}" NO_DEFAULT_PATH REQUIRED)
|
||||||
|
set(@RIZIN_MODULE@_LIBRARIES "${@RIZIN_MODULE@_LIBRARY}")
|
||||||
|
set(_@RIZIN_MODULE@_DEPENDENCIES @RIZIN_MODULE_DEPS@)
|
||||||
|
set(@RIZIN_MODULE@_PLUGINDIR @INSTALL_PLUGDIR@)
|
||||||
|
|
||||||
|
include(CMakeFindDependencyMacro)
|
||||||
|
get_filename_component(_rizin_cmake_path "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
|
||||||
|
set(_@RIZIN_MODULE@_DEPENDENCY_TARGETS)
|
||||||
|
foreach(_module_dep ${_@RIZIN_MODULE@_DEPENDENCIES})
|
||||||
|
if (NOT ${_module_dep}_FOUND)
|
||||||
|
find_dependency(${_module_dep} PATHS ${_rizin_cmake_path})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT ${_module_dep}_FOUND)
|
||||||
|
set(@RIZIN_MODULE@_FOUND False)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND @RIZIN_MODULE@_INCLUDE_DIRS "${${_module_dep}_INCLUDE_DIRS}")
|
||||||
|
list(APPEND @RIZIN_MODULE@_LIBRARIES "${${_module_dep}_LIBRARIES}")
|
||||||
|
list(APPEND _@RIZIN_MODULE@_DEPENDENCY_TARGETS "${_module_dep}::${_module_dep}")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
list(REMOVE_DUPLICATES @RIZIN_MODULE@_INCLUDE_DIRS)
|
||||||
|
list(REMOVE_DUPLICATES @RIZIN_MODULE@_LIBRARIES)
|
||||||
|
|
||||||
|
if(NOT TARGET @RIZIN_MODULE@::@RIZIN_MODULE@)
|
||||||
|
add_library(@RIZIN_MODULE@::@RIZIN_MODULE@ SHARED IMPORTED)
|
||||||
|
target_link_libraries(@RIZIN_MODULE@::@RIZIN_MODULE@ INTERFACE ${_@RIZIN_MODULE@_DEPENDENCY_TARGETS})
|
||||||
|
set_target_properties(@RIZIN_MODULE@::@RIZIN_MODULE@ PROPERTIES
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${@RIZIN_MODULE@_INCLUDE_DIRS}")
|
||||||
|
set_target_properties(@RIZIN_MODULE@::@RIZIN_MODULE@ PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${@RIZIN_MODULE@_LIBRARY}")
|
||||||
|
endif()
|
||||||
|
set(@RIZIN_MODULE@_TARGET @RIZIN_MODULE@::@RIZIN_MODULE@)
|
||||||
|
|
@ -200,7 +200,9 @@ rz_analysis = library('rz_analysis', rz_analysis_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_analysis_dep = declare_dependency(link_with: rz_analysis,
|
rz_analysis_dep = declare_dependency(link_with: rz_analysis,
|
||||||
|
|
@ -225,5 +227,27 @@ pkgconfig_mod.generate(rz_analysis,
|
||||||
'rz_flag',
|
'rz_flag',
|
||||||
'rz_type'
|
'rz_type'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_analysis.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_crypto', 'rz_reg', 'rz_asm', 'rz_parse',
|
||||||
|
'rz_syscall', 'rz_search', 'rz_cons', 'rz_diff', 'rz_bin', 'rz_flag', 'rz_type']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_analysis.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,9 @@ rz_asm = library('rz_asm', rz_asm_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_asm_dep = declare_dependency(link_with: rz_asm,
|
rz_asm_dep = declare_dependency(link_with: rz_asm,
|
||||||
|
|
@ -255,5 +257,26 @@ pkgconfig_mod.generate(rz_asm,
|
||||||
'rz_bin',
|
'rz_bin',
|
||||||
'rz_socket'
|
'rz_socket'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_asm.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_syscall', 'rz_flag', 'rz_parse', 'rz_bin']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_asm.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,9 @@ rz_bin = library('rz_bin', rz_bin_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_bin_dep = declare_dependency(link_with: rz_bin,
|
rz_bin_dep = declare_dependency(link_with: rz_bin,
|
||||||
|
|
@ -196,5 +198,26 @@ pkgconfig_mod.generate(rz_bin,
|
||||||
'rz_syscall',
|
'rz_syscall',
|
||||||
'rz_type'
|
'rz_type'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_bin.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_io', 'rz_socket', 'rz_syscall', 'rz_type']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_bin.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,9 @@ rz_bp = library('rz_bp', rz_bp_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_bp_dep = declare_dependency(link_with: rz_bp,
|
rz_bp_dep = declare_dependency(link_with: rz_bp,
|
||||||
|
|
@ -35,5 +37,26 @@ pkgconfig_mod.generate(rz_bp,
|
||||||
requires: [
|
requires: [
|
||||||
'rz_util'
|
'rz_util'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_bp.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_bp.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,9 @@ rz_config = library('rz_config', rz_config_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_config_dep = declare_dependency(link_with: rz_config,
|
rz_config_dep = declare_dependency(link_with: rz_config,
|
||||||
|
|
@ -30,3 +32,21 @@ pkgconfig_mod.generate(rz_config,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_config.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_config.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,9 @@ rz_cons = library('rz_cons', rz_cons_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_cons_dep = declare_dependency(link_with: rz_cons,
|
rz_cons_dep = declare_dependency(link_with: rz_cons,
|
||||||
|
|
@ -41,3 +43,21 @@ pkgconfig_mod.generate(rz_cons,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_cons.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_cons.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,9 @@ rz_core = library('rz_core', rz_core_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_core_dep = declare_dependency(link_with: rz_core,
|
rz_core_dep = declare_dependency(link_with: rz_core,
|
||||||
|
|
@ -173,5 +175,29 @@ pkgconfig_mod.generate(
|
||||||
'rz_sign',
|
'rz_sign',
|
||||||
'rz_il'
|
'rz_il'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_core.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_demangler', 'rz_diff', 'rz_magic',
|
||||||
|
'rz_socket', 'rz_flag', 'rz_cons', 'rz_lang', 'rz_hash', 'rz_crypto', 'rz_io', 'rz_reg',
|
||||||
|
'rz_bp', 'rz_syscall', 'rz_parse', 'rz_asm', 'rz_egg', 'rz_search', 'rz_sign', 'rz_il',
|
||||||
|
'rz_analysis', 'rz_type', 'rz_debug', 'rz_config', 'rz_bin']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_core.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ rz_crypto = library('rz_crypto', rz_crypto_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_crypto_dep = declare_dependency(link_with: rz_crypto,
|
rz_crypto_dep = declare_dependency(link_with: rz_crypto,
|
||||||
|
|
@ -45,5 +47,26 @@ pkgconfig_mod.generate(rz_crypto,
|
||||||
requires: [
|
requires: [
|
||||||
'rz_util'
|
'rz_util'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_crypto.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_crypto.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,9 @@ rz_debug = library('rz_debug', rz_debug_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_debug_dep = declare_dependency(link_with: rz_debug,
|
rz_debug_dep = declare_dependency(link_with: rz_debug,
|
||||||
|
|
@ -129,5 +131,26 @@ pkgconfig_mod.generate(rz_debug,
|
||||||
'rz_cons',
|
'rz_cons',
|
||||||
'rz_egg'
|
'rz_egg'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_debug.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_hash', 'rz_reg', 'rz_syscall', 'rz_analysis', 'rz_io', 'rz_bp', 'rz_cons', 'rz_egg']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_debug.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@ rz_demangler = library('rz_demangler', rz_demangler_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_demangler_dep = declare_dependency(link_with: rz_demangler, include_directories: [platform_inc])
|
rz_demangler_dep = declare_dependency(link_with: rz_demangler, include_directories: [platform_inc])
|
||||||
|
|
@ -25,5 +27,26 @@ pkgconfig_mod.generate(rz_demangler,
|
||||||
requires: [
|
requires: [
|
||||||
'rz_util'
|
'rz_util'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_demangler.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_demangler.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,9 @@ rz_diff = library('rz_diff', rz_diff_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_diff_dep = declare_dependency(link_with: rz_diff,
|
rz_diff_dep = declare_dependency(link_with: rz_diff,
|
||||||
|
|
@ -29,3 +31,21 @@ pkgconfig_mod.generate(rz_diff,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_diff.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_diff.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@ rz_egg = library('rz_egg', rz_egg_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_egg_dep = declare_dependency(link_with: rz_egg,
|
rz_egg_dep = declare_dependency(link_with: rz_egg,
|
||||||
|
|
@ -43,5 +45,26 @@ pkgconfig_mod.generate(rz_egg,
|
||||||
'rz_asm',
|
'rz_asm',
|
||||||
'rz_syscall'
|
'rz_syscall'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_egg.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_asm', 'rz_syscall']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_egg.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,9 @@ rz_flag = library('rz_flag', rz_flag_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_flag_dep = declare_dependency(link_with: rz_flag,
|
rz_flag_dep = declare_dependency(link_with: rz_flag,
|
||||||
|
|
@ -31,3 +33,21 @@ pkgconfig_mod.generate(rz_flag,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_flag.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_flag.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,9 @@ rz_hash = library('rz_hash', rz_hash_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_hash_dep = declare_dependency(link_with: rz_hash,
|
rz_hash_dep = declare_dependency(link_with: rz_hash,
|
||||||
|
|
@ -60,5 +62,26 @@ pkgconfig_mod.generate(rz_hash,
|
||||||
requires: [
|
requires: [
|
||||||
'rz_util'
|
'rz_util'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_hash.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_hash.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ rz_il = library('rz_il', rz_il_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_il_dep = declare_dependency(link_with: rz_il,
|
rz_il_dep = declare_dependency(link_with: rz_il,
|
||||||
|
|
@ -47,3 +49,21 @@ pkgconfig_mod.generate(rz_il,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_il.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_il.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,9 @@ rz_io = library('rz_io', rz_io_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_io_dep = declare_dependency(link_with: rz_io,
|
rz_io_dep = declare_dependency(link_with: rz_io,
|
||||||
|
|
@ -107,5 +109,26 @@ pkgconfig_mod.generate(rz_io,
|
||||||
'rz_util',
|
'rz_util',
|
||||||
'rz_socket'
|
'rz_socket'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_io.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_socket', 'rz_hash', 'rz_crypto', 'rz_cons']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_io.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,9 @@ rz_lang = library('rz_lang', rz_lang_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_lang_dep = declare_dependency(link_with: rz_lang,
|
rz_lang_dep = declare_dependency(link_with: rz_lang,
|
||||||
|
|
@ -30,5 +32,26 @@ pkgconfig_mod.generate(rz_lang,
|
||||||
'rz_util',
|
'rz_util',
|
||||||
'rz_cons'
|
'rz_cons'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_lang.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_cons']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_lang.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
prefix=@PREFIX@
|
|
||||||
exec_prefix=${prefix}
|
|
||||||
libdir=${exec_prefix}/lib
|
|
||||||
includedir=${prefix}/include
|
|
||||||
|
|
||||||
Name: librz
|
|
||||||
Description: rizin framework libraries
|
|
||||||
Version: 0.1
|
|
||||||
Requires:
|
|
||||||
Libs: -L${libdir} -lrz_core -lrz_lang -lrz_search -lrz_asm -lrz_util -lrz_reg
|
|
||||||
Cflags: -I${includedir}/librz
|
|
||||||
|
|
@ -25,7 +25,9 @@ rz_magic = library('rz_magic', rz_magic_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_magic_dep = declare_dependency(
|
rz_magic_dep = declare_dependency(
|
||||||
|
|
@ -44,3 +46,21 @@ pkgconfig_mod.generate(rz_magic,
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
pkgconfig_magic_requires = ['rz_magic']
|
pkgconfig_magic_requires = ['rz_magic']
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_magic.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_magic.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,9 @@ rz_main = library('rz_main', rz_main_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_main_dep = declare_dependency(link_with: rz_main,
|
rz_main_dep = declare_dependency(link_with: rz_main,
|
||||||
|
|
@ -69,3 +71,21 @@ pkgconfig_mod.generate(rz_main,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_main.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_core']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_main.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -506,3 +506,15 @@ if get_option('use_gpl')
|
||||||
endforeach
|
endforeach
|
||||||
endforeach
|
endforeach
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: 'Rizin',
|
||||||
|
input: 'RizinConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / 'Rizin',
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,9 @@ rz_parse = library('rz_parse', rz_parse_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_parse_dep = declare_dependency(link_with: rz_parse,
|
rz_parse_dep = declare_dependency(link_with: rz_parse,
|
||||||
|
|
@ -51,5 +53,26 @@ pkgconfig_mod.generate(rz_parse,
|
||||||
'rz_syscall',
|
'rz_syscall',
|
||||||
'rz_reg'
|
'rz_reg'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_parse.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_flag', 'rz_syscall', 'rz_reg', 'rz_cons']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_parse.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,9 @@ rz_reg = library('rz_reg', rz_reg_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_reg_dep = declare_dependency(link_with: rz_reg,
|
rz_reg_dep = declare_dependency(link_with: rz_reg,
|
||||||
|
|
@ -29,5 +31,26 @@ pkgconfig_mod.generate(rz_reg,
|
||||||
requires: [
|
requires: [
|
||||||
'rz_util'
|
'rz_util'
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries',
|
||||||
|
variables: [
|
||||||
|
'plugindir=@0@'.format(rizin_plugins),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_reg.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_reg.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ rz_search = library('rz_search', rz_search_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_search_dep = declare_dependency(link_with: rz_search,
|
rz_search_dep = declare_dependency(link_with: rz_search,
|
||||||
|
|
@ -32,3 +34,21 @@ pkgconfig_mod.generate(rz_search,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_search.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_search.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -10,23 +10,27 @@ rz_sign_inc = [
|
||||||
platform_inc,
|
platform_inc,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
rz_sign_deps = [
|
||||||
|
rz_util_dep,
|
||||||
|
rz_analysis_dep,
|
||||||
|
rz_diff_dep,
|
||||||
|
rz_hash_dep,
|
||||||
|
rz_type_dep,
|
||||||
|
rz_search_dep,
|
||||||
|
rz_flag_dep,
|
||||||
|
]
|
||||||
|
|
||||||
rz_sign = library('rz_sign', rz_sign_sources,
|
rz_sign = library('rz_sign', rz_sign_sources,
|
||||||
include_directories: rz_sign_inc,
|
include_directories: rz_sign_inc,
|
||||||
c_args: library_cflags,
|
c_args: library_cflags,
|
||||||
dependencies: [
|
dependencies: rz_sign_deps,
|
||||||
rz_util_dep,
|
|
||||||
rz_analysis_dep,
|
|
||||||
rz_diff_dep,
|
|
||||||
rz_hash_dep,
|
|
||||||
rz_type_dep,
|
|
||||||
rz_search_dep,
|
|
||||||
rz_flag_dep,
|
|
||||||
],
|
|
||||||
install: true,
|
install: true,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_sign_dep = declare_dependency(link_with: rz_sign,
|
rz_sign_dep = declare_dependency(link_with: rz_sign,
|
||||||
|
|
@ -48,3 +52,21 @@ pkgconfig_mod.generate(rz_sign,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_sign.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util', 'rz_analysis', 'rz_diff', 'rz_hash', 'rz_search', 'rz_type', 'rz_flag']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_sign.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ rz_socket = library('rz_socket', rz_socket_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_socket_dep = declare_dependency(link_with: rz_socket,
|
rz_socket_dep = declare_dependency(link_with: rz_socket,
|
||||||
|
|
@ -48,3 +50,21 @@ pkgconfig_mod.generate(rz_socket,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_socket.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_socket.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,9 @@ rz_syscall = library('rz_syscall', rz_syscall_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_syscall_dep = declare_dependency(link_with: rz_syscall,
|
rz_syscall_dep = declare_dependency(link_with: rz_syscall,
|
||||||
|
|
@ -26,3 +28,21 @@ pkgconfig_mod.generate(rz_syscall,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_syscall.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_syscall.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,9 @@ rz_type = library('rz_type', rz_type_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_type_dep = declare_dependency(link_with: rz_type,
|
rz_type_dep = declare_dependency(link_with: rz_type,
|
||||||
|
|
@ -55,3 +57,21 @@ pkgconfig_mod.generate(rz_type,
|
||||||
],
|
],
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_type.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join(['rz_util']))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_type.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ rz_util_sources = [
|
||||||
'luhn.c'
|
'luhn.c'
|
||||||
]
|
]
|
||||||
|
|
||||||
rz_util_deps = [ldl, lrt, mth, pth, utl, sdb_dep, zlib_dep, platform_deps]
|
rz_util_deps = [ldl, lrt, mth, pth, utl, sdb_dep, zlib_dep] + platform_deps
|
||||||
if ['freebsd', 'netbsd', 'haiku', 'dragonfly'].contains(host_machine.system())
|
if ['freebsd', 'netbsd', 'haiku', 'dragonfly'].contains(host_machine.system())
|
||||||
# backtrace_symbols_fd requires -lexecinfo
|
# backtrace_symbols_fd requires -lexecinfo
|
||||||
rz_util_deps += [cc.find_library('execinfo', static: is_static_build)]
|
rz_util_deps += [cc.find_library('execinfo', static: is_static_build)]
|
||||||
|
|
@ -102,7 +102,9 @@ rz_util = library('rz_util', rz_util_sources,
|
||||||
implicit_include_directories: false,
|
implicit_include_directories: false,
|
||||||
install_rpath: rpath_lib,
|
install_rpath: rpath_lib,
|
||||||
link_args: library_linkflags,
|
link_args: library_linkflags,
|
||||||
soversion: rizin_libversion
|
soversion: rizin_libversion,
|
||||||
|
name_suffix: lib_name_suffix,
|
||||||
|
name_prefix: lib_name_prefix,
|
||||||
)
|
)
|
||||||
|
|
||||||
rz_util_dep = declare_dependency(
|
rz_util_dep = declare_dependency(
|
||||||
|
|
@ -120,3 +122,21 @@ pkgconfig_mod.generate(rz_util,
|
||||||
filebase: 'rz_util',
|
filebase: 'rz_util',
|
||||||
description: 'rizin foundation libraries'
|
description: 'rizin foundation libraries'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not is_static_libs_only
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('RZ_VERSION', rizin_version)
|
||||||
|
conf.set('RIZIN_MODULE', rz_util.name())
|
||||||
|
conf.set('RIZIN_MODULE_DEPS', ' '.join([]))
|
||||||
|
conf.set('PACKAGE_RELATIVE_PATH', cmake_package_relative_path)
|
||||||
|
conf.set('INSTALL_INCDIR', rizin_incdir)
|
||||||
|
conf.set('INSTALL_LIBDIR', rizin_libdir)
|
||||||
|
conf.set('INSTALL_PLUGDIR', rizin_plugins)
|
||||||
|
conf.set('rizin_libname', rz_util.name())
|
||||||
|
cmake_mod.configure_package_config_file(
|
||||||
|
name: conf.get('rizin_libname'),
|
||||||
|
input: '../RzModulesConfig.cmake.in',
|
||||||
|
install_dir: rizin_cmakedir / conf.get('rizin_libname'),
|
||||||
|
configuration: conf,
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
|
||||||
64
meson.build
64
meson.build
|
|
@ -11,6 +11,7 @@ project('rizin', 'c',
|
||||||
py3_exe = import('python').find_installation()
|
py3_exe = import('python').find_installation()
|
||||||
git_exe = find_program('git', required: false)
|
git_exe = find_program('git', required: false)
|
||||||
pkgconfig_mod = import('pkgconfig')
|
pkgconfig_mod = import('pkgconfig')
|
||||||
|
cmake_mod = import('cmake')
|
||||||
|
|
||||||
# Python scripts used during the build process
|
# Python scripts used during the build process
|
||||||
create_tags_rz_py = files('sys/create_tags_rz.py')
|
create_tags_rz_py = files('sys/create_tags_rz.py')
|
||||||
|
|
@ -18,9 +19,11 @@ syscall_preprocessing_py = files('sys/syscall_preprocessing.py')
|
||||||
check_meson_subproject_py = files('sys/check_meson_subproject.py')
|
check_meson_subproject_py = files('sys/check_meson_subproject.py')
|
||||||
git_exe_repo_py = files('sys/meson_git_wrapper.py')
|
git_exe_repo_py = files('sys/meson_git_wrapper.py')
|
||||||
tree_sitter_wrap_py = files('sys/meson_tree_sitter_generate.py')
|
tree_sitter_wrap_py = files('sys/meson_tree_sitter_generate.py')
|
||||||
|
cmake_package_prefix_dir_py = files('sys/meson_cmake_prefix_dir.py')
|
||||||
|
|
||||||
is_static_build = get_option('static_runtime')
|
is_static_build = get_option('static_runtime')
|
||||||
if is_static_build and get_option('default_library') != 'static'
|
is_static_libs_only = get_option('default_library') == 'static'
|
||||||
|
if is_static_build and not is_static_libs_only
|
||||||
error('Cannot use `static_runtime` when libraries are dynamically built. Set `--default-library=static` if you want to build statically.')
|
error('Cannot use `static_runtime` when libraries are dynamically built. Set `--default-library=static` if you want to build statically.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
@ -111,6 +114,16 @@ if host_machine.system() == 'windows'
|
||||||
endif
|
endif
|
||||||
platform_inc = include_directories(platform_inc)
|
platform_inc = include_directories(platform_inc)
|
||||||
|
|
||||||
|
lib_name_suffix = []
|
||||||
|
lib_name_prefix = []
|
||||||
|
if is_static_libs_only and cc.get_id() == 'msvc'
|
||||||
|
# On MSVC meson uses the .a suffix and lib as prefix, but cmake and other
|
||||||
|
# tools expect a .lib suffix and no prefix
|
||||||
|
# https://mesonbuild.com/FAQ.html#why-does-building-my-project-with-msvc-output-static-libraries-called-libfooa
|
||||||
|
lib_name_suffix = 'lib'
|
||||||
|
lib_name_prefix = ''
|
||||||
|
endif
|
||||||
|
|
||||||
if is_static_build
|
if is_static_build
|
||||||
if cc.get_id() == 'msvc'
|
if cc.get_id() == 'msvc'
|
||||||
# Use -Db_vscrt=static_from_buildtype to avoid warnings due to multiple /M options
|
# Use -Db_vscrt=static_from_buildtype to avoid warnings due to multiple /M options
|
||||||
|
|
@ -168,6 +181,7 @@ endif
|
||||||
rizin_prefix = get_option('prefix')
|
rizin_prefix = get_option('prefix')
|
||||||
rizin_bindir = get_option('bindir')
|
rizin_bindir = get_option('bindir')
|
||||||
rizin_libdir = get_option('libdir')
|
rizin_libdir = get_option('libdir')
|
||||||
|
rizin_cmakedir = rizin_libdir / 'cmake'
|
||||||
rizin_incdir = get_option('includedir') / 'librz'
|
rizin_incdir = get_option('includedir') / 'librz'
|
||||||
rizin_datdir = get_option('datadir')
|
rizin_datdir = get_option('datadir')
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
|
|
@ -213,6 +227,8 @@ foreach opt : opts_overwrite
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
cmake_package_relative_path = run_command(py3_exe, cmake_package_prefix_dir_py, rizin_prefix, rizin_cmakedir / 'xxx').stdout().strip()
|
||||||
|
|
||||||
# handle capstone dependency
|
# handle capstone dependency
|
||||||
capstone_dep = dependency('capstone', version: '>=3.0.4', required: get_option('use_sys_capstone'), static: is_static_build)
|
capstone_dep = dependency('capstone', version: '>=3.0.4', required: get_option('use_sys_capstone'), static: is_static_build)
|
||||||
if not capstone_dep.found()
|
if not capstone_dep.found()
|
||||||
|
|
@ -517,16 +533,6 @@ rz_version_h = configure_file(
|
||||||
# Copy missing header
|
# Copy missing header
|
||||||
run_command(py3_exe, '-c', '__import__("shutil").copyfile("shlr/spp/config.def.h", "shlr/spp/config.h")')
|
run_command(py3_exe, '-c', '__import__("shutil").copyfile("shlr/spp/config.def.h", "shlr/spp/config.h")')
|
||||||
|
|
||||||
pcconf = configuration_data()
|
|
||||||
pcconf.set('PREFIX', rizin_prefix)
|
|
||||||
pcconf.set('VERSION', rizin_version)
|
|
||||||
libr_pc = configure_file(
|
|
||||||
input: 'librz/librz.pc.in',
|
|
||||||
output: 'librz.pc',
|
|
||||||
configuration: pcconf,
|
|
||||||
install_dir: get_option('libdir') / 'pkgconfig'
|
|
||||||
)
|
|
||||||
|
|
||||||
# handle zlib dependency
|
# handle zlib dependency
|
||||||
r = run_command(py3_exe, check_meson_subproject_py, 'zlib')
|
r = run_command(py3_exe, check_meson_subproject_py, 'zlib')
|
||||||
if r.returncode() == 1 and get_option('subprojects_check')
|
if r.returncode() == 1 and get_option('subprojects_check')
|
||||||
|
|
@ -735,42 +741,6 @@ if cli_enabled
|
||||||
subdir('binrz/rz-test')
|
subdir('binrz/rz-test')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if meson.is_subproject()
|
|
||||||
librz_dep = declare_dependency(
|
|
||||||
dependencies: [
|
|
||||||
rz_analysis_dep,
|
|
||||||
rz_asm_dep,
|
|
||||||
rz_bin_dep,
|
|
||||||
rz_bp_dep,
|
|
||||||
rz_config_dep,
|
|
||||||
rz_cons_dep,
|
|
||||||
rz_core_dep,
|
|
||||||
rz_main_dep,
|
|
||||||
rz_crypto_dep,
|
|
||||||
rz_debug_dep,
|
|
||||||
rz_egg_dep,
|
|
||||||
rz_flag_dep,
|
|
||||||
rz_hash_dep,
|
|
||||||
rz_io_dep,
|
|
||||||
rz_lang_dep,
|
|
||||||
rz_magic_dep,
|
|
||||||
rz_parse_dep,
|
|
||||||
rz_reg_dep,
|
|
||||||
rz_search_dep,
|
|
||||||
rz_socket_dep,
|
|
||||||
rz_syscall_dep,
|
|
||||||
rz_il_dep,
|
|
||||||
rz_sign_dep,
|
|
||||||
rz_type_dep,
|
|
||||||
rz_diff_dep,
|
|
||||||
rz_demangler_dep,
|
|
||||||
rz_util_dep
|
|
||||||
],
|
|
||||||
include_directories: include_directories('.', 'librz/include'),
|
|
||||||
version: rizin_version
|
|
||||||
)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if get_option('use_webui')
|
if get_option('use_webui')
|
||||||
install_subdir('shlr/www',
|
install_subdir('shlr/www',
|
||||||
install_dir: rizin_wwwroot,
|
install_dir: rizin_wwwroot,
|
||||||
|
|
|
||||||
38
sys/meson_cmake_prefix_dir.py
Executable file
38
sys/meson_cmake_prefix_dir.py
Executable file
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
#
|
||||||
|
# SPDX-FileCopyrightText: 2021 ret2libc <sirmy15@gmail.com>
|
||||||
|
# SPDX-License-Identifier: LGPL-3.0-only
|
||||||
|
|
||||||
|
""" Python script to workaround issue mesonbuild/meson#9702
|
||||||
|
(https://github.com/mesonbuild/meson/issues/9702). It returns the relative path
|
||||||
|
of the prefixdir from the cmake directory."""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def parse():
|
||||||
|
if len(sys.argv) <= 2:
|
||||||
|
print("Usage: {} <prefixdir> <cmakedir>".format(sys.argv[0]))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
prefix_dir = sys.argv[1]
|
||||||
|
cmake_dir = sys.argv[2]
|
||||||
|
|
||||||
|
return prefix_dir, cmake_dir
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
prefix_dir, cmake_dir = parse()
|
||||||
|
|
||||||
|
prefix_dir = os.path.abspath(prefix_dir)
|
||||||
|
if not os.path.isabs(cmake_dir):
|
||||||
|
cmake_dir = os.path.abspath(os.path.join(prefix_dir, cmake_dir))
|
||||||
|
|
||||||
|
# always use linux dir separator, CMake will take care of converting it properly
|
||||||
|
relpath = os.path.relpath(prefix_dir, cmake_dir).replace(os.sep, "/")
|
||||||
|
print("%s" % (relpath,))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Loading…
Reference in a new issue