mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
Extract some common definitions.
This commit is contained in:
parent
375f4526df
commit
46718851da
26
cmake/config.cmake
Normal file
26
cmake/config.cmake
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
if (NOT NO_ISA_EXTENSIONS)
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-mcpu=native" COMPILER_SUPPORTS_MCPU_NATIVE)
|
||||||
|
if(COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=native")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||||
|
if(COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT LEGACY)
|
||||||
|
set(USE_WAYLAND ON)
|
||||||
|
else()
|
||||||
|
set(USE_WAYLAND OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
|
||||||
|
endif()
|
@ -32,3 +32,11 @@ target_link_libraries(TracyServer PUBLIC TracyCapstone TracyZstd)
|
|||||||
if(NO_STATISTICS)
|
if(NO_STATISTICS)
|
||||||
target_compile_definitions(TracyServer PUBLIC TRACY_NO_STATISTICS)
|
target_compile_definitions(TracyServer PUBLIC TRACY_NO_STATISTICS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
target_link_libraries(TracyServer PRIVATE TracyTbb)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32)
|
||||||
|
endif()
|
||||||
|
@ -3,10 +3,6 @@
|
|||||||
|
|
||||||
set (ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../")
|
set (ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../")
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Dependencies are taken from the system first and if not found, they are pulled with CPM and built from source
|
# Dependencies are taken from the system first and if not found, they are pulled with CPM and built from source
|
||||||
|
|
||||||
include(FindPkgConfig)
|
include(FindPkgConfig)
|
||||||
|
@ -16,29 +16,7 @@ project(
|
|||||||
VERSION ${TRACY_VERSION_STRING}
|
VERSION ${TRACY_VERSION_STRING}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT NO_ISA_EXTENSIONS)
|
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.cmake)
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-mcpu=native" COMPILER_SUPPORTS_MCPU_NATIVE)
|
|
||||||
if(COMPILER_SUPPORTS_MARCH_NATIVE)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=native")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
|
|
||||||
if(COMPILER_SUPPORTS_MARCH_NATIVE)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT LEGACY)
|
|
||||||
set(USE_WAYLAND ON)
|
|
||||||
else()
|
|
||||||
set(USE_WAYLAND OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
@ -149,11 +127,3 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyImGui TracyNfd)
|
target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyImGui TracyNfd)
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE TracyTbb)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32)
|
|
||||||
endif()
|
|
Loading…
Reference in New Issue
Block a user