Use target_compile_definitions for -DCHATTERINO_HAVE_PLUGINS

This commit is contained in:
Mm2PL 2023-02-06 22:46:32 +01:00
parent 1040fbc5e4
commit df9c269d6d
No known key found for this signature in database
GPG key ID: 94AC9B80EFA15ED9
2 changed files with 8 additions and 5 deletions

View file

@ -26,11 +26,6 @@ option(BUILD_SHARED_LIBS "" OFF)
option(CHATTERINO_LTO "Enable LTO for all targets" OFF)
option(CHATTERINO_PLUGINS "Enable EXPERIMENTAL plugin support in Chatterino" OFF)
if(CHATTERINO_PLUGINS)
add_definitions(-DCHATTERINO_HAVE_PLUGINS)
message(STATUS "Building Chatterino with lua plugin support enabled.")
endif()
if(CHATTERINO_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT CHATTERINO_ENABLE_LTO OUTPUT IPO_ERROR)

View file

@ -593,6 +593,14 @@ list(APPEND SOURCE_FILES ${RES_AUTOGEN_FILES})
add_library(${LIBRARY_PROJECT} OBJECT ${SOURCE_FILES})
if(CHATTERINO_PLUGINS)
target_compile_definitions(${LIBRARY_PROJECT}
PRIVATE
CHATTERINO_HAVE_PLUGINS
)
message(STATUS "Building Chatterino with lua plugin support enabled.")
endif()
if (CHATTERINO_GENERATE_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags_to_target(${LIBRARY_PROJECT})