From 41b60064ad052e746b8d423f7339894c8b11d3b7 Mon Sep 17 00:00:00 2001 From: EinTim23 Date: Fri, 1 Nov 2024 16:55:27 +0100 Subject: [PATCH] Prepared CMake build for cross platform build --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 805bb81..8a99ee5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,5 +4,9 @@ file(GLOB_RECURSE SOURCES "src/*.cpp") add_executable (rpc ${SOURCES}) set_property(TARGET rpc PROPERTY CXX_STANDARD 20) add_subdirectory("vendor") -target_link_libraries(rpc PUBLIC WindowsApp discord-rpc libcurl_static mbedcrypto mbedx509 mbedtls) +set(LIBRARIES discord-rpc libcurl_static mbedcrypto mbedx509 mbedtls) +if(WIN32) + list(APPEND LIBRARIES WindowsApp) +endif() +target_link_libraries(rpc PUBLIC ${LIBRARIES}) target_include_directories(rpc PRIVATE vendor) \ No newline at end of file