Skip to content

Commit 07b3c49

Browse files
author
Alexander Damian
committed
Changed method to determine bitness
1 parent 107cff7 commit 07b3c49

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ option(CPPKAFKA_BOOST_STATIC_LIBS "Link with Boost static libraries." ON)
3838
option(CPPKAFKA_BOOST_USE_MULTITHREADED "Use Boost multithreaded libraries." ON)
3939
option(CPPKAFKA_RDKAFKA_STATIC_LIB "Link with Rdkafka static library." OFF)
4040

41-
# Determine if this is a 32 or 64 bit build
42-
string(FIND ${CMAKE_CXX_FLAGS} "-m64" BITNESS)
41+
math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}")
4342

4443
# Properly set the output directory
45-
if (${BITNESS} EQUAL -1)
46-
set(LIBDIR "lib")
47-
else()
44+
if (${BITS} EQUAL 64)
4845
set(LIBDIR "lib64")
46+
else()
47+
set(LIBDIR "lib")
4948
endif()
5049

5150
# Disable output from find_package macro

0 commit comments

Comments
 (0)