提交 54ed76ec 编写于 作者: F freemine

start to enable build in windows

上级 7137bf89
...@@ -26,3 +26,12 @@ IF (TD_LINUX_64) ...@@ -26,3 +26,12 @@ IF (TD_LINUX_64)
ENDIF () ENDIF ()
ENDIF () ENDIF ()
IF (TD_WINDOWS_64)
find_package(FLEX)
if(NOT FLEX_FOUND)
message(FATAL_ERROR "you need to install flex first")
else ()
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
endif()
ENDIF ()
...@@ -22,3 +22,21 @@ IF (TD_LINUX_64) ...@@ -22,3 +22,21 @@ IF (TD_LINUX_64)
install(CODE "execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/install.sh ${CMAKE_BINARY_DIR})") install(CODE "execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/install.sh ${CMAKE_BINARY_DIR})")
ENDIF () ENDIF ()
IF (TD_WINDOWS_64)
FLEX_TARGET(todbcFlexScanner
todbc_scanner.l
${CMAKE_CURRENT_BINARY_DIR}/todbc_scanner.c
)
set(todbc_flex_scanner_src
${FLEX_todbcFlexScanner_OUTPUTS}
)
AUX_SOURCE_DIRECTORY(. SRC)
# generate dynamic library (*.so)
ADD_LIBRARY(todbc SHARED ${SRC} ${todbc_flex_scanner_src})
SET_TARGET_PROPERTIES(todbc PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(todbc PROPERTIES VERSION ${TD_VER_NUMBER} SOVERSION 1)
TARGET_LINK_LIBRARIES(todbc taos_static)
target_include_directories(todbc PUBLIC
.)
ENDIF ()
...@@ -16,7 +16,11 @@ ...@@ -16,7 +16,11 @@
#ifndef _todbc_log_h_ #ifndef _todbc_log_h_
#define _todbc_log_h_ #define _todbc_log_h_
#ifdef _MSC_VER
#include "msvcLibgen.h"
#else
#include <libgen.h> #include <libgen.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -5,3 +5,9 @@ IF (TD_LINUX) ...@@ -5,3 +5,9 @@ IF (TD_LINUX)
ADD_EXECUTABLE(tcodbc main.c) ADD_EXECUTABLE(tcodbc main.c)
TARGET_LINK_LIBRARIES(tcodbc odbc) TARGET_LINK_LIBRARIES(tcodbc odbc)
ENDIF () ENDIF ()
IF (TD_WINDOWS_64)
AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(tcodbc main.c)
TARGET_LINK_LIBRARIES(tcodbc odbc)
ENDIF ()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册