testsuite: fix unittest cross-language flags

Unit tests may include C++ code, so ensure the compiler flags are
consistent to avoid link errors.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-08-31 05:48:34 -05:00 committed by Anas Nashif
commit 9024669a67
2 changed files with 2 additions and 4 deletions

View file

@ -45,8 +45,10 @@ else()
if(M64_MODE) if(M64_MODE)
set (CMAKE_C_FLAGS "-m64") set (CMAKE_C_FLAGS "-m64")
set (CMAKE_CXX_FLAGS "-m64")
else() else()
set (CMAKE_C_FLAGS "-m32") #deprecated on macOS set (CMAKE_C_FLAGS "-m32") #deprecated on macOS
set (CMAKE_CXX_FLAGS "-m32") #deprecated on macOS
endif(M64_MODE) endif(M64_MODE)
endif() endif()

View file

@ -1,9 +1,5 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Work around apparent inconsistency in C and C++ object machine configuration
string(PREPEND CMAKE_C_FLAGS "-m32 ")
string(PREPEND CMAKE_CXX_FLAGS "-m32 ")
project(util) project(util)
set(SOURCES main.c maincxx.cxx ../../../lib/os/dec.c) set(SOURCES main.c maincxx.cxx ../../../lib/os/dec.c)
find_package(ZephyrUnittest REQUIRED HINTS $ENV{ZEPHYR_BASE}) find_package(ZephyrUnittest REQUIRED HINTS $ENV{ZEPHYR_BASE})