Dynamically link everything on Windows as well

This commit is contained in:
WerWolv 2021-01-06 16:29:34 +01:00
parent 7fd0d87d56
commit 01b7059582
3 changed files with 5 additions and 12 deletions

View File

@ -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)

View File

@ -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)

View File

@ -8,4 +8,5 @@ add_library(glad
)
target_include_directories(glad PUBLIC include)
target_link_libraries(glad PRIVATE dl)