diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index ca24554..56a9578 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -2,17 +2,13 @@ cmake_minimum_required(VERSION 3.21) project(selenite LANGUAGES CXX) set(CMAKE_CXX_STANDARD 23) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -#set(CMAKE_COMPILE_WARNING_AS_ERROR ON) -set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) - -add_subdirectory(external/rei-json) add_library(selenite src/palette.cpp ) +target_include_directories(selenite PRIVATE "include") +add_subdirectory(external/rei-json) +target_include_directories(selenite PRIVATE "external/rei-json/include") target_link_libraries(selenite PRIVATE rei-json) -target_include_directories(selenite PRIVATE "include") -target_include_directories(selenite PRIVATE "external/rei-json/include") diff --git a/cpp/external/rei-json b/cpp/external/rei-json index 2041a0a..63e7986 160000 --- a/cpp/external/rei-json +++ b/cpp/external/rei-json @@ -1 +1 @@ -Subproject commit 2041a0aafe85085dcf35a37437db493898f1be3c +Subproject commit 63e7986b0901449657c3874ed7b19618315e9f01 diff --git a/cpp/src/palette.cpp b/cpp/src/palette.cpp index e42c6bd..8f40ece 100644 --- a/cpp/src/palette.cpp +++ b/cpp/src/palette.cpp @@ -30,9 +30,9 @@ std::optional parseJson(const std::string &path) std::stringstream buffer; buffer << file.rdbuf(); auto jsonStr = buffer.str(); - + auto jsonOpt = rei::json::parse(jsonStr); - auto json = std::get(jsonOpt); + auto json = jsonOpt.asObject(); /*if (!json.is_object() || !json["primary"].is_string() || !json["secondary"].is_string() ||*/ /*!json["background"].is_string() || !json["background2"].is_string() ||*/