summaryrefslogtreecommitdiffstats
path: root/test cases/cmake/24 mixing languages/subprojects
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:41:38 +0000
commit7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch)
tree4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/cmake/24 mixing languages/subprojects
parentInitial commit. (diff)
downloadmeson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.tar.xz
meson-7b6e527f440cd7e6f8be2b07cee320ee6ca18786.zip
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/cmake/24 mixing languages/subprojects')
-rw-r--r--test cases/cmake/24 mixing languages/subprojects/cmTest/CMakeLists.txt8
-rw-r--r--test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.c13
-rw-r--r--test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.h3
-rw-r--r--test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.m7
4 files changed, 31 insertions, 0 deletions
diff --git a/test cases/cmake/24 mixing languages/subprojects/cmTest/CMakeLists.txt b/test cases/cmake/24 mixing languages/subprojects/cmTest/CMakeLists.txt
new file mode 100644
index 0000000..80a256f
--- /dev/null
+++ b/test cases/cmake/24 mixing languages/subprojects/cmTest/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.5)
+
+project(cmTest)
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+add_library(cmTest STATIC cmTest.c cmTest.m)
+target_compile_definitions(cmTest PUBLIC SOME_MAGIC_DEFINE=42)
diff --git a/test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.c b/test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.c
new file mode 100644
index 0000000..066d676
--- /dev/null
+++ b/test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.c
@@ -0,0 +1,13 @@
+#include "cmTest.h"
+#include <stdio.h>
+
+#if SOME_MAGIC_DEFINE != 42
+#error "SOME_MAGIC_DEFINE != 42"
+#endif
+
+int foo(int x);
+
+int doStuff(void) {
+ printf("Hello World\n");
+ return foo(42);
+}
diff --git a/test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.h b/test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.h
new file mode 100644
index 0000000..a6a5c24
--- /dev/null
+++ b/test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.h
@@ -0,0 +1,3 @@
+#pragma once
+
+int doStuff(void);
diff --git a/test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.m b/test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.m
new file mode 100644
index 0000000..16ec805
--- /dev/null
+++ b/test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.m
@@ -0,0 +1,7 @@
+#if SOME_MAGIC_DEFINE != 42
+#error "SOME_MAGIC_DEFINE != 42"
+#endif
+
+int foo(int x) {
+ return 42 - x;
+}