From 723d0bed0af17d222fd5250e8b94d3168d7c892a Mon Sep 17 00:00:00 2001 From: Luqun Lou Date: Wed, 26 Sep 2018 09:32:26 -0700 Subject: [PATCH] Use platformdefines through lib instead of cpp (dotnet/coreclr#19948) * Use platformdefines through lib instead of cpp * add a dummy export function * Remove dummy export * Compile as Static Library * revert platformdefines.cpp file * remove DLL_EXPORT Commit migrated from https://github.com/dotnet/coreclr/commit/e2a45dce9a853c3eead8aa635317f5615d60bdb6 --- src/coreclr/tests/src/Common/Platform/CMakeLists.txt | 9 +++++++++ src/coreclr/tests/src/Interop/CMakeLists.txt | 4 +++- .../FuncPtrAsDelegateParam/FuncPtrAsDelegateParamNative.cpp | 2 +- .../Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 src/coreclr/tests/src/Common/Platform/CMakeLists.txt diff --git a/src/coreclr/tests/src/Common/Platform/CMakeLists.txt b/src/coreclr/tests/src/Common/Platform/CMakeLists.txt new file mode 100755 index 0000000..4aeab2d --- /dev/null +++ b/src/coreclr/tests/src/Common/Platform/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required (VERSION 2.6) +project (platformdefines) +set(SOURCES platformdefines.cpp) + +# add the executable +add_library(platformdefines STATIC ${SOURCES}) + +# add the install targets +install (TARGETS platformdefines DESTINATION bin) diff --git a/src/coreclr/tests/src/Interop/CMakeLists.txt b/src/coreclr/tests/src/Interop/CMakeLists.txt index 76384b4..c4b2c87 100644 --- a/src/coreclr/tests/src/Interop/CMakeLists.txt +++ b/src/coreclr/tests/src/Interop/CMakeLists.txt @@ -5,6 +5,8 @@ if(WIN32) ) endif(WIN32) +list(APPEND LINK_LIBRARIES_ADDITIONAL platformdefines) + # Consumed by native test assets SET(CLR_INTEROP_TEST_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) @@ -27,13 +29,13 @@ add_subdirectory(StringMarshalling/UTF8) add_subdirectory(MarshalAPI/FunctionPointer) add_subdirectory(MarshalAPI/IUnknown) add_subdirectory(SizeConst) -add_subdirectory(DllImportAttribute/ExeFile) add_subdirectory(DllImportAttribute/FileNameContainDot) add_subdirectory(DllImportAttribute/Simple) if(WIN32) add_subdirectory(COM/NativeServer) add_subdirectory(COM/NativeClients/Primitives) + add_subdirectory(DllImportAttribute/ExeFile) add_subdirectory(IJW/FakeMscoree) # IJW isn't supported on ARM64 diff --git a/src/coreclr/tests/src/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamNative.cpp b/src/coreclr/tests/src/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamNative.cpp index 975f57b..72617d1 100644 --- a/src/coreclr/tests/src/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamNative.cpp +++ b/src/coreclr/tests/src/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamNative.cpp @@ -1,4 +1,4 @@ -#include "platformdefines.cpp" +#include "platformdefines.h" #include #include #include diff --git a/src/coreclr/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h b/src/coreclr/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h index 33e4ee0..0f04c84 100644 --- a/src/coreclr/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h +++ b/src/coreclr/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h @@ -1,4 +1,4 @@ -#include "platformdefines.cpp" +#include "platformdefines.h" #include inline char* CoStrDup(const char* str) -- 2.7.4