From df9c269d6d134799843fe15b5d73640662a00618 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Mon, 6 Feb 2023 22:46:32 +0100 Subject: [PATCH] Use target_compile_definitions for -DCHATTERINO_HAVE_PLUGINS --- CMakeLists.txt | 5 ----- src/CMakeLists.txt | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90a1be3de..ba0bddf63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1ca0f6eca..bf8bf23c0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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})