Skip to content

Commit

Permalink
Fix MACHINE macro defintion
Browse files Browse the repository at this point in the history
Fix the detecting whether -fPIC compiler flag is needed or not
  • Loading branch information
vigsterkr committed Nov 22, 2013
1 parent 2f76d51 commit 04ce4ad
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions CMakeLists.txt
Expand Up @@ -69,11 +69,7 @@ ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
ENDIF()

# Get processor type, sets MACHINE macro
IF(NOT WIN32)
execute_process(COMMAND uname -m
OUTPUT_VARIABLE MACHINE_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
SET(MACHINE ${MACHINE_OUTPUT})
ENDIF()
SET(MACHINE ${CMAKE_SYSTEM_PROCESSOR})

SET(EXT_LIB_SWIG_RUBY_MODULAR ".so")
if(DARWIN)
Expand Down Expand Up @@ -120,7 +116,7 @@ SET(CMAKE_C_FLAGS_DISTRIBUTION "-O2")
SET(CMAKE_CXX_FLAGS_DISTRIBUTION "-O2")

# add fPIC flag
IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
IF("${MACHINE}" STREQUAL "x86_64" OR "${MACHINE}" STREQUAL "amd64")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC")
Expand Down

0 comments on commit 04ce4ad

Please sign in to comment.