summaryrefslogtreecommitdiff
path: root/Tests/Jump
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Jump')
-rw-r--r--Tests/Jump/CMakeLists.txt6
-rw-r--r--Tests/Jump/Executable/CMakeLists.txt6
-rw-r--r--Tests/Jump/Executable/jumpExecutable.cxx12
-rw-r--r--Tests/Jump/Library/CMakeLists.txt2
-rw-r--r--Tests/Jump/Library/Shared/CMakeLists.txt26
-rw-r--r--Tests/Jump/Library/Shared/jumpShared.cxx7
-rw-r--r--Tests/Jump/Library/Static/CMakeLists.txt1
-rw-r--r--Tests/Jump/Library/Static/jumpStatic.cxx1
8 files changed, 61 insertions, 0 deletions
diff --git a/Tests/Jump/CMakeLists.txt b/Tests/Jump/CMakeLists.txt
new file mode 100644
index 000000000..4bdafd09b
--- /dev/null
+++ b/Tests/Jump/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required (VERSION 2.6)
+PROJECT(Jump)
+
+SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
+ADD_SUBDIRECTORY(Executable)
+ADD_SUBDIRECTORY(Library)
diff --git a/Tests/Jump/Executable/CMakeLists.txt b/Tests/Jump/Executable/CMakeLists.txt
new file mode 100644
index 000000000..7658b7e31
--- /dev/null
+++ b/Tests/Jump/Executable/CMakeLists.txt
@@ -0,0 +1,6 @@
+IF(NOT LIBRARY_OUTPUT_PATH)
+ LINK_DIRECTORIES(${Jump_BINARY_DIR}/Library/Static
+ ${Jump_BINARY_DIR}/Library/Shared)
+ENDIF(NOT LIBRARY_OUTPUT_PATH)
+ADD_EXECUTABLE(jumpExecutable jumpExecutable.cxx)
+TARGET_LINK_LIBRARIES(jumpExecutable jumpStatic jumpShared)
diff --git a/Tests/Jump/Executable/jumpExecutable.cxx b/Tests/Jump/Executable/jumpExecutable.cxx
new file mode 100644
index 000000000..7a050c702
--- /dev/null
+++ b/Tests/Jump/Executable/jumpExecutable.cxx
@@ -0,0 +1,12 @@
+#ifdef _WIN32
+# define JUMP_IMPORT __declspec(dllimport)
+#else
+# define JUMP_IMPORT extern
+#endif
+
+extern int jumpStatic();
+JUMP_IMPORT int jumpShared();
+int main()
+{
+ return jumpShared() && jumpShared();
+}
diff --git a/Tests/Jump/Library/CMakeLists.txt b/Tests/Jump/Library/CMakeLists.txt
new file mode 100644
index 000000000..2f78c501c
--- /dev/null
+++ b/Tests/Jump/Library/CMakeLists.txt
@@ -0,0 +1,2 @@
+ADD_SUBDIRECTORY(Static)
+ADD_SUBDIRECTORY(Shared)
diff --git a/Tests/Jump/Library/Shared/CMakeLists.txt b/Tests/Jump/Library/Shared/CMakeLists.txt
new file mode 100644
index 000000000..44405770f
--- /dev/null
+++ b/Tests/Jump/Library/Shared/CMakeLists.txt
@@ -0,0 +1,26 @@
+ADD_LIBRARY(jumpShared SHARED jumpShared.cxx)
+
+IF(WIN32 OR CYGWIN)
+ SET(SHARED_MUST_BE_IN_EXE_DIR 1)
+ENDIF()
+
+IF(APPLE)
+ SET(SHARED_MUST_BE_IN_EXE_DIR 1)
+ENDIF(APPLE)
+
+IF(SHARED_MUST_BE_IN_EXE_DIR)
+ SET(LIB_NAME
+ ${CMAKE_SHARED_LIBRARY_PREFIX}jumpShared${CMAKE_SHARED_LIBRARY_SUFFIX})
+ SET(EXE_DIR ${Jump_BINARY_DIR}/Executable)
+ IF(EXECUTABLE_OUTPUT_PATH)
+ SET(EXE_DIR ${EXECUTABLE_OUTPUT_PATH})
+ ENDIF(EXECUTABLE_OUTPUT_PATH)
+ SET(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared)
+ IF(LIBRARY_OUTPUT_PATH)
+ SET(LIB_DIR ${LIBRARY_OUTPUT_PATH})
+ ENDIF(LIBRARY_OUTPUT_PATH)
+ ADD_CUSTOM_COMMAND(TARGET jumpShared
+ POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy
+ ${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}
+ ${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME})
+ENDIF(SHARED_MUST_BE_IN_EXE_DIR)
diff --git a/Tests/Jump/Library/Shared/jumpShared.cxx b/Tests/Jump/Library/Shared/jumpShared.cxx
new file mode 100644
index 000000000..f500058cc
--- /dev/null
+++ b/Tests/Jump/Library/Shared/jumpShared.cxx
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+# define JUMP_EXPORT __declspec(dllexport)
+#else
+# define JUMP_EXPORT
+#endif
+
+JUMP_EXPORT int jumpShared() { return 0; }
diff --git a/Tests/Jump/Library/Static/CMakeLists.txt b/Tests/Jump/Library/Static/CMakeLists.txt
new file mode 100644
index 000000000..23e70c0b1
--- /dev/null
+++ b/Tests/Jump/Library/Static/CMakeLists.txt
@@ -0,0 +1 @@
+ADD_LIBRARY(jumpStatic STATIC jumpStatic.cxx)
diff --git a/Tests/Jump/Library/Static/jumpStatic.cxx b/Tests/Jump/Library/Static/jumpStatic.cxx
new file mode 100644
index 000000000..1f92eb998
--- /dev/null
+++ b/Tests/Jump/Library/Static/jumpStatic.cxx
@@ -0,0 +1 @@
+int jumpStatic() { return 0; }