Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to build OptickCore as a static lib via CMake #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ source_group("OptickCore" FILES ${OPTICK_SRC})

# Enabled
option(OPTICK_ENABLED "Enable profiling with Optick" ON)
option(OPTICK_BUILD_STATIC_LIB "Build OptickCore as a static library" OFF)
option(OPTICK_INSTALL_TARGETS "Should optick be installed? Set to OFF if you use add_subdirectory to include Optick." ON)

if(NOT OPTICK_ENABLED)
Expand All @@ -43,7 +44,11 @@ option(OPTICK_BUILD_GUI_APP "Build Optick gui viewer app" OFF)
option(OPTICK_BUILD_CONSOLE_SAMPLE "Build Optick console sample app" ${standalone})

# OptickCore
add_library(OptickCore SHARED ${OPTICK_SRC})
if(OPTICK_BUILD_STATIC_LIB)
add_library(OptickCore STATIC ${OPTICK_SRC})
else()
add_library(OptickCore SHARED ${OPTICK_SRC})
endif()
target_include_directories(OptickCore
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>
Expand Down