Skip to content

Commit

Permalink
Trying to fix building for Windows XP part 11
Browse files Browse the repository at this point in the history
  • Loading branch information
nixxoq committed May 14, 2024
1 parent 40eab46 commit 1559d15
Show file tree
Hide file tree
Showing 6 changed files with 8,708 additions and 44 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.6)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)

project(xp-apps VERSION 0.1.0)

Expand All @@ -11,7 +11,7 @@ target_link_libraries(xp-apps PRIVATE source)
target_link_libraries(xp-apps PRIVATE nlohmann_json::nlohmann_json)
# target_link_libraries(xp-apps PRIVATE CURL::libcurl)
# target_link_libraries(xp-apps PRIVATE curlpp)
target_link_libraries(xp-apps PRIVATE cpr::cpr)
# target_link_libraries(xp-apps PRIVATE cpr::cpr)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
Expand Down
11 changes: 7 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define _WIN32_WINNT 0x0500
#include "source/deps/httplib.h"
#include <iostream>
#include "source/functions.h"
#include "source/constants.h"
Expand All @@ -10,15 +10,18 @@ int main(int argc, char **argv)
// return 0;
// }

curl_global_init(CURL_GLOBAL_DEFAULT);
getFile("https://raw.githubusercontent.com/Snaky1a/xp-apps/development/upd.json");
// curl_global_init(CURL_GLOBAL_DEFAULT);
// getFile("https://raw.githubusercontent.com/Snaky1a/xp-apps/development/upd.json");
httplib::Client client("https://raw.githubusercontent.com/");
auto res = client.Get("/Snaky1a/xp-apps/development/upd.json");
std::cout << res->status << std::endl;

if (!checkFlags(argc, argv))
{
printHelp();
return 0;
};

curl_global_cleanup();
// curl_global_cleanup();
return 0;
}
22 changes: 13 additions & 9 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.6)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)

include(FetchContent)
FetchContent_Declare(
Expand All @@ -20,27 +20,31 @@ target_include_directories(source PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${json_SOURCE_DIR}/include
)
target_include_directories(source PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
deps/
)

if(WIN32) # Install dlls in the same directory as the executable on Windows
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()

FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
GIT_TAG 00429da19f55834c912af5581290fc0584f3ca67)
FetchContent_MakeAvailable(cpr)
target_include_directories(source PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${cpr_SOURCE_DIR}/include
)
# FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
# GIT_TAG 00429da19f55834c912af5581290fc0584f3ca67)
# FetchContent_MakeAvailable(cpr)
# target_include_directories(source PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}
# ${cpr_SOURCE_DIR}/include
# )
# target_include_directories(source PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}
# ${curl_SOURCE_DIR}/include
# )
SET(CPR_USE_SYSTEM_CURL BOOL TRUE)
target_link_libraries(source PRIVATE nlohmann_json::nlohmann_json)
# target_link_libraries(source PRIVATE curlpp)
target_link_libraries(source PRIVATE cpr::cpr)
# target_link_libraries(source PRIVATE cpr::cpr)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
Expand Down
Loading

0 comments on commit 1559d15

Please sign in to comment.