Nuttx build support.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Copyright 2015 Samsung Electronics Co., Ltd.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
include(CMakeForceCompiler)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME NUTTX)
|
||||
|
||||
CMAKE_FORCE_C_COMPILER(${EXTERNAL_CMAKE_C_COMPILER} GNU)
|
||||
CMAKE_FORCE_CXX_COMPILER(${EXTERNAL_CMAKE_CXX_COMPILER} GNU)
|
||||
@@ -38,19 +38,28 @@
|
||||
set(CPPCHECK_INCLUDES_LIST ${CPPCHECK_INCLUDES_LIST} -I${INCLUDE})
|
||||
endforeach()
|
||||
|
||||
set(ADD_CPPCHECK_COMMAND FALSE)
|
||||
|
||||
foreach(SOURCE ${TARGET_SOURCES})
|
||||
# Add to list if it is C or C++ source
|
||||
get_filename_component(SOURCE_EXTENSION ${SOURCE} EXT)
|
||||
if("${SOURCE_EXTENSION}" STREQUAL ".c" OR "${SOURCE_EXTENSION}" STREQUAL ".cpp")
|
||||
set(CPPCHECK_SOURCES_LIST ${CPPCHECK_SOURCES_LIST} ${SOURCE})
|
||||
|
||||
set(ADD_CPPCHECK_COMMAND true)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_custom_target(cppcheck.${TARGET_NAME}
|
||||
COMMAND ${CMAKE_CPPCHECK} -j8 --error-exitcode=1 --language=c++ --std=c++11
|
||||
--enable=warning,style,performance,portability,information
|
||||
${CPPCHECK_DEFINES_LIST} ${CPPCHECK_SOURCES_LIST} ${CPPCHECK_INCLUDES_LIST}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
if(ADD_CPPCHECK_COMMAND)
|
||||
add_custom_target(cppcheck.${TARGET_NAME}
|
||||
COMMAND ${CMAKE_CPPCHECK} -j8 --error-exitcode=1 --language=c++ --std=c++11
|
||||
--enable=warning,style,performance,portability,information
|
||||
${CPPCHECK_DEFINES_LIST} ${CPPCHECK_SOURCES_LIST} ${CPPCHECK_INCLUDES_LIST}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
else()
|
||||
add_custom_target(cppcheck.${TARGET_NAME})
|
||||
endif()
|
||||
|
||||
if(NOT "${TARGET_LIBRARIES}" STREQUAL "TARGET_LIBRARIES-NOTFOUND")
|
||||
foreach(LIBRARY ${TARGET_LIBRARIES})
|
||||
string(REGEX MATCH "^${PREFIX_IMPORTED_LIB}.*|.*${SUFFIX_THIRD_PARTY_LIB}$" MATCHED ${LIBRARY})
|
||||
|
||||
Reference in New Issue
Block a user