aboutsummaryrefslogtreecommitdiff
path: root/test cases/cmake
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2020-01-31 10:22:07 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2020-02-04 00:39:04 +0200
commit1f7e73fd5cd7b85d4c7d179c9299e13189b8556d (patch)
tree805500690a680e6cd30bb8463a3867d7f53698d9 /test cases/cmake
parent97dd5224768bbd6003dbad76ee37967b17711ecd (diff)
downloadmeson-1f7e73fd5cd7b85d4c7d179c9299e13189b8556d.zip
meson-1f7e73fd5cd7b85d4c7d179c9299e13189b8556d.tar.gz
meson-1f7e73fd5cd7b85d4c7d179c9299e13189b8556d.tar.bz2
cmake: Sanitize CMake names (fixes #6554)
Diffstat (limited to 'test cases/cmake')
-rw-r--r--test cases/cmake/1 basic/meson.build6
-rw-r--r--test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt4
-rw-r--r--test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp15
3 files changed, 13 insertions, 12 deletions
diff --git a/test cases/cmake/1 basic/meson.build b/test cases/cmake/1 basic/meson.build
index a23063d..8e1671a 100644
--- a/test cases/cmake/1 basic/meson.build
+++ b/test cases/cmake/1 basic/meson.build
@@ -3,10 +3,10 @@ project('cmakeSubTest', ['c', 'cpp'])
cm = import('cmake')
sub_pro = cm.subproject('cmMod')
-sub_dep = sub_pro.dependency('cmModLib')
+sub_dep = sub_pro.dependency('cmModLib++')
-assert(sub_pro.target_list() == ['cmModLib'], 'There should be exactly one target')
-assert(sub_pro.target_type('cmModLib') == 'shared_library', 'Target type should be shared_library')
+assert(sub_pro.target_list() == ['cmModLib++'], 'There should be exactly one target')
+assert(sub_pro.target_type('cmModLib++') == 'shared_library', 'Target type should be shared_library')
exe1 = executable('main', ['main.cpp'], dependencies: [sub_dep])
test('test1', exe1)
diff --git a/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt
index 8b2f7e9..9798209 100644
--- a/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt
+++ b/test cases/cmake/1 basic/subprojects/cmMod/CMakeLists.txt
@@ -7,6 +7,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_definitions("-DDO_NOTHING_JUST_A_FLAG=1")
-add_library(cmModLib SHARED cmMod.cpp)
+add_library(cmModLib++ SHARED cmMod.cpp)
include(GenerateExportHeader)
-generate_export_header(cmModLib)
+generate_export_header(cmModLib++)
diff --git a/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp b/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp
index 52f576b..0e6dc04 100644
--- a/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp
+++ b/test cases/cmake/1 basic/subprojects/cmMod/cmMod.hpp
@@ -1,13 +1,14 @@
#pragma once
+#include "cmmodlib++_export.h"
#include <string>
-#include "cmmodlib_export.h"
-class CMMODLIB_EXPORT cmModClass {
- private:
- std::string str;
- public:
- cmModClass(std::string foo);
+class CMMODLIB___EXPORT cmModClass {
+private:
+ std::string str;
- std::string getStr() const;
+public:
+ cmModClass(std::string foo);
+
+ std::string getStr() const;
};