diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 56a9578..ca24554 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -2,13 +2,17 @@ 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 63e7986..2041a0a 160000 --- a/cpp/external/rei-json +++ b/cpp/external/rei-json @@ -1 +1 @@ -Subproject commit 63e7986b0901449657c3874ed7b19618315e9f01 +Subproject commit 2041a0aafe85085dcf35a37437db493898f1be3c diff --git a/cpp/src/palette.cpp b/cpp/src/palette.cpp index 8f40ece..e42c6bd 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 = jsonOpt.asObject(); + auto json = std::get(jsonOpt); /*if (!json.is_object() || !json["primary"].is_string() || !json["secondary"].is_string() ||*/ /*!json["background"].is_string() || !json["background2"].is_string() ||*/