Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support iOS Simulator and tvOS Simulator, plus further tvOS integration #935

Merged
merged 15 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from 14 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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ osx_image: xcode11.5

# Build dependencies with verbose logging to avoid Travis timing out.
install:
- ./fetchDependencies -v
- ./fetchDependencies -v --macos

script:
- xcodebuild -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package"
- xcodebuild -workspace Demos/Demos.xcworkspace -scheme "Cube-macOS"
- xcodebuild build -project MoltenVKPackaging.xcodeproj -scheme "MoltenVK Package (macOS only)"
- xcodebuild build -workspace Demos/Demos.xcworkspace -scheme "Cube-macOS"

70 changes: 37 additions & 33 deletions Common/MVKCommonEnvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,58 +24,62 @@ extern "C" {
#endif // __cplusplus


#include <Availability.h>
#include <TargetConditionals.h>


/**
* Compiler build setting that ensures a definite value for whether this build is
* a debug build or not.
* Compiler build setting that ensures a definite value for whether this
* build is a debug build or not.
*
* If the standard DEBUG build setting is defined, MVK_DEBUG is set to true,
* otherwise, it is set to false.
*/
#ifndef MVK_DEBUG
# ifdef DEBUG
# define MVK_DEBUG 1
# define MVK_DEBUG 1
# else
# define MVK_DEBUG 0
# endif // DEBUG
#endif // MVK_DEBUG
# define MVK_DEBUG 0
# endif
#endif

/** Building for macOS. */
#ifndef MVK_MACOS
# define MVK_MACOS TARGET_OS_OSX
#endif

/** Building for iOS. */
#ifndef MVK_IOS
# define MVK_IOS TARGET_OS_IOS
#endif

/** Building for tvOS. Use ifdef instead of defined() operator to allow MVK_TVOS to be used in expansions */
/** Building for tvOS. */
#ifndef MVK_TVOS
# ifdef __TV_OS_VERSION_MAX_ALLOWED
# define MVK_TVOS 1
# else
# define MVK_TVOS 0
# endif
# define MVK_TVOS TARGET_OS_TV
#endif

/** Building for iOS or tvOS. Use ifdef instead of defined() operator to allow MVK_IOS_OR_TVOS to be used in expansions */
/** Building for iOS or tvOS. */
#ifndef MVK_IOS_OR_TVOS
# if __IPHONE_OS_VERSION_MAX_ALLOWED
# define MVK_IOS_OR_TVOS 1
# else
# define MVK_IOS_OR_TVOS 0
# endif
# define MVK_IOS_OR_TVOS (MVK_IOS || MVK_TVOS)
#endif

/** Building for iOS. Use ifdef instead of defined() operator to allow MVK_IOS to be used in expansions */
#ifndef MVK_IOS
# if MVK_IOS_OR_TVOS && !MVK_TVOS
# define MVK_IOS 1
# else
# define MVK_IOS 0
# endif
/** Building for iOS or tvOS. */
#ifndef MVK_MACOS_OR_IOS
# define MVK_MACOS_OR_IOS (MVK_MACOS || MVK_IOS)
#endif

/** Building for macOS. Use ifdef instead of defined() operator to allow MVK_MACOS to be used in expansions */
#ifndef MVK_MACOS
# ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
# define MVK_MACOS 1
# else
# define MVK_MACOS 0
# endif
/** Building for a Simulator. */
#ifndef MVK_OS_SIMULATOR
# define MVK_OS_SIMULATOR TARGET_OS_SIMULATOR
#endif

/** Building for iOS Simulator. */
#ifndef MVK_IOS_SIMULATOR
# define MVK_IOS_SIMULATOR (MVK_IOS && MVK_OS_SIMULATOR)
#endif

/** Building for tvOS Simulator. */
#ifndef MVK_TVOS_SIMULATOR
# define MVK_TVOS_SIMULATOR (MVK_TVOS && MVK_OS_SIMULATOR)
#endif

/** Directive to identify public symbols. */
Expand Down
2 changes: 1 addition & 1 deletion Common/MVKOSExtensions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ bool mvkGetEnvVarBool(std::string varName, bool* pWasFound) {
#pragma mark System memory

uint64_t mvkGetSystemMemorySize() {
#if MVK_MACOS || MVK_IOS
#if MVK_MACOS_OR_IOS
mach_msg_type_number_t host_size = HOST_BASIC_INFO_COUNT;
host_basic_info_data_t info;
if (host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&info, &host_size) == KERN_SUCCESS) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../MoltenVK/iOS/framework\"",
Expand All @@ -655,6 +656,7 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.API-Samples";
PRODUCT_NAME = "API-Samples";
SDKROOT = iphoneos;
Expand All @@ -666,6 +668,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"\"$(SRCROOT)/../../../MoltenVK/iOS/framework\"",
Expand All @@ -676,6 +679,7 @@
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = "com.moltenvk.API-Samples";
PRODUCT_NAME = "API-Samples";
SDKROOT = iphoneos;
Expand Down
6 changes: 5 additions & 1 deletion Demos/LunarG-VulkanSamples/API-Samples/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>UIMainStoryboardFile</key>
Expand Down
Loading