Skip to content

Commit 3ed0dc3

Browse files
author
Timmy
committed
Merge pull request #24 from kknox/macosx
Macosx
2 parents 4854ff2 + 3a56ebf commit 3ed0dc3

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ get_filename_component( C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME_WE )
180180
# message( "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
181181

182182
# Set common compile and link options
183-
if( C_COMPILER_NAME STREQUAL "cl" )
183+
if( MSVC )
184184
# Following options for nMake
185185
message( STATUS "Detected MSVS Ver: " ${MSVC_VERSION} )
186186

@@ -210,8 +210,6 @@ elseif( CMAKE_COMPILER_IS_GNUCXX )
210210
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
211211
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
212212
endif()
213-
else( )
214-
message( FATAL_ERROR "Compiler not supported or not detected" )
215213
endif( )
216214

217215
# If UNICODE is defined for microsoft compilers, pass extra definitions

src/client/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ set( Client.Files ${Client.Source} ${Client.Headers} )
3333
set( DL_LIB "" )
3434
if( WIN32 )
3535
add_definitions( "/D_CONSOLE" )
36-
else()
36+
elseif( APPLE )
37+
set( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}" )
38+
else( )
3739
# To use the dlopen() and dlclose() functions, we should link with libdl
3840
set( DL_LIB "-ldl" )
39-
endif()
41+
endif( )
4042

4143
# Include standard OpenCL headers
4244
include_directories( ${Boost_INCLUDE_DIRS} ${OPENCL_INCLUDE_DIRS} ../../../common ${PROJECT_BINARY_DIR}/include ../include )

src/statTimer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ set_target_properties( StatTimer PROPERTIES SOVERSION ${CLFFT_SOVERSION} )
6969
set_target_properties( StatTimer PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/staging" )
7070
target_link_libraries( StatTimer ${OPENCL_LIBRARIES} )
7171

72-
if( UNIX )
72+
if( UNIX AND NOT APPLE )
7373
# This library dependency is brought in by the high precision timer available in linux
7474
target_link_libraries( StatTimer -lrt )
7575
endif( )

src/tests/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ if( MINGW )
5757
elseif( CMAKE_COMPILER_IS_GNUCXX )
5858
set( CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}" )
5959
set( LD_PTHREAD "-lpthread" )
60+
elseif( APPLE )
61+
set( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}" )
62+
add_definitions( -DGTEST_USE_OWN_TR1_TUPLE )
6063
endif( )
6164

6265
# Include standard OpenCL headers

0 commit comments

Comments
 (0)