diff --git a/cmake/daggy_features.cmake b/cmake/daggy_features.cmake index 6807bf4..7af1ff9 100644 --- a/cmake/daggy_features.cmake +++ b/cmake/daggy_features.cmake @@ -21,5 +21,5 @@ endif () message("-- DAGGY_ENABLE_REDIS is set to ${DAGGY_ENABLE_REDIS}") if (${DAGGY_ENABLE_REDIS} STREQUAL "ON") include(cmake/hiredis.cmake) - target_compile_definitions(redis INTERFACE DAGGY_ENABLE_REDIS) + target_compile_definitions(hiredis INTERFACE DAGGY_ENABLE_REDIS) endif () diff --git a/daggyd/daggyd/daggyd.cpp b/daggyd/daggyd/daggyd.cpp index 7aa8471..5398ad5 100644 --- a/daggyd/daggyd/daggyd.cpp +++ b/daggyd/daggyd/daggyd.cpp @@ -12,13 +12,19 @@ // Add executors here #include #include + +#ifdef DAGGY_ENABLE_SLURM #include +#endif // Add loggers here #include #include #include + +#ifdef DAGGY_ENABLE_REDIS #include +#endif namespace rj = rapidjson; @@ -134,6 +140,7 @@ std::unique_ptr loggerFactory(const rj::Value &config) return std::make_unique(ofh); } } +#ifdef DAGGY_ENABLE_REDIS else if (name == "RedisLogger") { std::string host = "localhost"; uint16_t port = 6379; @@ -148,6 +155,7 @@ std::unique_ptr loggerFactory(const rj::Value &config) return std::make_unique(prefix, host, port); } +#endif else throw std::runtime_error("Unknown logger type: " + name); } @@ -175,9 +183,11 @@ std::unique_ptr executorFactory(const rj::Value &config) threads = execConfig["threads"].GetInt64(); return std::make_unique(threads); } +#ifdef DAGGY_ENABLE_SLURM else if (name == "SlurmTaskExecutor") { return std::make_unique(); } +#endif else if (name == "DaggyRunnerTaskExecutor") { if (!execConfig.HasMember("runners")) throw std::runtime_error(