Skip to content

Commit e2c875a

Browse files
authored
Fix building integration tests against packaged SDK on Linux x86 (#940)
* Fix x86 Linux build directory for Linux hosts * Make cmake CPU check more accurate
1 parent 817de86 commit e2c875a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

release_build_files/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ elseif(MSVC)
4646
set(MSVC_VS_VERSION VS2019)
4747
set(FIREBASE_SDK_LIBDIR
4848
${FIREBASE_CPP_SDK_DIR}/libs/windows/${MSVC_VS_VERSION}/${MSVC_RUNTIME_MODE}/${MSVC_CPU}/${MSVC_CONFIG})
49-
else()
49+
else() # LINUX
5050
# Check whether we are building with CXX11 ABI.
5151
get_directory_property(CURR_DIRECTORY_DEFS COMPILE_DEFINITIONS)
5252
if ("${CURR_DIRECTORY_DEFS}" MATCHES "_GLIBCXX_USE_CXX11_ABI=0" OR
@@ -56,8 +56,13 @@ else()
5656
else()
5757
set(DISABLE_CXX11 FALSE)
5858
set(LINUX_ABI cxx11)
59-
endif()
60-
set(LINUX_CPU x86_64)
59+
endif()
60+
# Check if we are building for x86
61+
if (" ${CMAKE_CXX_FLAGS} " MATCHES " -m32 ")
62+
set(LINUX_CPU i386)
63+
else()
64+
set(LINUX_CPU x86_64)
65+
endif()
6166
set(FIREBASE_SDK_LIBDIR ${FIREBASE_CPP_SDK_DIR}/libs/linux/${LINUX_CPU}/${LINUX_ABI})
6267
endif()
6368

0 commit comments

Comments
 (0)