File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,24 @@ if(NOT WIN32)
112
112
add_definitions (-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX )
113
113
endif ()
114
114
115
+ include (CheckCCompilerFlag )
116
+ # ppc64 or ppc64le
117
+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64" )
118
+ CHECK_C_COMPILER_FLAG ("-maltivec" HAS_ALTIVEC )
119
+ if (HAS_ALTIVEC )
120
+ message (STATUS " HAS_ALTIVEC yes" )
121
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maltivec" )
122
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec" )
123
+ endif (HAS_ALTIVEC )
124
+ if (NOT CMAKE_C_FLAGS MATCHES "m(cpu|tune)" )
125
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=power8" )
126
+ endif ()
127
+ if (NOT CMAKE_CXX_FLAGS MATCHES "m(cpu|tune)" )
128
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=power8" )
129
+ endif ()
130
+ ADD_DEFINITIONS (-DHAVE_POWER8 -DHAS_ALTIVEC )
131
+ endif (CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64" )
132
+
115
133
option (WITH_FALLOCATE "build with fallocate" ON )
116
134
117
135
if (WITH_FALLOCATE AND UNIX )
@@ -377,6 +395,13 @@ else()
377
395
port/port_posix.cc
378
396
env/env_posix.cc
379
397
env/io_posix.cc )
398
+ # ppc64 or ppc64le
399
+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64" )
400
+ enable_language (ASM )
401
+ list (APPEND ROCKSDB_SOURCES
402
+ util/crc32c_ppc.c
403
+ util/crc32c_ppc_asm.S )
404
+ endif (CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64" )
380
405
endif ()
381
406
SET (SOURCES )
382
407
FOREACH (s ${ROCKSDB_SOURCES} )
You can’t perform that action at this time.
0 commit comments