1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

freetype with CPM

This commit is contained in:
Tom Atkinson 2024-03-11 00:28:08 +00:00
parent 1a3985ec93
commit c8a87b01aa
3 changed files with 48 additions and 24 deletions

View File

@ -19,7 +19,7 @@ jobs:
continue-on-error: true # Allow other platforms to build even if one fails continue-on-error: true # Allow other platforms to build even if one fails
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Install Linux Dependencies - name: Install Linux Dependencies
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
@ -31,7 +31,8 @@ jobs:
- name: Install Windows Dependencies - name: Install Windows Dependencies
if: startsWith(matrix.os, 'windows') if: startsWith(matrix.os, 'windows')
run: ./vcpkg/install_vcpkg_dependencies.bat # run: ./vcpkg/install_vcpkg_dependencies.bat
run: echo "Windows dependencies"
- name: Install MacOS Dependencies - name: Install MacOS Dependencies
if: startsWith(matrix.os, 'macos') if: startsWith(matrix.os, 'macos')
@ -39,7 +40,7 @@ jobs:
- name: Build Profiler - name: Build Profiler
run: | run: |
cmake -B build/profiler -S profiler -DLEGACY=ON cmake -B build/profiler -S profiler -DLEGACY=ON -DTRACY_DOWNLOAD_FREETYPE=ON
cmake --build build/profiler --config Release --parallel cmake --build build/profiler --config Release --parallel
- name: Build Update - name: Build Update

View File

@ -4,6 +4,7 @@
set (ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../") set (ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../")
if (EXISTS ${ROOT_DIR}/vcpkg_installed/x64-windows-static/lib/pkgconfig) if (EXISTS ${ROOT_DIR}/vcpkg_installed/x64-windows-static/lib/pkgconfig)
message(STATUS "Using vcpkg_installed/x64-windows-static/lib/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "${ROOT_DIR}/vcpkg_installed/x64-windows-static/lib/pkgconfig") set(ENV{PKG_CONFIG_PATH} "${ROOT_DIR}/vcpkg_installed/x64-windows-static/lib/pkgconfig")
endif() endif()
@ -66,19 +67,24 @@ endif()
# freetype # freetype
pkg_check_modules(FREETYPE freetype2) if (IMGUI_ENABLE_FREETYPE)
if (FREETYPE_FOUND AND NOT TRACY_DOWNLOAD_FREETYPE) pkg_check_modules(FREETYPE freetype2)
if (FREETYPE_FOUND AND NOT TRACY_DOWNLOAD_FREETYPE)
add_library(TracyFreetype INTERFACE) add_library(TracyFreetype INTERFACE)
target_include_directories(TracyFreetype INTERFACE ${FREETYPE_INCLUDE_DIRS}) target_include_directories(TracyFreetype INTERFACE ${FREETYPE_INCLUDE_DIRS})
target_link_libraries(TracyFreetype INTERFACE ${FREETYPE_LINK_LIBRARIES}) target_link_libraries(TracyFreetype INTERFACE ${FREETYPE_LINK_LIBRARIES})
else() else()
CPMAddPackage( CPMAddPackage(
NAME freetype NAME freetype
GITHUB_REPOSITORY freetype/freetype GITHUB_REPOSITORY freetype/freetype
GIT_TAG VER-2-13-2 GIT_TAG VER-2-10-0
OPTIONS
"FT_DISABLE_HARFBUZZ ON"
"FT_WITH_HARFBUZZ OFF"
) )
add_library(TracyFreetype INTERFACE) add_library(TracyFreetype INTERFACE)
target_link_libraries(TracyFreetype INTERFACE freetype) target_link_libraries(TracyFreetype INTERFACE freetype)
endif()
endif() endif()
# zstd # zstd
@ -157,13 +163,17 @@ set(IMGUI_SOURCES
${IMGUI_DIR}/imgui_tables.cpp ${IMGUI_DIR}/imgui_tables.cpp
) )
set(IMGUI_FREETYPE_SOURCES if (IMGUI_ENABLE_FREETYPE)
${IMGUI_DIR}/misc/freetype/imgui_freetype.cpp add_definitions(-DIMGUI_ENABLE_FREETYPE)
) list(APPEND IMGUI_SOURCES ${IMGUI_DIR}/misc/freetype/imgui_freetype.cpp)
endif()
add_library(TracyImGui STATIC ${IMGUI_SOURCES} ${IMGUI_FREETYPE_SOURCES}) add_library(TracyImGui STATIC ${IMGUI_SOURCES})
target_include_directories(TracyImGui PUBLIC ${IMGUI_DIR}) target_include_directories(TracyImGui PUBLIC ${IMGUI_DIR})
target_link_libraries(TracyImGui PUBLIC TracyFreetype)
if (IMGUI_ENABLE_FREETYPE)
target_link_libraries(TracyImGui PUBLIC TracyFreetype)
endif()
if (LEGACY) if (LEGACY)
target_link_libraries(TracyImGui PUBLIC TracyGlfw3) target_link_libraries(TracyImGui PUBLIC TracyGlfw3)
@ -230,7 +240,18 @@ if (NOT NO_TBB)
# Some distributions have pgk-config files for TBB, others don't. # Some distributions have pgk-config files for TBB, others don't.
pkg_check_modules(TBB tbb) pkg_check_modules(TBB tbb)
if (TBB_FOUND)
add_library(TracyTbb INTERFACE) add_library(TracyTbb INTERFACE)
target_include_directories(TracyTbb INTERFACE ${TBB_INCLUDE_DIRS}) target_include_directories(TracyTbb INTERFACE ${TBB_INCLUDE_DIRS})
target_link_libraries(TracyTbb INTERFACE ${TBB_LINK_LIBRARIES}) target_link_libraries(TracyTbb INTERFACE ${TBB_LINK_LIBRARIES})
else()
CPMAddPackage(
NAME tbb
GITHUB_REPOSITORY oneapi-src/oneTBB
GIT_TAG v2021.12.0-rc2
OPTIONS "TBB_TEST OFF"
)
add_library(TracyTbb INTERFACE)
target_link_libraries(TracyTbb INTERFACE tbb)
endif()
endif() endif()

View File

@ -3,6 +3,8 @@ project(Profiler C CXX ASM)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(IMGUI_ENABLE_FREETYPE ON)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake)