1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-04 14:23:51 +00:00

Merge pull request #641 from YaLTeR/meson-improvements

Meson improvements
This commit is contained in:
Bartosz Taudul 2023-10-19 12:47:42 +02:00 committed by GitHub
commit 7f5cfdfa10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 30 deletions

View File

@ -19,10 +19,10 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install linux libraries - name: Install linux libraries
if: ${{ matrix.os == 'ubuntu-22.04' }} if: ${{ matrix.os == 'ubuntu-22.04' }}
run: sudo apt-get update && sudo apt-get -y install libdbus-1-dev libcapstone-dev libtbb-dev libdebuginfod-dev libxkbcommon-dev libegl-dev libwayland-dev run: sudo apt-get update && sudo apt-get -y install libdbus-1-dev libcapstone-dev libtbb-dev libdebuginfod-dev libxkbcommon-dev libegl-dev libwayland-dev meson
- name: Install macos libraries - name: Install macos libraries
if: ${{ matrix.os == 'macOS-latest' }} if: ${{ matrix.os == 'macOS-latest' }}
run: brew install capstone tbb pkg-config glfw run: brew install capstone tbb pkg-config glfw meson
- name: Profiler GUI - name: Profiler GUI
run: make -j`nproc` -C profiler/build/unix debug release run: make -j`nproc` -C profiler/build/unix debug release
- name: Update utility - name: Update utility
@ -35,6 +35,8 @@ jobs:
run: make -j`nproc` -C import-chrome/build/unix debug release run: make -j`nproc` -C import-chrome/build/unix debug release
- name: Library - name: Library
run: make -j`nproc` -C library/unix debug release run: make -j`nproc` -C library/unix debug release
- name: Library (meson)
run: meson setup -Dprefix=$PWD/install build && meson compile -C build && meson install -C build
- name: Test application - name: Test application
run: | run: |
make -j`nproc` -C test make -j`nproc` -C test

View File

@ -1,87 +1,89 @@
project('tracy', ['cpp'], version: '0.10.0') project('tracy', ['cpp'], version: '0.10.0')
tracy_compile_args = []
if get_option('tracy_enable') if get_option('tracy_enable')
add_project_arguments('-DTRACY_ENABLE', language : 'cpp') tracy_compile_args += ['-DTRACY_ENABLE']
endif endif
if get_option('tracy_on_demand') if get_option('tracy_on_demand')
add_project_arguments('-DTRACY_ON_DEMAND', language : 'cpp') tracy_compile_args += ['-DTRACY_ON_DEMAND']
endif endif
if get_option('tracy_callstack') if get_option('tracy_callstack')
add_project_arguments('-DTRACY_CALLSTACK', language : 'cpp') tracy_compile_args += ['-DTRACY_CALLSTACK']
endif endif
if get_option('tracy_no_callstack') if get_option('tracy_no_callstack')
add_project_arguments('-DTRACY_NO_CALLSTACK', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_CALLSTACK']
endif endif
if get_option('tracy_no_callstack_inlines') if get_option('tracy_no_callstack_inlines')
add_project_arguments('-DTRACY_NO_CALLSTACK_INLINES', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_CALLSTACK_INLINES']
endif endif
if get_option('tracy_only_localhost') if get_option('tracy_only_localhost')
add_project_arguments('-DTRACY_ONLY_LOCALHOST', language : 'cpp') tracy_compile_args += ['-DTRACY_ONLY_LOCALHOST']
endif endif
if get_option('tracy_no_broadcast') if get_option('tracy_no_broadcast')
add_project_arguments('-DTRACY_NO_BROADCAST', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_BROADCAST']
endif endif
if get_option('tracy_only_ipv4') if get_option('tracy_only_ipv4')
add_project_arguments('-DTRACY_ONLY_IPV4', language : 'cpp') tracy_compile_args += ['-DTRACY_ONLY_IPV4']
endif endif
if get_option('tracy_no_code_transfer') if get_option('tracy_no_code_transfer')
add_project_arguments('-DTRACY_NO_CODE_TRANSFER', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_CODE_TRANSFER']
endif endif
if get_option('tracy_no_context_switch') if get_option('tracy_no_context_switch')
add_project_arguments('-DTRACY_NO_CONTEXT_SWITCH', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_CONTEXT_SWITCH']
endif endif
if get_option('tracy_no_exit') if get_option('tracy_no_exit')
add_project_arguments('-DTRACY_NO_EXIT', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_EXIT']
endif endif
if get_option('tracy_no_sampling') if get_option('tracy_no_sampling')
add_project_arguments('-DTRACY_NO_SAMPLING', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_SAMPLING']
endif endif
if get_option('tracy_no_verify') if get_option('tracy_no_verify')
add_project_arguments('-DTRACY_NO_VERIFY', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_VERIFY']
endif endif
if get_option('tracy_no_vsync_capture') if get_option('tracy_no_vsync_capture')
add_project_arguments('-DTRACY_NO_VSYNC_CAPTURE', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_VSYNC_CAPTURE']
endif endif
if get_option('tracy_no_frame_image') if get_option('tracy_no_frame_image')
add_project_arguments('-DTRACY_NO_FRAME_IMAGE', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_FRAME_IMAGE']
endif endif
if get_option('tracy_no_system_tracing') if get_option('tracy_no_system_tracing')
add_project_arguments('-DTRACY_NO_SYSTEM_TRACING', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_SYSTEM_TRACING']
endif endif
if get_option('tracy_patchable_nopsleds') if get_option('tracy_patchable_nopsleds')
add_project_arguments('-DTRACY_PATCHABLE_NOPSLEDS', language : 'cpp') tracy_compile_args += ['-DTRACY_PATCHABLE_NOPSLEDS']
endif endif
if get_option('tracy_delayed_init') if get_option('tracy_delayed_init')
add_project_arguments('-DTRACY_DELAYED_INIT', language : 'cpp') tracy_compile_args += ['-DTRACY_DELAYED_INIT']
endif endif
if get_option('tracy_manual_lifetime') if get_option('tracy_manual_lifetime')
add_project_arguments('-DTRACY_MANUAL_LIFETIME', language : 'cpp') tracy_compile_args += ['-DTRACY_MANUAL_LIFETIME']
endif endif
if get_option('tracy_fibers') if get_option('tracy_fibers')
add_project_arguments('-DTRACY_FIBERS', language : 'cpp') tracy_compile_args += ['-DTRACY_FIBERS']
endif endif
if get_option('tracy_timer_fallback') if get_option('tracy_timer_fallback')
add_project_arguments('-DTRACY_TIMER_FALLBACK', language : 'cpp') tracy_compile_args += ['-DTRACY_TIMER_FALLBACK']
endif endif
tracy_shared_libs = get_option('tracy_shared_libs') tracy_shared_libs = get_option('tracy_shared_libs')
@ -90,9 +92,11 @@ if tracy_shared_libs
endif endif
if get_option('tracy_no_crash_handler') if get_option('tracy_no_crash_handler')
add_project_arguments('-DTRACY_NO_CRASH_HANDLER', language : 'cpp') tracy_compile_args += ['-DTRACY_NO_CRASH_HANDLER']
endif endif
add_project_arguments(tracy_compile_args, language : 'cpp')
threads_dep = dependency('threads') threads_dep = dependency('threads')
if host_machine.system() == 'windows' if host_machine.system() == 'windows'
@ -134,7 +138,6 @@ common_includes = [
'public/common/tracy_lz4.hpp', 'public/common/tracy_lz4.hpp',
'public/common/tracy_lz4hc.hpp', 'public/common/tracy_lz4hc.hpp',
'public/common/TracyAlign.hpp', 'public/common/TracyAlign.hpp',
'public/common/TracyAlign.hpp',
'public/common/TracyAlloc.hpp', 'public/common/TracyAlloc.hpp',
'public/common/TracyApi.h', 'public/common/TracyApi.h',
'public/common/TracyColor.hpp', 'public/common/TracyColor.hpp',
@ -177,22 +180,22 @@ else
install : true) install : true)
endif endif
install_headers(includes) install_headers(includes, subdir : 'tracy')
install_headers(common_includes, subdir : 'common') install_headers(common_includes, subdir : 'common')
install_headers(client_includes, subdir : 'client') install_headers(client_includes, subdir : 'client')
tracy_dep_compile_args = [] tracy_dep_compile_args = tracy_compile_args
if tracy_shared_libs if tracy_shared_libs
tracy_dep_compile_args += [ '-DTRACY_IMPORTS' ] tracy_dep_compile_args += [ '-DTRACY_IMPORTS' ]
endif endif
pkg = import('pkgconfig')
pkg.generate(tracy, extra_cflags: tracy_dep_compile_args)
tracy_dep = declare_dependency( tracy_dep = declare_dependency(
compile_args : tracy_dep_compile_args, compile_args : tracy_dep_compile_args,
link_with : tracy, link_with : tracy,
include_directories : tracy_public_include_dirs) include_directories : tracy_public_include_dirs)
tracy_dep_dynamic = declare_dependency(
include_directories : tracy_public_include_dirs)
meson.override_dependency('tracy', tracy_dep) meson.override_dependency('tracy', tracy_dep)