Skip to content

Commit

Permalink
Merge pull request #181 from xmos/develop
Browse files Browse the repository at this point in the history
Merge to main for release v1.3.0
  • Loading branch information
danielpieczko authored Jul 31, 2024
2 parents 9ea987e + 1cf95c3 commit 192f75a
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
XCommon CMake Change Log
========================

1.3.0
-----

* ADDED: DEPS_CLONE_SHALLOW option for performing shallow git clones

1.2.1
-----

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pipeline {
)
string(
name: 'XMOSDOC_VERSION',
defaultValue: 'v5.5.1',
defaultValue: 'v5.5.2',
description: 'The xmosdoc version'
)
}
Expand Down
1 change: 1 addition & 0 deletions doc/api_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ API Reference

./functions
./variables
./options
./dependency_format
33 changes: 33 additions & 0 deletions doc/api_reference/options.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. _cmdline-options:

Command-line Options
--------------------

Extra functionality can be activated using command-line options which are implemented in XCommon
CMake. These are passed to the CMake command via its ``-D`` option, and multiple options can be
provided to a single CMake command if required:

.. code-block:: console
cmake -G "Unix Makefiles" -B build -D <option0>=<value0> -D <option1>=<value1>
Supported options
^^^^^^^^^^^^^^^^^

``BUILD_NATIVE``
Boolean option to configure the build for the native host CPU rather than an xcore target. See
:ref:`native-builds` for more details about this feature. Example:

.. code-block:: console
cmake -G "Unix Makefiles" -B build -D BUILD_NATIVE=ON
``DEPS_CLONE_SHALLOW``
Boolean option to perform a shallow clone of all missing dependencies. The git repository for
each dependency will be cloned as a single commit, rather than the complete history. This can
reduce the disk usage, but if the full git history is later required, it will need to be
fetched manually. Example:

.. code-block:: console
cmake -G "Unix Makefiles" -B build -D DEPS_CLONE_SHALLOW=TRUE
2 changes: 1 addition & 1 deletion settings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: XCommon CMake
project: xcommon_cmake
version: 1.2.1
version: 1.3.0
documentation:
exclude_patterns_path: doc/exclude_patterns.inc
cognidox_part_number: XM-015090-PC
Expand Down
4 changes: 3 additions & 1 deletion xcommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ cmake_minimum_required(VERSION 3.21)

include_guard(GLOBAL)

set(XCOMMON_CMAKE_VER 1.2.1 CACHE INTERNAL "Version of XCommon CMake")
set(XCOMMON_CMAKE_VER 1.3.0 CACHE INTERNAL "Version of XCommon CMake")

macro(print_xcommon_cmake_version)
message(VERBOSE "XCommon CMake version v${XCOMMON_CMAKE_VER}")
endmacro()

option(BUILD_NATIVE "Build applications/libraries for the native CPU instead of the xcore architecture")
option(DEPS_CLONE_SHALLOW "Perform a shallow git clone (--depth=1) for all dependencies")

# Set up compiler
if(NOT BUILD_NATIVE AND NOT DEFINED ${CMAKE_TOOLCHAIN_FILE})
Expand Down Expand Up @@ -815,6 +816,7 @@ function(XMOS_REGISTER_DEPS DEPS_LIST)
GIT_REPOSITORY ${DEP_REPO}
GIT_TAG ${DEP_VERSION}
SOURCE_DIR ${dep_dir}
GIT_SHALLOW ${DEPS_CLONE_SHALLOW}
)
FetchContent_Populate(${DEP_NAME})
endif()
Expand Down

0 comments on commit 192f75a

Please sign in to comment.