Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit e2fd6d3

Browse files
committed
fix: replace swagger with scalar
1 parent d39b332 commit e2fd6d3

File tree

3 files changed

+51
-795
lines changed

3 files changed

+51
-795
lines changed

engine/CMakeLists.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,31 @@ find_package(CURL REQUIRED)
8080
find_package(SQLiteCpp REQUIRED)
8181
find_package(eventpp CONFIG REQUIRED)
8282

83+
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../docs/static/openapi/jan.json" JSON_CONTENT)
84+
string(REPLACE "\\" "\\\\" JSON_CONTENT "${JSON_CONTENT}")
85+
string(REPLACE "\"" "\\\"" JSON_CONTENT "${JSON_CONTENT}")
86+
string(REPLACE "\n" "\\n" JSON_CONTENT "${JSON_CONTENT}")
87+
88+
configure_file(
89+
"${CMAKE_CURRENT_SOURCE_DIR}/cortex_openapi.h.in"
90+
"${CMAKE_CURRENT_BINARY_DIR}/cortex_openapi.h"
91+
@ONLY
92+
)
93+
94+
# file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cortex_openapi.h"
95+
# "#pragma once\n\n"
96+
# "namespace CortexOpenApi {\n"
97+
# " constexpr const char JSON_CONTENT[] = \"${JSON_CONTENT}\";\n"
98+
# "}\n"
99+
# )
100+
83101
add_executable(${TARGET_NAME} main.cc
84102
${CMAKE_CURRENT_SOURCE_DIR}/utils/cpuid/cpu_info.cc
85103
${CMAKE_CURRENT_SOURCE_DIR}/utils/file_logger.cc
86104
)
87105

106+
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
107+
88108
target_link_libraries(${TARGET_NAME} PRIVATE httplib::httplib)
89109
target_link_libraries(${TARGET_NAME} PRIVATE nlohmann_json::nlohmann_json)
90110
target_link_libraries(${TARGET_NAME} PRIVATE unofficial::minizip::minizip)
@@ -124,4 +144,4 @@ set_target_properties(${TARGET_NAME} PROPERTIES
124144
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}
125145
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}
126146
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
127-
)
147+
)

0 commit comments

Comments
 (0)