- make -j$NUM_CPU && make dist
- make cross -j$NUM_CPU
- sh bootstrap.sh ; sh contrib/mingw-cross-compile.sh
+ - mkdir build_native && cd build_native && cmake ../compiler/cpp/ && make; cd ..
+ - mkdir build_mingw32 && cd build_mingw32 && cmake -DCMAKE_TOOLCHAIN_FILE=../contrib/mingw32-toolchain.cmake ../compiler/cpp/ && make; cd ..
# TODO: add these steps
# - sh bootstrap.sh ; dpkg-buildpackage -tc
message(STATUS "Thrift version: ${thrift_VERSION} (${thrift_VERSION_MAJOR}.${thrift_VERSION_MINOR}.${thrift_VERSION_PATCH})")
# Windows has a different header
-if(WIN32)
+if(MSVC)
set(FLEX_FLAGS "--wincompat") # Don't use unistd.h on windows
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/windows/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
else()
include_directories(${CMAKE_CURRENT_BINARY_DIR} src)
add_executable(thrift ${thrift_SOURCES})
-set_target_properties(thrift PROPERTIES VERSION ${thrift_VERSION})
target_link_libraries(thrift libparse)
--- /dev/null
+# CMake mingw32 cross compile toolchain file\r
+\r
+# the name of the target operating system\r
+SET(CMAKE_SYSTEM_NAME Windows)\r
+\r
+# which compilers to use for C and C++\r
+SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)\r
+SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)\r
+SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)\r
+\r
+# here is the target environment located\r
+SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)\r
+\r
+# adjust the default behaviour of the FIND_XXX() commands:\r
+# search headers and libraries in the target environment, search \r
+# programs in the host environment\r
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\r
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\r
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\r