… | |
… | |
39 | message(STATUS "Checking for a fallback location of ${name} - not found") |
39 | message(STATUS "Checking for a fallback location of ${name} - not found") |
40 | set(${id} "" CACHE STRING "") |
40 | set(${id} "" CACHE STRING "") |
41 | endif() |
41 | endif() |
42 | endfunction() |
42 | endfunction() |
43 | |
43 | |
|
|
44 | if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") |
|
|
45 | file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test.cxx" |
|
|
46 | " |
|
|
47 | struct e { }; |
|
|
48 | |
|
|
49 | void f () |
|
|
50 | { |
|
|
51 | try |
|
|
52 | { |
|
|
53 | new e (); |
|
|
54 | } |
|
|
55 | catch (...) |
|
|
56 | { |
|
|
57 | throw; |
|
|
58 | } |
|
|
59 | } |
|
|
60 | ") |
|
|
61 | execute_process( |
|
|
62 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp" |
|
|
63 | COMMAND ${CMAKE_C_COMPILER} -x c++ -shared -fPIC -o test.so test.cxx -lsupc++ |
|
|
64 | OUTPUT_VARIABLE OUTPUT |
|
|
65 | ERROR_VARIABLE OUTPUT |
|
|
66 | RESULT_VARIABLE RESULT) |
|
|
67 | if(RESULT EQUAL 0) |
|
|
68 | message(STATUS "Checking for working libsupc++ - yes") |
|
|
69 | set(HAVE_LIBSUPCXX 1 CACHE BOOL "") |
|
|
70 | file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log |
|
|
71 | "libsupc++ test succeeded with the following output:\n" |
|
|
72 | "${OUTPUT}\n") |
|
|
73 | else() |
|
|
74 | message(STATUS "Checking for working libsupc++ - no") |
|
|
75 | set(HAVE_LIBSUPCXX 0 CACHE BOOL "") |
|
|
76 | file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log |
|
|
77 | "libsupc++ test failed with the following output:\n" |
|
|
78 | "${OUTPUT}\n") |
|
|
79 | endif() |
|
|
80 | endif() |
|
|
81 | |
44 | check_include_files(pty.h HAVE_PTY_H) |
82 | check_include_files(pty.h HAVE_PTY_H) |
45 | check_include_files(util.h HAVE_UTIL_H) |
83 | check_include_files(util.h HAVE_UTIL_H) |
46 | check_include_files(libutil.h HAVE_LIBUTIL_H) |
84 | check_include_files(libutil.h HAVE_LIBUTIL_H) |
47 | check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H) |
85 | check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H) |
48 | check_include_files(stropts.h HAVE_STROPTS_H) |
86 | check_include_files(stropts.h HAVE_STROPTS_H) |
… | |
… | |
265 | src/logging.C |
303 | src/logging.C |
266 | src/proxy.C |
304 | src/proxy.C |
267 | src/ptytty.C) |
305 | src/ptytty.C) |
268 | target_include_directories(ptytty PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) |
306 | target_include_directories(ptytty PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) |
269 | set_target_properties(ptytty PROPERTIES VERSION 0) |
307 | set_target_properties(ptytty PROPERTIES VERSION 0) |
270 | if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") |
308 | if(HAVE_LIBSUPCXX) |
271 | set_target_properties(ptytty PROPERTIES LINKER_LANGUAGE C) |
309 | set_target_properties(ptytty PROPERTIES LINKER_LANGUAGE C) |
272 | target_link_libraries(ptytty PRIVATE supc++) |
310 | target_link_libraries(ptytty PRIVATE supc++) |
|
|
311 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES) |
273 | endif() |
312 | endif() |
274 | if(HAVE_LIBSOCKET) |
313 | if(HAVE_LIBSOCKET) |
275 | target_link_libraries(ptytty PRIVATE socket) |
314 | target_link_libraries(ptytty PRIVATE socket) |
276 | list(APPEND LIBS -lsocket) |
315 | list(APPEND LIBS -lsocket) |
277 | endif() |
316 | endif() |