diff options
author | Silvio Traversaro <silvio@traversaro.it> | 2021-04-29 09:44:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 09:44:52 +0200 |
commit | 010969070719fe14435f4b146ecef5e65df0098f (patch) | |
tree | f3f5e43983a89ff9d886c64342f977a324931ca4 /CMakeLists.txt | |
parent | 020e3142953ce9d044b6144bc7a55629341bb715 (diff) | |
parent | a130887781373f5f29552ee6d7139b99a829512d (diff) | |
download | dlfcn-win32-010969070719fe14435f4b146ecef5e65df0098f.tar.gz dlfcn-win32-010969070719fe14435f4b146ecef5e65df0098f.tar.bz2 dlfcn-win32-010969070719fe14435f4b146ecef5e65df0098f.zip |
Merge pull request #99 from xantares/wine
cmake: use CROSSCOMPILING_EMULATOR
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e52b25b..160d787 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -12,23 +12,6 @@ include(Macros) | |||
12 | option(BUILD_SHARED_LIBS "shared/static libs" ON) | 12 | option(BUILD_SHARED_LIBS "shared/static libs" ON) |
13 | option(BUILD_TESTS "tests?" OFF) | 13 | option(BUILD_TESTS "tests?" OFF) |
14 | 14 | ||
15 | if(WIN32 AND NOT CMAKE_HOST_WIN32 AND CMAKE_CROSSCOMPILING AND BUILD_TESTS) | ||
16 | add_auto_option(ENABLE_WINE "Enable running tests with wine" AUTO) | ||
17 | find_program(WINE_EXECUTABLE wine) | ||
18 | check_auto_option(ENABLE_WINE "wine support" WINE_EXECUTABLE "wine executable") | ||
19 | if(ENABLE_WINE AND WINE_EXECUTABLE) | ||
20 | set(WRAPPER ${WINE_EXECUTABLE}) | ||
21 | set(RUN_TESTS 1) | ||
22 | message(STATUS "Support to run cross compiled tests - enabled") | ||
23 | endif() | ||
24 | elseif(BUILD_TESTS) | ||
25 | set(RUN_TESTS 1) | ||
26 | endif() | ||
27 | |||
28 | if(RUN_TESTS) | ||
29 | enable_testing() | ||
30 | endif() | ||
31 | |||
32 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | 15 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
33 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | 16 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) |
34 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | 17 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
@@ -44,5 +27,9 @@ if(WIN32) | |||
44 | endif() | 27 | endif() |
45 | 28 | ||
46 | if (BUILD_TESTS) | 29 | if (BUILD_TESTS) |
30 | if (CMAKE_CROSSCOMPILING AND NOT DEFINED CMAKE_CROSSCOMPILING_EMULATOR) | ||
31 | message(WARNING "You might want to set CMAKE_CROSSCOMPILING_EMULATOR to wine path in order to run tests") | ||
32 | endif () | ||
33 | enable_testing() | ||
47 | add_subdirectory(tests) | 34 | add_subdirectory(tests) |
48 | endif() | 35 | endif() |