Skip to content

Commit e774dff

Browse files
jcelerierclaude
andcommitted
build: set the static CRT at addon scope (Windows/Max)
Set CMAKE_MSVC_RUNTIME_LIBRARY at the top of the addon so the object library and every back-end external share the /MT runtime the Max external needs; mixing /MT and /MD trips MSVC with LNK2038. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 08d9793 commit e774dff

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
22

33
project(MyVideo CXX)
44

5+
# Max/MSP externals link the static CRT (/MT) on Windows, as the official
6+
# max-sdk-base requires. Set it for the whole addon -- before Avendish and the
7+
# object library are created -- so every target shares one runtime; mixing /MT
8+
# and /MD trips MSVC with LNK2038. (CMP0091 is NEW via cmake_minimum_required.)
9+
if(MSVC)
10+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
11+
endif()
12+
513
# Use the Avendish the host already provides (e.g. ossia score); otherwise fetch it.
614
# The same CMakeLists builds these as ossia/score add-on objects or as standalone objects.
715
find_package(Avendish QUIET)

0 commit comments

Comments
 (0)