Use platformdefines through lib instead of cpp (#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

tests/src/Common/Platform/CMakeLists.txt [new file with mode: 0755]
tests/src/Interop/CMakeLists.txt
tests/src/Interop/FuncPtrAsDelegateParam/FuncPtrAsDelegateParamNative.cpp
tests/src/Interop/StructMarshalling/PInvoke/MarshalStructAsParamDLL.h

diff --git a/tests/src/Common/Platform/CMakeLists.txt b/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 76384b4..c4b2c87 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