From 01b70595822d5a07fdcc569f731ecffbd2c18f70 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 6 Jan 2021 16:29:34 +0100 Subject: [PATCH] Dynamically link everything on Windows as well --- CMakeLists.txt | 10 +++------- external/ImGui/CMakeLists.txt | 6 +----- external/glad/CMakeLists.txt | 1 + 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90fcf72f5..8f52eae6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ set(Python_FIND_FRAMEWORK NEVER) # Find packages find_package(PkgConfig REQUIRED) -pkg_search_module(CRYPTO REQUIRED libcrypto) +pkg_search_module(CRYPTO REQUIRED crypto) pkg_search_module(CAPSTONE REQUIRED capstone) find_package(OpenGL REQUIRED) find_package(nlohmann_json REQUIRED) @@ -51,7 +51,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -DPYTHON_VERSION_MAJOR_ # Detect current OS / System if (MSYS OR MINGW) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOS_WINDOWS -static-libstdc++ -static-libgcc -static") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOS_WINDOWS") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wl,-subsystem,windows") elseif(APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOS_MACOS") @@ -155,11 +155,7 @@ set_target_properties(imhex PROPERTIES CXX_VISIBILITY_PRESET hidden) target_link_directories(imhex PRIVATE ${CRYPTO_LIBRARY_DIRS} ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS}) -if (WIN32) - target_link_libraries(imhex libgcc.a libstdc++.a libmagic.a libgnurx.a libtre.a libintl.a libiconv.a shlwapi.lib libcrypto.a libwinpthread.a libcapstone.a LLVMDemangle imgui libimhex ${Python_LIBRARIES} nlohmann_json::nlohmann_json dl) -elseif (UNIX) - target_link_libraries(imhex magic crypto ${CMAKE_DL_LIBS} capstone LLVMDemangle imgui libimhex ${Python_LIBRARIES} nlohmann_json::nlohmann_json dl) -endif() +target_link_libraries(imhex magic crypto ${CMAKE_DL_LIBS} capstone LLVMDemangle imgui libimhex ${Python_LIBRARIES} nlohmann_json::nlohmann_json dl) if (CREATE_BUNDLE) include(PostprocessBundle) diff --git a/external/ImGui/CMakeLists.txt b/external/ImGui/CMakeLists.txt index 24562c4fb..4fac8ec57 100644 --- a/external/ImGui/CMakeLists.txt +++ b/external/ImGui/CMakeLists.txt @@ -28,8 +28,4 @@ target_include_directories(imgui PUBLIC include ${FREETYPE_INCLUDE_DIRS} ${GLFW_ target_link_directories(imgui PUBLIC ${GLM_INCLUDE_DIRS} ${GLFW_LIBRARY_DIRS}) -if (WIN32) - target_link_libraries(imgui Freetype::Freetype glad libglfw3.a) -elseif (UNIX) - target_link_libraries(imgui Freetype::Freetype glad glfw) -endif() +target_link_libraries(imgui Freetype::Freetype glad glfw3) diff --git a/external/glad/CMakeLists.txt b/external/glad/CMakeLists.txt index 19320959e..154a0fc47 100644 --- a/external/glad/CMakeLists.txt +++ b/external/glad/CMakeLists.txt @@ -8,4 +8,5 @@ add_library(glad ) target_include_directories(glad PUBLIC include) + target_link_libraries(glad PRIVATE dl) \ No newline at end of file