Skip to content

Commit ca4ee28

Browse files
committed
Not entirely Sure why but VS studio debug needs this to run
1 parent 9b1d234 commit ca4ee28

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

cmake/toolchain-msvc.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ if (MSVC_RELEASE_DEBUGGING)
7171
endif()
7272
endif()
7373

74-
IF(MSVC_USE_RUNTIME_DLL)
74+
IF(MSVC_USE_RUNTIME_DLL OR FSO_BUILD_QTFRED)
7575
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<NOT:$<CONFIG:Release>>:Debug>DLL")
7676
add_compile_definitions(_AFXDLL)
77-
ELSE(MSVC_USE_RUNTIME_DLL)
77+
ELSE()
7878
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<NOT:$<CONFIG:Release>>:Debug>")
79-
ENDIF(MSVC_USE_RUNTIME_DLL)
79+
ENDIF()
8080

8181
# Debug
8282
set(CMAKE_C_FLAGS_DEBUG "/W4 /Gy /Zi /Od /RTC1 /Gd /Oy-")

qtfred/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ set_target_properties(qtfred PROPERTIES
2323
AUTORCC TRUE
2424
AUTOUIC FALSE)
2525
set_target_properties(qtfred PROPERTIES OUTPUT_NAME "qtfred_${FSO_BINARY_SUFFIX}")
26-
26+
get_target_property(QT_PLUGINS_DIR Qt6::Core QT_PLUGINS_DIR)
27+
if(MSVC AND QT_PLUGINS_DIR)
28+
set_property(TARGET ${PROJECT_NAME} PROPERTY
29+
VS_DEBUGGER_ENVIRONMENT "QT_QPA_PLATFORM_PLUGIN_PATH=${QT_PLUGINS_DIR}"
30+
)
31+
endif()
2732
target_compile_definitions(qtfred PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:PDB_DEBUGGING=1>")
2833

2934
# Undefine emit since it conflicts with our code

0 commit comments

Comments
 (0)