ENH: Adding test for jumping over and building a missing library.
This commit is contained in:
parent
8bd124e7d0
commit
3a33f2c338
4
Tests/Jump/CMakeLists.txt
Normal file
4
Tests/Jump/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
||||
PROJECT(Jump)
|
||||
|
||||
SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
|
||||
SUBDIRS(Executable Library)
|
2
Tests/Jump/Executable/CMakeLists.txt
Normal file
2
Tests/Jump/Executable/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
ADD_EXECUTABLE(jumpExecutable jumpExecutable.cxx)
|
||||
TARGET_LINK_LIBRARIES(jumpExecutable jumpStatic jumpShared)
|
12
Tests/Jump/Executable/jumpExecutable.cxx
Normal file
12
Tests/Jump/Executable/jumpExecutable.cxx
Normal file
@ -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();
|
||||
}
|
21
Tests/Jump/Library/CMakeLists.txt
Normal file
21
Tests/Jump/Library/CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
ADD_LIBRARY(jumpStatic STATIC jumpStatic.cxx)
|
||||
ADD_LIBRARY(jumpShared SHARED jumpShared.cxx)
|
||||
|
||||
IF(WIN32)
|
||||
SET(LIB_NAME
|
||||
${CMAKE_SHARED_LIBRARY_PREFIX}jumpStatic${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)
|
||||
IF(LIBRARY_OUTPUT_PATH)
|
||||
SET(LIB_DIR ${LIBRARY_OUTPUT_PATH})
|
||||
ENDIF(LIBRARY_OUTPUT_PATH)
|
||||
ADD_CUSTOM_COMMAND(TARGET target
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
ARGS -E copy
|
||||
${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}
|
||||
${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}
|
||||
ENDIF(WIN32)
|
7
Tests/Jump/Library/jumpShared.cxx
Normal file
7
Tests/Jump/Library/jumpShared.cxx
Normal file
@ -0,0 +1,7 @@
|
||||
#ifdef _WIN32
|
||||
# define JUMP_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
# define JUMP_EXPORT
|
||||
#endif
|
||||
|
||||
JUMP_EXPORT int jumpShared() { return 0; }
|
1
Tests/Jump/Library/jumpStatic.cxx
Normal file
1
Tests/Jump/Library/jumpStatic.cxx
Normal file
@ -0,0 +1 @@
|
||||
int jumpStatic() { return 0; }
|
Loading…
x
Reference in New Issue
Block a user