Ciccio Pasticcio
2018-11-26 08:36:09 UTC
Hi all,
I'm refactoring some libraries cmake files to be compliant to the use of
targets instead of tons of variables. Since these libraries are
cross-compiled I'm facing some problem finding how to properly set some
specific flags like: -march -marm -mfloat-abi etc. For now I set the
CMAKE_CXX_FLAGS:
set(CMAKE_CXX_FLAGS -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard
-mfpu=neon -mtune=cortex-a8 -Wno-psabi)
Is this the only way to do this? With targets I do something like this:
add_library(MyLib)
# add sources
...
# Comiler features
TARGET_COMPILE_FEATURES(MyLib PUBLIC cxx_lambdas)
Thanks,
Gabriele
I'm refactoring some libraries cmake files to be compliant to the use of
targets instead of tons of variables. Since these libraries are
cross-compiled I'm facing some problem finding how to properly set some
specific flags like: -march -marm -mfloat-abi etc. For now I set the
CMAKE_CXX_FLAGS:
set(CMAKE_CXX_FLAGS -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard
-mfpu=neon -mtune=cortex-a8 -Wno-psabi)
Is this the only way to do this? With targets I do something like this:
add_library(MyLib)
# add sources
...
# Comiler features
TARGET_COMPILE_FEATURES(MyLib PUBLIC cxx_lambdas)
Thanks,
Gabriele