-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: fix missing languages from CMake (fixes #8132)
- Loading branch information
Showing
9 changed files
with
80 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include <cmTest.h> | ||
|
||
int main(void) { | ||
return doStuff(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
project('CMake mix', ['c', 'cpp']) | ||
|
||
if not add_languages('objc', required : false) | ||
error('MESON_SKIP_TEST: No ObjC compiler') | ||
endif | ||
|
||
cm = import('cmake') | ||
|
||
sub_pro = cm.subproject('cmTest') | ||
sub_dep = sub_pro.dependency('cmTest', include_type: 'system') | ||
|
||
exe1 = executable('exe1', ['main.c'], dependencies: [sub_dep]) | ||
test('test1', exe1) |
8 changes: 8 additions & 0 deletions
8
test cases/cmake/24 mixing languages/subprojects/cmTest/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
13 changes: 13 additions & 0 deletions
13
test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
3 changes: 3 additions & 0 deletions
3
test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
|
||
int doStuff(void); |
7 changes: 7 additions & 0 deletions
7
test cases/cmake/24 mixing languages/subprojects/cmTest/cmTest.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#if SOME_MAGIC_DEFINE != 42 | ||
#error "SOME_MAGIC_DEFINE != 42" | ||
#endif | ||
|
||
int foo(int x) { | ||
return 42 - x; | ||
} |