diff --git a/CMakeLists.txt b/CMakeLists.txt index caf2ce14..b9ffdf76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,6 +215,22 @@ endif() list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS}) +if(APPLE) + include_directories(SYSTEM /usr/include/malloc) + if(POLICY CMP0042) + cmake_policy(SET CMP0042 NEW) + endif() +endif() + +if (APPLE AND NOT IOS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -fvisibility=default -std=c++11") +endif() + +if(APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -DGTEST_HAS_TR1_TUPLE=0") +endif() + + if (HIDAPI_FOUND OR LibUSB_COMPILE_TEST_PASSED) if (APPLE) if(DEPENDS) diff --git a/Makefile b/Makefile index b91344c0..bf248913 100644 --- a/Makefile +++ b/Makefile @@ -30,3 +30,8 @@ scanner: debug-static-win64: mkdir -p $(builddir)/debug && cd $(builddir)/debug && cmake -G "MSYS Makefiles" -D DEV_MODE=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Debug -D BUILD_TAG="win-x64" -D CMAKE_TOOLCHAIN_FILE=$(topdir)/cmake/64-bit-toolchain.cmake -D MSYS2_FOLDER=c:/msys64 -D MINGW=ON $(topdir) && $(MAKE) + +debug-static-mac64: + mkdir -p $(builddir)/debug + cd $(builddir)/debug && cmake -D STATIC=ON -D DEV_MODE=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=release -D BUILD_TAG="mac-x64" $(topdir) && $(MAKE) +