Use platformdefines through lib instead of cpp (dotnet/coreclr#19948)
authorLuqun Lou <luqunl@users.noreply.github.com>
Wed, 26 Sep 2018 16:32:26 +0000 (09:32 -0700)
committerGitHub <noreply@github.com>
Wed, 26 Sep 2018 16:32:26 +0000 (09:32 -0700)
* 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 [new file with mode: 0755]
src/coreclr/tests/src/Interop/CMakeLists.txt
src/coreclr/tests/src/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamNative.cpp
src/coreclr/tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h

diff --git a/src/coreclr/tests/src/Common/Platform/CMakeLists.txt b/src/coreclr/tests/src/Common/Platform/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..4aeab2d
--- /dev/null
@@ -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)
index 76384b488d8e85574a8a1a6584d59289ebebc16e..c4b2c8783025855942a69cbd8340a27af37949a9 100644 (file)
@@ -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
index 975f57ba08aa5c5d5d1cef10a61533d1e73fbc03..72617d182e64f1db291e4b20115c9fbaf6dba50a 100644 (file)
@@ -1,4 +1,4 @@
-#include "platformdefines.cpp"
+#include "platformdefines.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <xplatform.h>
index 33e4ee0f20245e2766bf96d8f14be789a591e453..0f04c847054cdd8c01417bedd8017af637a41f09 100644 (file)
@@ -1,4 +1,4 @@
-#include "platformdefines.cpp"
+#include "platformdefines.h"
 #include <xplatform.h>
 
 inline char* CoStrDup(const char* str)