Commit a924f45c authored by Peter Eastman's avatar Peter Eastman
Browse files

Allow building 64 bit binaries on OS X

parent 1f878f82
...@@ -94,10 +94,11 @@ ELSE( CMAKE_SIZEOF_VOID_P EQUAL 8 ) ...@@ -94,10 +94,11 @@ ELSE( CMAKE_SIZEOF_VOID_P EQUAL 8 )
ENDIF( CMAKE_SIZEOF_VOID_P EQUAL 8 ) ENDIF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
# Build 32 bit binaries, since CUDA doesn't currently work with 64 bit # Build 32 bit binaries, since CUDA doesn't currently work with 64 bit
IF (APPLE) IF (APPLE AND NOT CMAKE_OSX_ARCHITECTURES)
SET (CMAKE_CXX_FLAGS "-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5") SET (CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "The processor architectures to build for" FORCE)
SET (CMAKE_C_FLAGS "-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5") SET (CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "The minimum version of OS X to support" FORCE)
ENDIF (APPLE) SET (CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk" CACHE STRING "The SDK to build against" FORCE)
ENDIF (APPLE AND NOT CMAKE_OSX_ARCHITECTURES)
IF(UNIX AND NOT CMAKE_BUILD_TYPE) IF(UNIX AND NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Debug or Release build" FORCE) SET(CMAKE_BUILD_TYPE Release CACHE STRING "Debug or Release build" FORCE)
...@@ -331,6 +332,7 @@ IF(CUDA_FOUND) ...@@ -331,6 +332,7 @@ IF(CUDA_FOUND)
SET(FLAGS ${FLAGS} -gencode arch=compute_13,code=sm_13) SET(FLAGS ${FLAGS} -gencode arch=compute_13,code=sm_13)
SET(FLAGS ${FLAGS} -gencode arch=compute_20,code=sm_20) SET(FLAGS ${FLAGS} -gencode arch=compute_20,code=sm_20)
SET(FLAGS ${FLAGS} -use_fast_math) SET(FLAGS ${FLAGS} -use_fast_math)
SET(FLAGS ${FLAGS} -m32)
IF(MSVC) IF(MSVC)
# Unfortunately the variables CUDA_NVCC_FLAGS_RELEASE and CUDA_NVCC_FLAGS_DEBUG # Unfortunately the variables CUDA_NVCC_FLAGS_RELEASE and CUDA_NVCC_FLAGS_DEBUG
# appear to be unused, at least in CMake 2.6 # appear to be unused, at least in CMake 2.6
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#---------------------------------------------------- #----------------------------------------------------
IF (APPLE) IF (APPLE)
SET (CMAKE_CXX_FLAGS "-arch i386") SET (CMAKE_OSX_DEPLOYMENT_TARGET "10.6")
SET (CMAKE_C_FLAGS "-arch i386") SET (CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk")
ENDIF (APPLE) ENDIF (APPLE)
# Only run tests if this machine has a OpenCL-capable GPU # Only run tests if this machine has a OpenCL-capable GPU
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment