Browse Source

Generate config.h for Windows build


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4185 3789f03b-4d11-0410-bbf8-ca57d06f2519
tags/v1.0.90
DRC 13 years ago
parent
commit
637580929e
2 changed files with 22 additions and 0 deletions
  1. 16
    0
      CMakeLists.txt
  2. 6
    0
      config.h.cmake.in

+ 16
- 0
CMakeLists.txt View File

@@ -85,6 +85,22 @@ if(MINGW)
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> --output-format=coff <SOURCE>")
endif()

# Generate config.h
include(CheckIncludeFiles)
include(CheckFunctionExists)
set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h)
set(CMAKE_REQUIRED_LIBRARIES ws2_32)
check_function_exists(inet_aton HAVE_INET_ATON)
check_function_exists(inet_ntop HAVE_INET_NTOP)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_REQUIRED_LIBRARIES)
check_function_exists(snprintf HAVE_SNPRINTF)
check_function_exists(strcasecmp HAVE_STRCASECMP)
check_function_exists(strncasecmp HAVE_STRNCASECMP)
check_function_exists(vsnprintf HAVE_VSNPRINTF)
configure_file(config.h.cmake.in config.h)
add_definitions(-DHAVE_CONFIG_H)
include_directories(${CMAKE_BINARY_DIR})

add_subdirectory(common)
add_subdirectory(win)

+ 6
- 0
config.h.cmake.in View File

@@ -0,0 +1,6 @@
#cmakedefine HAVE_INET_ATON
#cmakedefine HAVE_INET_NTOP
#cmakedefine HAVE_SNPRINTF
#cmakedefine HAVE_STRCASECMP
#cmakedefine HAVE_STRNCASECMP
#cmakedefine HAVE_VSNPRINTF

Loading…
Cancel
Save