From 63a2caa4718e7ff0e8c84a24177c36ef1991d535 Mon Sep 17 00:00:00 2001 From: Daniel Evans Date: Wed, 29 Aug 2018 21:06:03 +0100 Subject: [PATCH] Add microprofile to rwengine dependencies --- .gitmodules | 3 +++ CMakeLists.txt | 2 ++ external/CMakeLists.txt | 3 +++ external/microprofile/CMakeLists.txt | 23 +++++++++++++++++++++++ external/microprofile/microprofile | 1 + rwengine/CMakeLists.txt | 7 +++++++ 6 files changed, 39 insertions(+) create mode 100644 .gitmodules create mode 100644 external/CMakeLists.txt create mode 100644 external/microprofile/CMakeLists.txt create mode 160000 external/microprofile/microprofile diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..b044f920 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "external/microprofile/microprofile"] + path = external/microprofile/microprofile + url = https://github.com/jonasmr/microprofile.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ee3345e1..2d5fa344 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,8 @@ endif() # Create a rw_interface TARGET that holds all compiler options include("${PROJECT_SOURCE_DIR}/cmake_configure.cmake") +add_subdirectory(external) + add_subdirectory(rwcore) add_subdirectory(rwengine) add_subdirectory(rwgame) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt new file mode 100644 index 00000000..de3bbe45 --- /dev/null +++ b/external/CMakeLists.txt @@ -0,0 +1,3 @@ +if(ENABLE_PROFILING) + add_subdirectory(microprofile) +endif() diff --git a/external/microprofile/CMakeLists.txt b/external/microprofile/CMakeLists.txt new file mode 100644 index 00000000..3552df52 --- /dev/null +++ b/external/microprofile/CMakeLists.txt @@ -0,0 +1,23 @@ +add_library(microprofile STATIC + microprofile/microprofile.h + microprofile/microprofile_html.h + microprofile/microprofile.cpp +) + +target_include_directories(microprofile + PUBLIC + "${CMAKE_CURRENT_SOURCE_DIR}/microprofile" +) + +target_compile_definitions(microprofile + PUBLIC + MICROPROFILE_GPU_TIMERS=0 +) + +find_package(Threads REQUIRED) +target_link_libraries(microprofile + PUBLIC + Threads::Threads +) + +add_library(microprofile::microprofile ALIAS microprofile) diff --git a/external/microprofile/microprofile b/external/microprofile/microprofile new file mode 160000 index 00000000..b49ae802 --- /dev/null +++ b/external/microprofile/microprofile @@ -0,0 +1 @@ +Subproject commit b49ae80262b206a579808dc3e442f0d8aafe81e9 diff --git a/rwengine/CMakeLists.txt b/rwengine/CMakeLists.txt index 546f090a..07c132e7 100644 --- a/rwengine/CMakeLists.txt +++ b/rwengine/CMakeLists.txt @@ -151,6 +151,13 @@ target_link_libraries(rwengine OpenAL::OpenAL ) +if (ENABLE_PROFILING) + target_link_libraries(rwengine + PUBLIC + microprofile::microprofile + ) +endif() + target_include_directories(rwengine PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src"