Skip to content

Commit

Permalink
fix: replace swagger with scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
namchuai committed Oct 22, 2024
1 parent d39b332 commit 4fa48b8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 795 deletions.
16 changes: 15 additions & 1 deletion engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,25 @@ find_package(CURL REQUIRED)
find_package(SQLiteCpp REQUIRED)
find_package(eventpp CONFIG REQUIRED)

file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../docs/static/openapi/jan.json" JSON_CONTENT)
string(REPLACE "\\" "\\\\" JSON_CONTENT "${JSON_CONTENT}")
string(REPLACE "\"" "\\\"" JSON_CONTENT "${JSON_CONTENT}")
string(REPLACE "\n" "\\n" JSON_CONTENT "${JSON_CONTENT}")

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cortex_openapi.h"
"#pragma once\n\n"
"namespace CortexOpenApi {\n"
" constexpr const char JSON_CONTENT[] = \"${JSON_CONTENT}\";\n"
"}\n"
)

add_executable(${TARGET_NAME} main.cc
${CMAKE_CURRENT_SOURCE_DIR}/utils/cpuid/cpu_info.cc
${CMAKE_CURRENT_SOURCE_DIR}/utils/file_logger.cc
)

target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

target_link_libraries(${TARGET_NAME} PRIVATE httplib::httplib)
target_link_libraries(${TARGET_NAME} PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(${TARGET_NAME} PRIVATE unofficial::minizip::minizip)
Expand Down Expand Up @@ -124,4 +138,4 @@ set_target_properties(${TARGET_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)
)
Loading

0 comments on commit 4fa48b8

Please sign in to comment.