Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
dictoon committed Oct 6, 2015
1 parent d89c30a commit 9d70484
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ else()
# Unknown arch. No SIMD.
endif ()


#--------------------------------------------------------------------------------------------------
# Common settings.
#--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -271,6 +272,7 @@ if (WITH_PARTIO)
find_package (Partio REQUIRED)
endif ()


#--------------------------------------------------------------------------------------------------
# Include paths.
#--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -358,6 +360,7 @@ if (WITH_PARTIO)
include_directories (${PARTIO_INCLUDE_DIRS})
endif ()


#--------------------------------------------------------------------------------------------------
# Preprocessor definitions.
#--------------------------------------------------------------------------------------------------
Expand Down
26 changes: 13 additions & 13 deletions src/cmake/utilities.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ endmacro ()
function (detect_target_arch output_var)
set (archdetect_c_code
"#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
#error cmake_ARCH ARM
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error cmake_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#error cmake_ARCH x86_64
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
|| defined(_M_MPPC) || defined(_M_PPC)
#error cmake_ARCH PPC
#endif
#error cmake_ARCH unknown"
#error cmake_ARCH ARM
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error cmake_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#error cmake_ARCH x86_64
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
|| defined(_M_MPPC) || defined(_M_PPC)
#error cmake_ARCH PPC
#endif
#error cmake_ARCH unknown"
)

file (WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}")
Expand All @@ -122,10 +122,10 @@ function (detect_target_arch output_var)
"${CMAKE_BINARY_DIR}/arch.c"
COMPILE_OUTPUT_VARIABLE ARCH)

# Parse the architecture name from the compiler output
# Parse the architecture name from the compiler output.
string (REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")

# Get rid of the value marker leaving just the architecture name
# Get rid of the value marker leaving just the architecture name.
string (REPLACE "cmake_ARCH " "" ARCH "${ARCH}")

set (${output_var} "${ARCH}" PARENT_SCOPE)
Expand Down

0 comments on commit 9d70484

Please sign in to comment.