From b6bcc75cb8118e0bd56c82c98629f50a9d1472bb Mon Sep 17 00:00:00 2001 From: Poseydon42 Date: Tue, 11 Oct 2022 19:50:02 +0100 Subject: [PATCH] Added option to build OptickCore as a static lib. --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39696185..a2995437 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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 $