Skip to content

Commit 214500d

Browse files
committed
Use target-level compile definitions for Windows VST3 module
Replace wrapper file approach with target-level compile definitions. This adds the necessary Windows macros (NOMINMAX, WIN32_LEAN_AND_MEAN, _UNICODE, _CRT_SECURE_NO_WARNINGS, etc.) to the pluginval target when building on Windows with VST3 validator enabled. https://claude.ai/code/session_01AY9chvBEmsCVjNZSUkNcbw
1 parent 92593df commit 214500d

File tree

2 files changed

+12
-53
lines changed

2 files changed

+12
-53
lines changed

CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,8 @@ if(PLUGINVAL_VST3_VALIDATOR)
138138
set_source_files_properties(${VST3_MODULE_MAC_FILE} PROPERTIES
139139
COMPILE_FLAGS "-fobjc-arc")
140140
elseif(WIN32)
141-
# Use wrapper file that sets up preprocessor definitions before including SDK source
142141
list(APPEND VST3ValidatorFiles
143-
Source/vst3validator/module_win32_wrapper.cpp)
142+
${vst3sdk_SOURCE_DIR}/public.sdk/source/vst/hosting/module_win32.cpp)
144143
endif()
145144

146145
target_sources(pluginval PRIVATE ${VST3ValidatorFiles})
@@ -174,6 +173,17 @@ target_compile_definitions(pluginval PRIVATE
174173
$<$<BOOL:${PLUGINVAL_VST3_VALIDATOR}>:PLUGINVAL_VST3_VALIDATOR=1>
175174
VERSION="${CURRENT_VERSION}")
176175

176+
# Windows-specific compile definitions for VST3 SDK compatibility
177+
if(WIN32 AND PLUGINVAL_VST3_VALIDATOR)
178+
target_compile_definitions(pluginval PRIVATE
179+
NOMINMAX
180+
WIN32_LEAN_AND_MEAN
181+
_UNICODE
182+
UNICODE
183+
_CRT_SECURE_NO_WARNINGS
184+
_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING)
185+
endif()
186+
177187
if(MSVC AND NOT CMAKE_MSVC_RUNTIME_LIBRARY)
178188
# Default to statically linking the runtime libraries
179189
set_property(TARGET pluginval PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

Source/vst3validator/module_win32_wrapper.cpp

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)