summaryrefslogtreecommitdiffstats
path: root/package/mraa/0002-CMakeLists.txt-do-not-require-a-CXX-compiler.patch
blob: a01395b62dca4e4505a4605f9943b652e41f27eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Upstream status: Merged
Fetched from: https://github.com/intel-iot-devkit/mraa/commit/a87a104efeb83d4e762992e5be3b8908e6d2bf40

From a87a104efeb83d4e762992e5be3b8908e6d2bf40 Mon Sep 17 00:00:00 2001
From: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Date: Tue, 5 Jan 2016 19:36:55 +0100
Subject: [PATCH] CMakeLists.txt: do not require a C++ compiler

By default, CMake assumes both a C and C++ compiler are required.
This is not needed for mraa because it only provides C++ header
files. Note that if using SWIG you need one and if using node.js 3+ you'll need
a C++11 compiler

Signed-off-by: Pieterjan Camerlynck <pieterjan.camerlynck@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
---
 CMakeLists.txt              | 2 +-
 examples/c++/CMakeLists.txt | 2 ++
 src/CMakeLists.txt          | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a189b9..4457efc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required (VERSION 2.8)
-project (mraa)
+project (mraa C)
 
 FIND_PACKAGE (Threads REQUIRED)
 
diff --git a/examples/c++/CMakeLists.txt b/examples/c++/CMakeLists.txt
index 69714aa..d688d48 100644
--- a/examples/c++/CMakeLists.txt
+++ b/examples/c++/CMakeLists.txt
@@ -1,3 +1,5 @@
+enable_language(CXX)
+
 add_executable (AioA0 AioA0.cpp)
 add_executable (blink-io-cpp Blink-IO.cpp)
 add_executable (Pwm3-cycle Pwm3-cycle.cpp)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6698fa4..05b546c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -171,6 +171,7 @@ if (DOXYGEN_FOUND)
 endif ()
 
 if (BUILDSWIG)
+  enable_language(CXX)
   find_package (SWIG)
   if (SWIG_FOUND)
     include (${SWIG_USE_FILE})
-- 
1.9.1

OpenPOWER on IntegriCloud