mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Detecting mac framework
According to https://github.com/andelf/rust-sdl2_mixer/issues/4
This commit is contained in:
@@ -41,10 +41,30 @@ SOURCE_FILES = $(shell test -e src/ && find src -type f)
|
||||
COMPILER = rustc
|
||||
|
||||
# For release:
|
||||
COMPILER_FLAGS = -O --cfg mac_framework
|
||||
COMPILER_FLAGS = -O
|
||||
# For debugging:
|
||||
# COMPILER_FLAGS = -g
|
||||
|
||||
UNAME=$(shell uname)
|
||||
|
||||
ifeq ($(UNAME),Darwin)
|
||||
# If the user wasn't explicit, see if SDL2 library exists
|
||||
ifeq ("$(strip $(SDL_MODE))","")
|
||||
SDL_CHECK=$(shell pkg-config --exists sdl2)
|
||||
ifeq ($(SDL_CHECK),0)
|
||||
SDL_MODE = dylib
|
||||
else
|
||||
SDL_MODE = framework
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SDL_MODE),framework)
|
||||
COMPILER_FLAGS+=--cfg mac_framework
|
||||
else
|
||||
COMPILER_FLAGS+=--cfg mac_dylib
|
||||
endif
|
||||
endif
|
||||
|
||||
RUSTDOC = rustdoc
|
||||
|
||||
# Extracts target from rustc.
|
||||
|
||||
Reference in New Issue
Block a user