From 8dc70ad1ed3100d2da2b7d8b872c05aa601a9ec5 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Wed, 7 May 2025 12:53:44 -0400 Subject: [PATCH] Meson will complain on linux that libraries are not compiled with -fpic but then ignore options to enable -fpic by default, also despite detecting this Meson will not add it on Linux. Because of this I have to only build static libraries. CMake might be on the table now. --- meson.build | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 2d20223..38518ce 100644 --- a/meson.build +++ b/meson.build @@ -4,7 +4,7 @@ project('lel-guecs', 'cpp', version: '0.2.0', default_options: [ 'cpp_std=c++20', - 'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1' + 'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1', ]) # use this for common options only for our executables @@ -81,10 +81,9 @@ sources = [ lel_guecs_inc = include_directories('include') -lel_guecs_lib = both_libraries('lel-guecs', +lel_guecs_lib = static_library('lel-guecs', sources, - version: '0.2.0', - soversion: '1', + pic: true, cpp_args: cpp_args, include_directories: lel_guecs_inc, override_options: exe_defaults, @@ -105,7 +104,7 @@ executable('runtests', [ link_args: link_args, override_options: exe_defaults, include_directories: lel_guecs_inc, - link_with: [lel_guecs_lib.get_static_lib()], + link_with: [lel_guecs_lib], dependencies: dependencies + [catch2]) executable('calc', [ @@ -115,5 +114,5 @@ executable('calc', [ link_args: link_args, override_options: exe_defaults, include_directories: lel_guecs_inc, - link_with: [lel_guecs_lib.get_static_lib()], + link_with: [lel_guecs_lib], dependencies: dependencies)