cmake: fix MSVC build

This commit is contained in:
oltolm committed 2025-12-09 22:26:52 +01:00
1 parent bb767fa537
commit a2447f2c2e
1 file changed
+5 -2
+5 -2
View File
@@ -949,6 +949,10 @@ if(ARM64)
endif()
endif()
if(TARGET Ext::GLEW)
target_link_libraries(Common Ext::GLEW)
endif()
if(USING_GLES2 OR (USING_EGL AND NOT USING_FBDEV))
find_package(X11)
endif()
@@ -2771,7 +2775,6 @@ endif()
list(APPEND LinkCommon ${CoreLibName} ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
list(APPEND LinkCommon kernel32 user32 gdi32 shell32 comctl32 dsound xinput winmm dinput8 ole32 winspool ksuser dwmapi mf uxtheme mfplat mfreadwrite mfuuid shlwapi setupapi hid)
#setup_target_project(${TargetBin} Windows)
list(APPEND NativeAppSource ${WindowsFiles})
endif()
@@ -2968,8 +2971,8 @@ if(TargetBin)
add_executable(${TargetBin} WIN32 ${NativeAppSource})
if(NOT MSVC)
target_compile_options(${TargetBin} PRIVATE $<$<CXX_COMPILER_ID:Clang>:-Wno-c++11-narrowing>)
target_link_libraries(${TargetBin} Version Dwmapi Avrt)
endif()
target_link_libraries(${TargetBin} avrt comctl32 dinput8 dwmapi hid ksuser mfplat setupapi uxtheme version)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${TargetBin})
else()
add_executable(${TargetBin} ${NativeAppSource})