Skip to content

Commit

Permalink
add ios build workaround, detailed in
Browse files Browse the repository at this point in the history
  • Loading branch information
umegaya committed Jul 27, 2016
1 parent cb73a39 commit 4a7d3b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ if (DEBUG)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
endif()
if (IOS)
# workaround for problem detailed in https://karp.id.au/a/2015/09/15/xcode-7s-new-linker-rules/
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=7.0")
endif()
file(GLOB_RECURSE src "./src/*.cpp")
if (OSXBUNDLE)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bundle")
add_executable(shutup MACOSX_BUNDLE ${src})
elseif(BUILD_ANDROID)
add_library(shutup SHARED ${src})
else()
add_library(shutup ${src})
add_library(shutup STATIC ${src})
endif()
2 changes: 2 additions & 0 deletions toolchain/ios.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,5 @@ macro (find_host_package)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endmacro (find_host_package)

# work around for https://forums.developer.apple.com/thread/18316
set (CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> crs <TARGET> <LINK_FLAGS> <OBJECTS>")

0 comments on commit 4a7d3b0

Please sign in to comment.