Working on windows with https

This commit is contained in:
2026-08-30 12:49:32 -06:00
parent 92d11b5fbb
commit 43da2c7ac1
4 changed files with 17 additions and 10 deletions
+3 -7
View File
@@ -20,6 +20,9 @@ target_include_directories(YTMusicDL26 PUBLIC
include(cmake/CPM.cmake)
set(CURL_USE_LIBPSL OFF CACHE BOOL "" FORCE)
set(CURL_USE_SCHANNEL ON)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
CPMAddPackage("gh:nlohmann/json#v3.12.0")
CPMAddPackage("gh:curl/curl#curl-8_21_0")
@@ -38,13 +41,6 @@ if (WIN32)
-static-libstdc++
-static
)
add_custom_command(TARGET YTMusicDL26 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_RUNTIME_DLLS:YTMusicDL26>
$<TARGET_FILE_DIR:YTMusicDL26>
COMMAND_EXPAND_LISTS
)
endif ()
+11
View File
@@ -0,0 +1,11 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+2 -2
View File
@@ -57,13 +57,13 @@ auto main(int argc, char* argv[]) -> int {
if (!content->rip(musicDir, [&content, &urls](int percent) {
if (percent == 0) {
printf("\rGathering info... (this may take awhile)");
printf("\r\033[KGathering info... (this may take a while)");
fflush(stdout);
} else {
std::string artist;
std::string album;
content->info(artist, album);
printf("\r%s by %s at %d%%", album.c_str(), artist.c_str(), percent);
printf("\r\033[K%s by %s at %d%%", album.c_str(), artist.c_str(), percent);
fflush(stdout);
}
})) {
+1 -1
View File
@@ -1,6 +1,6 @@
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=~/TC-mingw.cmake -GNinja ..
cmake -DCMAKE_TOOLCHAIN_FILE=cmake/windows-x86_64-toolchain.cmake -GNinja ..
ninja
wine YTMusicDL26.exe
cd ..