From 84c7261036bb1ce705231f8d602b9981584b035e Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Wed, 25 Sep 2019 11:31:39 +0200 Subject: [PATCH] CMSIS-DSP: Simplification to cmake to build without test framework. --- Include/arm_math.h | 14 +++++++----- Source/BasicMathFunctions/CMakeLists.txt | 2 +- Source/BayesFunctions/CMakeLists.txt | 2 +- Source/CMakeLists.txt | 2 +- Source/CommonTables/CMakeLists.txt | 2 +- Source/ComplexMathFunctions/CMakeLists.txt | 2 +- Source/ControllerFunctions/CMakeLists.txt | 2 +- Source/DistanceFunctions/CMakeLists.txt | 2 +- Source/FastMathFunctions/CMakeLists.txt | 2 +- Source/FilteringFunctions/CMakeLists.txt | 2 +- Source/MatrixFunctions/CMakeLists.txt | 2 +- Source/SVMFunctions/CMakeLists.txt | 2 +- Source/StatisticsFunctions/CMakeLists.txt | 2 +- Source/SupportFunctions/CMakeLists.txt | 2 +- Source/TransformFunctions/CMakeLists.txt | 2 +- fft.cmake => Source/fft.cmake | 0 interpol.cmake => Source/interpol.cmake | 0 config.cmake | 11 ++------- configBoot.cmake | 8 ------- configLib.cmake | 26 ++++++++++++++++++++++ 20 files changed, 50 insertions(+), 37 deletions(-) rename fft.cmake => Source/fft.cmake (100%) rename interpol.cmake => Source/interpol.cmake (100%) create mode 100755 configLib.cmake diff --git a/Include/arm_math.h b/Include/arm_math.h index 40acfe52..3bd491c9 100644 --- a/Include/arm_math.h +++ b/Include/arm_math.h @@ -360,12 +360,14 @@ extern "C" #if defined (_MSC_VER ) #include #define __STATIC_FORCEINLINE static __forceinline +#define __STATIC_INLINE static __inline #define __ALIGNED(x) __declspec(align(x)) #elif defined (__GNUC_PYTHON__) #include #define __ALIGNED(x) __attribute__((aligned(x))) #define __STATIC_FORCEINLINE static __attribute__((inline)) +#define __STATIC_INLINE static __attribute__((inline)) #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wattributes" @@ -7976,11 +7978,6 @@ float32_t arm_yule_distance(const uint32_t *pA, const uint32_t *pB, uint32_t num #if defined ( __ARM_ARCH_7EM__ ) #define LOW_OPTIMIZATION_ENTER \ _Pragma ("optimize=low") -#elif defined ( _MSC_VER) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT #else #define LOW_OPTIMIZATION_ENTER #endif @@ -8016,7 +8013,12 @@ float32_t arm_yule_distance(const uint32_t *pA, const uint32_t *pB, uint32_t num #define LOW_OPTIMIZATION_EXIT #define IAR_ONLY_LOW_OPTIMIZATION_ENTER #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - + +#elif defined ( _MSC_VER ) || (__GNUC_PYTHON__) + #define LOW_OPTIMIZATION_ENTER + #define LOW_OPTIMIZATION_EXIT + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER + #define IAR_ONLY_LOW_OPTIMIZATION_EXIT #endif diff --git a/Source/BasicMathFunctions/CMakeLists.txt b/Source/BasicMathFunctions/CMakeLists.txt index 890b5021..ee3e215b 100644 --- a/Source/BasicMathFunctions/CMakeLists.txt +++ b/Source/BasicMathFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPBasicMath) -include(config) +include(configLib) include(configDsp) file(GLOB SRC "./*_*.c") diff --git a/Source/BayesFunctions/CMakeLists.txt b/Source/BayesFunctions/CMakeLists.txt index 1ac4f973..5f5ee4a2 100755 --- a/Source/BayesFunctions/CMakeLists.txt +++ b/Source/BayesFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPBayes) -include(config) +include(configLib) include(configDsp) file(GLOB SRC "./*_*.c") diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 8248c21a..b1a13793 100755 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -9,7 +9,7 @@ list(APPEND CMAKE_MODULE_PATH ${DSP}/Source) list(APPEND CMAKE_MODULE_PATH ${DSP}) -include(config) +include(configLib) option(NEON "Neon acceleration" OFF) diff --git a/Source/CommonTables/CMakeLists.txt b/Source/CommonTables/CMakeLists.txt index e11ca6e4..30bb5fe9 100644 --- a/Source/CommonTables/CMakeLists.txt +++ b/Source/CommonTables/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPCommon) -include(config) +include(configLib) include(configDsp) add_library(CMSISDSPCommon STATIC arm_common_tables.c) diff --git a/Source/ComplexMathFunctions/CMakeLists.txt b/Source/ComplexMathFunctions/CMakeLists.txt index c3bf93d2..fbf40c76 100644 --- a/Source/ComplexMathFunctions/CMakeLists.txt +++ b/Source/ComplexMathFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPComplexMath) -include(config) +include(configLib) include(configDsp) file(GLOB SRC "./*_*.c") diff --git a/Source/ControllerFunctions/CMakeLists.txt b/Source/ControllerFunctions/CMakeLists.txt index 1addc4be..da41e429 100644 --- a/Source/ControllerFunctions/CMakeLists.txt +++ b/Source/ControllerFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPController) -include(config) +include(configLib) include(configDsp) add_library(CMSISDSPController STATIC) diff --git a/Source/DistanceFunctions/CMakeLists.txt b/Source/DistanceFunctions/CMakeLists.txt index 3d54c1ab..63da550c 100755 --- a/Source/DistanceFunctions/CMakeLists.txt +++ b/Source/DistanceFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPDistance) -include(config) +include(configLib) include(configDsp) file(GLOB SRC "./*_*.c") diff --git a/Source/FastMathFunctions/CMakeLists.txt b/Source/FastMathFunctions/CMakeLists.txt index f5f181bc..dc42a17e 100644 --- a/Source/FastMathFunctions/CMakeLists.txt +++ b/Source/FastMathFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPFastMath) -include(config) +include(configLib) include(configDsp) file(GLOB SRC "./*_*.c") diff --git a/Source/FilteringFunctions/CMakeLists.txt b/Source/FilteringFunctions/CMakeLists.txt index b351602d..d5d0acbf 100644 --- a/Source/FilteringFunctions/CMakeLists.txt +++ b/Source/FilteringFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPFiltering) -include(config) +include(configLib) include(configDsp) add_library(CMSISDSPFiltering STATIC) diff --git a/Source/MatrixFunctions/CMakeLists.txt b/Source/MatrixFunctions/CMakeLists.txt index 5a5b32be..e8838b23 100644 --- a/Source/MatrixFunctions/CMakeLists.txt +++ b/Source/MatrixFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPMatrix) -include(config) +include(configLib) include(configDsp) file(GLOB SRC "./*_*.c") diff --git a/Source/SVMFunctions/CMakeLists.txt b/Source/SVMFunctions/CMakeLists.txt index 5d779dce..2a547386 100755 --- a/Source/SVMFunctions/CMakeLists.txt +++ b/Source/SVMFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPSVM) -include(config) +include(configLib) include(configDsp) file(GLOB SRC "./*_*.c") diff --git a/Source/StatisticsFunctions/CMakeLists.txt b/Source/StatisticsFunctions/CMakeLists.txt index b8723ce4..20b9f8aa 100644 --- a/Source/StatisticsFunctions/CMakeLists.txt +++ b/Source/StatisticsFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPStatistics) -include(config) +include(configLib) include(configDsp) file(GLOB SRC "./*_*.c") diff --git a/Source/SupportFunctions/CMakeLists.txt b/Source/SupportFunctions/CMakeLists.txt index 61db36e2..0379721d 100644 --- a/Source/SupportFunctions/CMakeLists.txt +++ b/Source/SupportFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPSupport) -include(config) +include(configLib) include(configDsp) file(GLOB SRC "./*_*.c") diff --git a/Source/TransformFunctions/CMakeLists.txt b/Source/TransformFunctions/CMakeLists.txt index 873453b0..47efca45 100644 --- a/Source/TransformFunctions/CMakeLists.txt +++ b/Source/TransformFunctions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.6) project(CMSISDSPTransform) -include(config) +include(configLib) include(configDsp) add_library(CMSISDSPTransform STATIC) diff --git a/fft.cmake b/Source/fft.cmake similarity index 100% rename from fft.cmake rename to Source/fft.cmake diff --git a/interpol.cmake b/Source/interpol.cmake similarity index 100% rename from interpol.cmake rename to Source/interpol.cmake diff --git a/config.cmake b/config.cmake index 4a6c2a5a..ebe23029 100755 --- a/config.cmake +++ b/config.cmake @@ -3,12 +3,11 @@ list(APPEND CMAKE_MODULE_PATH ${EXPROOT}) include(experimental) endif() -include(Toolchain/Tools) + +include(configLib) SET(PLATFORMFOLDER ${ROOT}/CMSIS/DSP/Platforms/FVP) -option(OPTIMIZED "Compile for speed" ON) include(configPlatform) include(configBoot) -include(configCore) define_property(TARGET PROPERTY DISABLEOPTIMIZATION @@ -23,12 +22,6 @@ function(disableOptimization project) endfunction() -function(configLib project cmsisRoot) - configcore(${project} ${cmsisRoot}) - configplatformForLib(${project} ${cmsisRoot}) - SET(COREID ${COREID} PARENT_SCOPE) -endfunction() - # Config app function (configApp project cmsisRoot) configcore(${project} ${cmsisRoot}) diff --git a/configBoot.cmake b/configBoot.cmake index fc8bc9cc..ef818300 100755 --- a/configBoot.cmake +++ b/configBoot.cmake @@ -1,13 +1,5 @@ include(CMakePrintHelpers) -enable_language(CXX C ASM) - - -# Otherwise there is a .obj on windows and it creates problems -# with armlink. -SET(CMAKE_C_OUTPUT_EXTENSION .o) -SET(CMAKE_CXX_OUTPUT_EXTENSION .o) -SET(CMAKE_ASM_OUTPUT_EXTENSION .o) get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) diff --git a/configLib.cmake b/configLib.cmake new file mode 100755 index 00000000..ab35b353 --- /dev/null +++ b/configLib.cmake @@ -0,0 +1,26 @@ +# This is for building a library only +# It is similar to the config.cmake but ignoring anything related to the platform +# and boot code + + +include(Toolchain/Tools) +option(OPTIMIZED "Compile for speed" ON) + +enable_language(CXX C ASM) + + +# Otherwise there is a .obj on windows and it creates problems +# with armlink. +SET(CMAKE_C_OUTPUT_EXTENSION .o) +SET(CMAKE_CXX_OUTPUT_EXTENSION .o) +SET(CMAKE_ASM_OUTPUT_EXTENSION .o) + +include(configCore) + + +function(configLib project cmsisRoot) + configcore(${project} ${cmsisRoot}) + #configplatformForLib(${project} ${cmsisRoot}) + SET(COREID ${COREID} PARENT_SCOPE) +endfunction() +