в моей библиотеке CMakeLists.txt
Код: Выделить всё
add_library(Presentation presenter.cpp)
option(USE_PVERBOSE "should your logs be verbose" ON)
if (USE_PVERBOSE)
message(STATUS "USE_PVERBOSE is: ${USE_PVERBOSE}")
add_library(LogTime STATIC logtime.cpp)
target_link_libraries(Presentation PRIVATE LogTime)
target_compile_definitions(Presentation PRIVATE "USE_PVERBOSE")
endif()
Код: Выделить всё
#include
#ifdef USE_PVERBOSE
#include "logtime.cpp"
#endif
void present(std::string content) {
#ifdef USE_PVERBOSE
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78959995/target-compile-definitions-doesnt-add-the-required-definition[/url]
Мобильная версия