Skip to content

Commit

Permalink
Use fifo_map as submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
h3x4n1um committed Nov 10, 2020
1 parent 7a379ce commit 2ebe90e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 551 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "rton-json/third_party/json"]
path = rton-json/third_party/json
url = https://github.com/nlohmann/json
[submodule "rton-json/third_party/fifo_map"]
path = rton-json/third_party/fifo_map
url = https://github.com/h3x4n1um/fifo_map
branch = cmake-submodule
8 changes: 6 additions & 2 deletions rton-json/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os")

if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -pedantic -static")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4 -WX -MT")
endif()

file(GLOB SOURCES src/*.cpp include/*.hpp lib/*.hpp)
file(GLOB SOURCES src/*.cpp include/*.hpp)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)

# require nlohmann_json
set(JSON_BuildTests OFF CACHE INTERNAL "")
add_subdirectory(third_party/json)

# require fifo_map
add_subdirectory(third_party/fifo_map)

include_directories("${CMAKE_CURRENT_SOURCE_DIR}")

add_executable(rton-json ${SOURCES})

target_link_libraries(rton-json PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(rton-json PRIVATE fifo_map::fifo_map)
3 changes: 1 addition & 2 deletions rton-json/include/json_fifo.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#include <nlohmann/json.hpp>

#include "lib/fifo_map.hpp"
#include <fifo_map.hpp>

namespace json_fifo{
//a workaround to give to use fifo_map as map, we are just ignoring the 'less' compare
Expand Down
Loading

0 comments on commit 2ebe90e

Please sign in to comment.