diff --git a/meson.build b/meson.build index 0895611..b0c2fad 100644 --- a/meson.build +++ b/meson.build @@ -37,8 +37,6 @@ gtk_layer_shell = dependency('gtk-layer-shell-0') pulse = dependency('libpulse') -sass = dependency('libsass') - headers = [ 'src/Common.h', @@ -72,7 +70,7 @@ sources = [ 'src/SNI.cpp', ] -dependencies = [gtk, gtk_layer_shell, pulse, wayland_client, sass] +dependencies = [gtk, gtk_layer_shell, pulse, wayland_client] if get_option('WithHyprland') add_global_arguments('-DWITH_HYPRLAND', language: 'cpp') @@ -82,6 +80,10 @@ if get_option('WithWorkspaces') add_global_arguments('-DWITH_WORKSPACES', language: 'cpp') headers += 'src/Workspaces.h' endif +if get_option('WithLibSass') + add_global_arguments('-DWITH_LIBSASS', language: 'cpp') + dependencies += dependency('libsass') +endif if get_option('WithNvidia') add_global_arguments('-DWITH_NVIDIA', language: 'cpp') headers += 'src/NvidiaGPU.h' diff --git a/meson_options.txt b/meson_options.txt index 03feeb3..542cd91 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,6 +4,9 @@ option('WithHyprland', type: 'boolean', value : true) # Workspaces general, enables Wayland protocol option('WithWorkspaces', type: 'boolean', value : true) +# Support for loading SCSS directly +option('WithLibSass', type: 'boolean', value : true) + # Tray icons option('WithSNI', type: 'boolean', value : true) diff --git a/src/CSS.cpp b/src/CSS.cpp index 3f56218..f18dcc9 100644 --- a/src/CSS.cpp +++ b/src/CSS.cpp @@ -5,12 +5,15 @@ #include #include +#ifdef WITH_LIBSASS #include +#endif namespace CSS { static GtkCssProvider* sProvider; +#ifdef WITH_LIBSASS bool CompileAndLoadSCSS(const std::string& scssFile) { if (!std::ifstream(scssFile).is_open()) @@ -43,6 +46,7 @@ namespace CSS sass_delete_file_context(ctx); return true; } +#endif bool LoadCSS(const std::string& cssFile) { @@ -112,6 +116,7 @@ namespace CSS for (auto& dir : locations) { +#ifdef WITH_LIBSASS if (!Config::Get().forceCSS) { if (CompileAndLoadSCSS(dir + "/style.scss")) @@ -124,6 +129,7 @@ namespace CSS LOG("Warning: Failed loading SCSS, falling back to CSS!"); } } +#endif if (LoadCSS(dir + "/style.css")) {