Skip to content

Commit 915ddb1

Browse files
committed
force-fix ne10 build when using system cmake 4
Signed-off-by: falkTX <[email protected]>
1 parent 19a91c5 commit 915ddb1

File tree

6 files changed

+161
-0
lines changed

6 files changed

+161
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Cody Guldner <[email protected]>
3+
Date: Tue, 14 Apr 2020 09:12:01 -0500
4+
Subject: [PATCH] CMakeLists: don't hard code thumb code generation
5+
6+
Migrating to version 1.2.1
7+
8+
Signed-off-by: Baruch Siach <[email protected]>
9+
Signed-off-by: Clayton Shotwell <[email protected]>
10+
Signed-off-by: Cody Guldner <[email protected]>
11+
---
12+
CMakeLists.txt | 2 +-
13+
1 file changed, 1 insertion(+), 1 deletion(-)
14+
15+
diff --git a/CMakeLists.txt b/CMakeLists.txt
16+
index fc2a5e3..25da215 100644
17+
--- a/CMakeLists.txt
18+
+++ b/CMakeLists.txt
19+
@@ -135,7 +135,7 @@ if(ANDROID_PLATFORM)
20+
${CMAKE_C_FLAGS}")
21+
elseif(GNULINUX_PLATFORM)
22+
if(${NE10_TARGET_ARCH} STREQUAL "armv7")
23+
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations")
24+
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations")
25+
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=neon")
26+
# Turn on asm optimization for Linux on ARM v7.
27+
set(NE10_ASM_OPTIMIZATION on)
28+
--
29+
2.23.0
30+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
From f19b109f2a879af7b0753d94a2a312e4039adbed Mon Sep 17 00:00:00 2001
2+
From: Fabrice Fontaine <[email protected]>
3+
Date: Sun, 8 May 2022 23:52:36 +0200
4+
Subject: [PATCH] fix build without C++
5+
6+
Fix the following build failure without C++ raised since version 1.2.0
7+
and
8+
https://github.com/projectNe10/Ne10/commit/20b1896fd6532336e6a46608778bd6e0396dc4dc:
9+
10+
CMake Error at /nvmedata/autobuild/instance-11/output-1/host/share/cmake-3.18/Modules/CMakeTestCXXCompiler.cmake:59 (message):
11+
The C++ compiler
12+
13+
"/usr/bin/clang++"
14+
15+
is not able to compile a simple test program.
16+
17+
Fixes:
18+
- http://autobuild.buildroot.org/results/a86d09d569babe6b88cb8e5fbb47483772f42aed
19+
20+
Signed-off-by: Fabrice Fontaine <[email protected]>
21+
[Upstream status: https://github.com/projectNe10/Ne10/pull/280]
22+
---
23+
CMakeLists.txt | 2 +-
24+
modules/CMakeLists.txt | 2 ++
25+
2 files changed, 3 insertions(+), 1 deletion(-)
26+
27+
diff --git a/CMakeLists.txt b/CMakeLists.txt
28+
index 40e1b72..10081f8 100644
29+
--- a/CMakeLists.txt
30+
+++ b/CMakeLists.txt
31+
@@ -26,7 +26,7 @@
32+
#
33+
cmake_minimum_required(VERSION 2.6)
34+
35+
-project(NE10 C CXX ASM)
36+
+project(NE10 C ASM)
37+
38+
option(NE10_BUILD_SHARED "Build NE10 shared libraries" OFF)
39+
option(NE10_BUILD_STATIC "Build NE10 static libraries" ON)
40+
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
41+
index 4f158e9..951527a 100644
42+
--- a/modules/CMakeLists.txt
43+
+++ b/modules/CMakeLists.txt
44+
@@ -173,6 +173,8 @@ endif(IOS_PLATFORM)
45+
endif()
46+
47+
if(NE10_ENABLE_DSP)
48+
+ enable_language(CXX)
49+
+
50+
#enable NE10_init_dsp
51+
add_definitions(-DNE10_ENABLE_DSP)
52+
53+
--
54+
2.35.1
55+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
config BR2_PACKAGE_NE10_ARCH_SUPPORTS
2+
bool
3+
default y if BR2_aarch64
4+
default y if BR2_arm && (BR2_ARM_FPU_NEON || BR2_ARM_FPU_NEON_VFPV4)
5+
6+
config BR2_PACKAGE_NE10
7+
bool "ne10"
8+
depends on BR2_PACKAGE_NE10_ARCH_SUPPORTS
9+
help
10+
The Ne10 project has been set up to provide a set of common,
11+
useful functions which have been heavily optimized for the
12+
ARM and AArch64 Architecture and provide consistent well
13+
tested behavior that can be easily incorporated into
14+
applications. C interfaces to the functions are provided for
15+
both assembler and NEON implementations.
16+
17+
http://projectne10.github.io/Ne10/
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This custom package exists for forcing/fixing compatibility with cmake4.
2+
We do this by adding `-DCMAKE_POLICY_VERSION_MINIMUM=3.5` to the cmake args.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Locally calculated
2+
sha256 dd1a96610c0692cc80154ae123edd5d25e6e0a3f81d0c16a96425f3ef57b9929 ne10-1.2.1.tar.gz
3+
sha256 eb48041c8e0ad556cf72f2a6eff89c893aa5702bba4e163ca7798cce07e6c55e doc/LICENSE
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
################################################################################
2+
#
3+
# ne10
4+
#
5+
################################################################################
6+
7+
NE10_VERSION = 1.2.1
8+
NE10_SITE = $(call github,projectNe10,Ne10,v$(NE10_VERSION))
9+
NE10_LICENSE = BSD-3-Clause or Apache-2.0
10+
NE10_LICENSE_FILES = doc/LICENSE
11+
NE10_INSTALL_STAGING = YES
12+
13+
NE10_CONF_OPTS = \
14+
-DGNULINUX_PLATFORM=ON \
15+
-DNE10_BUILD_EXAMPLES=OFF \
16+
-DNE10_BUILD_UNIT_TEST=OFF \
17+
-DNE10_LINUX_TARGET_ARCH=$(if $(BR2_aarch64),aarch64,armv7)
18+
19+
ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
20+
NE10_CONF_OPTS += -DNE10_ENABLE_DSP=ON
21+
else
22+
NE10_CONF_OPTS += -DNE10_ENABLE_DSP=OFF
23+
endif
24+
25+
ifeq ($(BR2_STATIC_LIBS),)
26+
NE10_CONF_OPTS += \
27+
-DNE10_BUILD_SHARED=ON
28+
endif
29+
30+
# Force compabitility with cmake 4
31+
NE10_CONF_OPTS += -DCMAKE_POLICY_VERSION_MINIMUM=3.5
32+
33+
# The package does not have any install target, so have to provide
34+
# INSTALL_STAGING_CMDS and INSTALL_TARGET_CMDS.
35+
36+
ifeq ($(BR2_STATIC_LIBS),)
37+
define NE10_INSTALL_STAGING_SHARED_LIB
38+
cp -dpf $(@D)/modules/libNE10*.so* $(STAGING_DIR)/usr/lib/
39+
endef
40+
endif
41+
42+
define NE10_INSTALL_STAGING_CMDS
43+
cp -dpf $(@D)/inc/NE10*h $(STAGING_DIR)/usr/include/
44+
cp -dpf $(@D)/modules/libNE10.a $(STAGING_DIR)/usr/lib/
45+
$(NE10_INSTALL_STAGING_SHARED_LIB)
46+
endef
47+
48+
ifeq ($(BR2_STATIC_LIBS),)
49+
define NE10_INSTALL_TARGET_CMDS
50+
cp -dpf $(@D)/modules/libNE10*.so* $(TARGET_DIR)/usr/lib/
51+
endef
52+
endif
53+
54+
$(eval $(cmake-package))

0 commit comments

Comments
 (0)