fix tracy for emscripten

This commit is contained in:
Green Sky 2022-04-16 20:33:35 +02:00
parent bbbbc655e7
commit 5f066faa28

View File

@ -1,29 +1,38 @@
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
add_library(tracy_client
"${CMAKE_CURRENT_LIST_DIR}/tracy/Tracy.hpp"
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyLua.hpp"
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyVulkan.hpp"
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyOpenGL.hpp"
if(NOT EMSCRIPTEN)
add_library(tracy_client
"${CMAKE_CURRENT_LIST_DIR}/tracy/Tracy.hpp"
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyLua.hpp"
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyVulkan.hpp"
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyOpenGL.hpp"
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyClient.cpp"
)
"${CMAKE_CURRENT_LIST_DIR}/tracy/TracyClient.cpp"
)
target_compile_features(tracy_client PUBLIC cxx_std_17)
if(TRACY_ENABLE)
target_compile_definitions(tracy_client PUBLIC TRACY_ENABLE)
#target_compile_definitions(tracy_client PUBLIC TRACY_NO_SYSTEM_TRACING)
message("Enabled TRACY")
endif()
if(TRACY_ENABLE)
target_compile_definitions(tracy_client PUBLIC TRACY_ENABLE)
#target_compile_definitions(tracy_client PUBLIC TRACY_NO_SYSTEM_TRACING)
message("Enabled TRACY")
target_compile_features(tracy_client PUBLIC cxx_std_17)
target_include_directories(tracy_client PUBLIC "${CMAKE_CURRENT_LIST_DIR}")
if(UNIX)
target_link_libraries(tracy_client dl)
endif()
if(WIN32)
target_link_libraries(tracy_client ws2_32 dbghelp)
endif()
else() # EMSCRIPTEN
add_library(tracy_client INTERFACE)
target_compile_features(tracy_client INTERFACE cxx_std_17)
target_include_directories(tracy_client INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
endif()
target_include_directories(tracy_client PUBLIC "${CMAKE_CURRENT_LIST_DIR}")
if(UNIX)
target_link_libraries(tracy_client dl)
endif()
if(WIN32)
target_link_libraries(tracy_client ws2_32 dbghelp)
endif()