Skip to content

Commit

Permalink
refactor: rename cortex-cpp to engine
Browse files Browse the repository at this point in the history
  • Loading branch information
vansangpfiev committed Aug 26, 2024
1 parent 952c0eb commit 9d2b02d
Show file tree
Hide file tree
Showing 62 changed files with 63 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ cortex-js/package-lock.json
.vscode
cortex-js/command
cortex-js/src/infrastructure/commanders/test/test_data
**/vcpkg_installed
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "engine/vcpkg"]
path = engine/vcpkg
url = https://github.com/microsoft/vcpkg.git
File renamed without changes.
File renamed without changes.
30 changes: 26 additions & 4 deletions cortex-cpp/CMakeLists.txt → engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(OPENSSL_USE_STATIC_LIBS TRUE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build-deps/_install)
# set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build-deps/_install)
# This is the critical line for installing another package

if(MSVC)
add_compile_options(
$<$<CONFIG:>:/MT> #---------|
$<$<CONFIG:Debug>:/MTd> #---|-- Statically link the runtime libraries
$<$<CONFIG:Release>:/MT> #--|
)
endif()

if(LLAMA_CUDA)
cmake_minimum_required(VERSION 3.17)

Expand Down Expand Up @@ -75,6 +83,16 @@ add_compile_definitions(CORTEX_CPP_VERSION="${CORTEX_CPP_VERSION}")

# add_subdirectory(test)

find_package(jsoncpp CONFIG REQUIRED)
find_package(Drogon CONFIG REQUIRED)
find_package(yaml-cpp CONFIG REQUIRED)
find_package(jinja2cpp CONFIG REQUIRED)
find_package(httplib CONFIG REQUIRED)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(CLI11 CONFIG REQUIRED)
find_package(unofficial-minizip CONFIG REQUIRED)
find_package(LibArchive REQUIRED)

# Build using CMAKE-JS
if(DEFINED CMAKE_JS_INC)
if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"))
Expand Down Expand Up @@ -109,8 +127,12 @@ endif()
#
# and comment out the following lines

find_package(Drogon CONFIG REQUIRED)

target_link_libraries(${PROJECT_NAME} PRIVATE httplib::httplib)
target_link_libraries(${PROJECT_NAME} PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(${PROJECT_NAME} PRIVATE jinja2cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE CLI11::CLI11)
target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::minizip::minizip)
target_link_libraries(${PROJECT_NAME} PRIVATE LibArchive::LibArchive)

# Build using CMAKE-JS
if(DEFINED CMAKE_JS_INC)
Expand All @@ -124,7 +146,7 @@ if(DEFINED CMAKE_JS_INC)
execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS})
endif()
else()
target_link_libraries(${PROJECT_NAME} PRIVATE Drogon::Drogon
target_link_libraries(${PROJECT_NAME} PRIVATE JsonCpp::JsonCpp Drogon::Drogon OpenSSL::SSL OpenSSL::Crypto yaml-cpp::yaml-cpp
${CMAKE_THREAD_LIBS_INIT})
endif()
# ##############################################################################
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions engine/vcpkg
Submodule vcpkg added at fb5448
14 changes: 14 additions & 0 deletions engine/vcpkg-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"default-registry": {
"kind": "git",
"baseline": "a76e5d9e1c62a23b9e92353e5e25d8c34cda2b74",
"repository": "https://github.com/Cheaterdev/vcpkg"
},
"registries": [
{
"kind": "artifact",
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
"name": "microsoft"
}
]
}
18 changes: 18 additions & 0 deletions engine/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"dependencies": [
"cli11",
{
"name": "cpp-httplib",
"features": [
"openssl"
]
},
"drogon",
"jinja2cpp",
"jsoncpp",
"minizip",
"nlohmann-json",
"yaml-cpp",
"libarchive"
]
}

0 comments on commit 9d2b02d

Please sign in to comment.