Skip to content

Commit

Permalink
macos: static link SDL2, lower minimim OS requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
JaCzekanski committed Sep 17, 2019
1 parent e3ce3f8 commit 183062e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis/macos/build.sh
Expand Up @@ -15,7 +15,7 @@ ccache --set-config=sloppiness=pch_defines,time_macros
premake5 xcode4

# Build
xcodebuild -workspace Avocado.xcworkspace -scheme avocado -configuration release -parallelizeTargets -jobs 4 | xcpretty
set -o pipefail && xcodebuild -workspace Avocado.xcworkspace -scheme avocado -configuration release -parallelizeTargets -jobs 4 | xcpretty

# Package
mkdir -p $ARTIFACT
Expand Down
5 changes: 3 additions & 2 deletions premake5.lua
Expand Up @@ -67,7 +67,8 @@ filter "system:macosx"
platforms {"x64"}
defaultplatform "x64"
xcodebuildsettings {
['ALWAYS_SEARCH_USER_PATHS'] = {'YES'}
["ALWAYS_SEARCH_USER_PATHS"] = "YES",
["MACOSX_DEPLOYMENT_TARGET"] = "10.12",
}

filter "system:android"
Expand Down Expand Up @@ -268,7 +269,7 @@ project "avocado"
"imgui",
}
buildoptions {getOutput("sdl2-config --cflags")}
linkoptions {getOutput("sdl2-config --libs")}
linkoptions {getOutput("sdl2-config --static-libs")}

filter {"system:android"}
files {
Expand Down
8 changes: 6 additions & 2 deletions src/platform/windows/gui/filesystem.h
@@ -1,9 +1,13 @@
#pragma once

#if defined(__has_include) && __has_include(<filesystem>) && !defined(ANDROID)
// Android has filesystem headers, but required library is missing
// macOS has filesystem since 10.15 - I wanna support older macOS versions
// For these systems GHC fallback is used.

#if defined(__has_include) && __has_include(<filesystem>) && !defined(ANDROID) && !defined(__APPLE__)
#include <filesystem>
namespace fs = std::filesystem;
#elif defined(__has_include) && __has_include(<experimental/filesystem>) && !defined(ANDROID)
#elif defined(__has_include) && __has_include(<experimental/filesystem>) && !defined(ANDROID) && !defined(__APPLE__)
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
Expand Down

0 comments on commit 183062e

Please sign in to comment.