Skip to content

Commit

Permalink
Add microprofile to rwengine dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
danhedron committed Sep 1, 2018
1 parent b9ef99e commit 63a2caa
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "external/microprofile/microprofile"]
path = external/microprofile/microprofile
url = https://github.com/jonasmr/microprofile.git
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions external/CMakeLists.txt
@@ -0,0 +1,3 @@
if(ENABLE_PROFILING)
add_subdirectory(microprofile)
endif()
23 changes: 23 additions & 0 deletions 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)
1 change: 1 addition & 0 deletions external/microprofile/microprofile
Submodule microprofile added at b49ae8
7 changes: 7 additions & 0 deletions rwengine/CMakeLists.txt
Expand Up @@ -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"
Expand Down

0 comments on commit 63a2caa

Please sign in to comment.