diff options
author | Geoff Viola <geoffrey.viola@asirobots.com> | 2016-04-24 13:47:48 -0600 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-04-25 10:46:09 -0400 |
commit | 1703a6d2c46cc7981dd80bd18d7c2e82ec5d9f82 (patch) | |
tree | 5b839beb4d5ca5aeaccccd4c42ea623a629e9470 /Tests/GhsMultiDuplicateSourceFilenames | |
parent | 657a446175c1b61999a77958c5b7480f8be041a5 (diff) | |
download | cmake-1703a6d2c46cc7981dd80bd18d7c2e82ec5d9f82.tar.gz |
GHS: Fix handling of duplicate source filenames (#16046)
Green Hills MULTI project files must specify explicitly distinct object
file names for source files with the same name.
Diffstat (limited to 'Tests/GhsMultiDuplicateSourceFilenames')
4 files changed, 29 insertions, 0 deletions
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt b/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt new file mode 100644 index 0000000000..ffdb5827f5 --- /dev/null +++ b/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.5) +project(demo C) + +add_library(libdemo test.c subfolder/test.c) + +add_executable(demo main.c) +target_link_libraries(demo libdemo) +if(GHSMULTI) + target_compile_options(demo PUBLIC "-non_shared") +endif() diff --git a/Tests/GhsMultiDuplicateSourceFilenames/main.c b/Tests/GhsMultiDuplicateSourceFilenames/main.c new file mode 100644 index 0000000000..2779d684a7 --- /dev/null +++ b/Tests/GhsMultiDuplicateSourceFilenames/main.c @@ -0,0 +1,9 @@ +int test_a(void); +int test_b(void); + +int main(int argc, char *argv[]) +{ + test_a(); + test_b(); + return 0; +} diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c new file mode 100644 index 0000000000..e1372b9c43 --- /dev/null +++ b/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c @@ -0,0 +1,5 @@ + +int test_b() +{ + return 2; +} diff --git a/Tests/GhsMultiDuplicateSourceFilenames/test.c b/Tests/GhsMultiDuplicateSourceFilenames/test.c new file mode 100644 index 0000000000..60286ddd14 --- /dev/null +++ b/Tests/GhsMultiDuplicateSourceFilenames/test.c @@ -0,0 +1,5 @@ + +int test_a() +{ + return 1; +} |