Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
# Windows:
# cmake -G"Visual Studio 14 2015 Win64" ..

cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.19)

IF(APPLE)
SET(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Build architectures for Mac OS X" FORCE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version")
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0" CACHE STRING "Minimum OS X deployment version")
ENDIF(APPLE)

project(Vutu)
Expand All @@ -28,6 +28,11 @@ project(Vutu)
if(APPLE)
# For now, explicitly disable C++17 alignment feature
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-aligned-new")

# Add Apple Silicon optimizations
if(CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=apple-m1")
endif()
elseif(WIN32)
# no unknown pragma warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068")
Expand Down Expand Up @@ -339,8 +344,6 @@ if(APPLE)
XCODE_ATTRIBUTE_INFOPLIST_FILE ${CMAKE_CURRENT_LIST_DIR}/source/mac/Info.plist
XCODE_ATTRIBUTE_INFOPLIST_PREPROCESS NO
)
elseif(APPLE)
target_sources(${target} PRIVATE resource/vutu.rc)
endif(APPLE)

message (STATUS "Info.plist source: ${CMAKE_CURRENT_LIST_DIR}/source/mac/Info.plist")
Expand Down Expand Up @@ -375,11 +378,8 @@ if(APPLE)

set(APP_BUNDLE ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/Vutu.app)

# Mac OS Monterey, XCode 14.0
# set(ENTITLEMENTS ${CMAKE_CURRENT_BINARY_DIR}/build/${target}.build/$<CONFIG>/${target}.build/${target}.app.xcent)

# Mac OS Ventura, XCode 14.2 - looks like they changed the .xcent location
set(ENTITLEMENTS ${CMAKE_CURRENT_BINARY_DIR}/${target}.build/$<CONFIG>/${target}.build/${target}.app.xcent)
# Use modern entitlements file for macOS Sequoia compatibility
set(ENTITLEMENTS ${CMAKE_CURRENT_LIST_DIR}/source/mac/Vutu.entitlements)

message("ENTITLEMENTS: " ${ENTITLEMENTS})

Expand All @@ -396,9 +396,11 @@ if(APPLE)
"${APP_BUNDLE}/Contents/Frameworks/SDL2.framework"
)

# Add build target for codesigning the framework bundle
# Add build target for codesigning the framework bundle with modern entitlements
add_custom_command(TARGET ${target}
POST_BUILD
COMMAND codesign --force --sign "-" --entitlements ${ENTITLEMENTS} "${APP_BUNDLE}/Contents/Frameworks/SDL2.framework/Versions/A"
COMMAND codesign --force --sign "-" --entitlements ${ENTITLEMENTS} "${APP_BUNDLE}"
COMMENT "Code signing application and frameworks with modern entitlements"
)
endif()
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ Vutu can be built with CMake:

The libsndfile and libresample libraries are also included. Because some configuration is required to get these to work, they are compiled here from source.

On MacOS, we link to SDL2.framework. Get the latest SDL2 .dmg, place SDL2.framework into /Library/Frameworks, and CMake should take care of the rest.
### macOS (including Apple Silicon)

On macOS, we link to SDL2.framework. Get the latest SDL2 .dmg, place SDL2.framework into /Library/Frameworks, and CMake should take care of the rest.

**Apple Silicon Support**: Vutu now includes full Apple Silicon (M1/M2/M3) support with universal binary compilation. The build system automatically detects the target architecture and applies appropriate optimizations.

**Requirements**:
- macOS 12.0 or later
- Xcode 14.0 or later for optimal Apple Silicon support
- CMake 3.19 or later

Everything is theoretically cross-platform but I'm currently working on Mac and have not been testing on Windows.

7 changes: 5 additions & 2 deletions source/common/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// vutu (c) 2022, Madrona Labs LLC, all rights reserved
// see LICENSE.txt for details

#define stringPluginName "Vutu"
#define stringCompanyName "Madrona Labs"

#define MAJOR_VERSION_STR "0"
#define MAJOR_VERSION_INT 0

Expand All @@ -24,12 +27,12 @@
#if defined(__x86_64__) || defined(_M_X64)
#define ML_ARCH "x86_64"
#elif defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86)
#define ML_ARCH "x86_32";
#define ML_ARCH "x86_32"
#elif defined(__arm__) || defined(__aarch64__)
#define ML_ARCH "Arm"
#else
#define ML_ARCH "unknown"
warning ML_ARCH is undefined!
#warning ML_ARCH is undefined!
#endif

inline const char* getAppVersion()
Expand Down
16 changes: 8 additions & 8 deletions source/common/vutu.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
#define MAJOR_VERSION_STR "0"
#define MAJOR_VERSION_INT 0

#define SUB_VERSION_STR "1"
#define SUB_VERSION_INT 1
#define SUB_VERSION_STR "9"
#define SUB_VERSION_INT 9

#define RELEASE_NUMBER_STR "0"
#define RELEASE_NUMBER_INT 0
#define RELEASE_NUMBER_STR "10"
#define RELEASE_NUMBER_INT 10

#define BETA_NUMBER_STR "0"
#define BETA_NUMBER_INT 0

#define BUILD_NUMBER_INT 0

#define SHORT_VERSION_STR "0.1.0"
#define SHORT_VERSION_STR "0.9.10"
#define VERSION_STR SHORT_VERSION_STR

#define FULL_VERSION_STR "0.1.0"
#define FULL_VERSION_STR "0.9.10"

#if defined(__x86_64__) || defined(_M_X64)
#define ML_ARCH "x86_64"
#elif defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86)
#define ML_ARCH "x86_32";
#define ML_ARCH "x86_32"
#elif defined(__arm__) || defined(__aarch64__)
#define ML_ARCH "Arm"
#else
#define ML_ARCH "unknown"
warning ML_ARCH is undefined!
#warning ML_ARCH is undefined!
#endif


Expand Down
13 changes: 13 additions & 0 deletions source/mac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,18 @@
<true/>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>12.0</string>
<key>LSArchitecturePriority</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>NSMicrophoneUsageDescription</key>
<string>Vutu requires microphone access for audio input and analysis.</string>
<key>NSCameraUsageDescription</key>
<string>Vutu may need camera access for certain audio-visual features.</string>
</dict>
</plist>
28 changes: 28 additions & 0 deletions source/mac/Vutu.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<false/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.temporary-exception.audio-unit-host</key>
<true/>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<array>
<string>com.apple.coreservices.quarantine-resolver</string>
</array>
</dict>
</plist>