You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anchao (via GitHub)" <gi...@apache.org> on 2023/07/07 05:52:32 UTC

[GitHub] [nuttx] anchao commented on a diff in pull request #6718: add CMake build system support (Enhance #3704)

anchao commented on code in PR #6718:
URL: https://github.com/apache/nuttx/pull/6718#discussion_r1255276269


##########
CMakeLists.txt:
##########
@@ -0,0 +1,656 @@
+# ##############################################################################
+# CMakeLists.txt
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements.  See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership.  The ASF licenses this
+# file to you 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.
+#
+# ##############################################################################
+
+# Request a version available on latest Ubuntu LTS (20.04)
+
+cmake_minimum_required(VERSION 3.16)
+
+# Handle newer CMake versions correctly by setting policies
+
+if(POLICY CMP0115)
+  # do not auto-guess extension in target_sources()
+  cmake_policy(SET CMP0115 NEW)
+endif()
+
+# Basic CMake configuration ##################################################
+
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_EXTENSIONS OFF)
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+# Setup build type (Debug Release RelWithDebInfo MinSizeRel Coverage). Default
+# to minimum size release
+
+# Use nuttx optimization configuration options, workaround for cmake build type
+# TODO Integration the build type with CMAKE
+
+# if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "MinSizeRel" CACHE STRING
+# "Build type" FORCE) endif() set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
+# STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel")
+
+# Process board config & directory locations #################################
+
+set(NUTTX_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(NUTTX_APPS_DIR "${NUTTX_DIR}/../apps")

Review Comment:
   @midokura-xavi92 
   
   Thanks for your suggestion, I added the following support for similar issues:
   
   1. Support build nuttx kernel alone if there is no apps/nuttx-apps/CONFIG_APPS_DIR directories
   2. Support default application path named ../apps or ../nuttx-apps to keep the compatibility
   3. Support specifying CONFIG_APPS_DIR in kconfig



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org