Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding Win32 build instructions and support.

Also, the time struct is standard on Windows, so we'll build test_speed now.
  • Loading branch information...
commit c774836c08a704ac111a504886a1600606341492 1 parent 5b13af1
@vangdfang authored
View
3  README
@@ -4,3 +4,6 @@ Film at 11.
Suggested bcpp command:
bcpp -s -f 2 -i 4 -bnl -fi $in -fo $out
+
+To build for win32, you first need MinGW (look at the mingw32 packages on Debian).
+./build-win32.sh has a sample for how to build the system.
View
16 Toolchain.mingw32
@@ -0,0 +1,16 @@
+# the name of the target operating system
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# which compilers to use for C and C++
+SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
+SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
+
+# here is the target environment located
+SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc /home/alex/mingw-install )
+
+# adjust the default behaviour of the FIND_XXX() commands:
+# search headers and libraries in the target environment, search
+# programs in the host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
View
1  bcpp.sh
@@ -1,3 +1,4 @@
+#!/bin/sh
for i in `find . -name '*.c' -or -name '*.h' -or -name '*.cpp' -or -name '*.hpp'`; do
bcpp -s -f 2 -i 4 -bnl -fi $i -fo bcpp.tmp
mv bcpp.tmp $i
View
5 build-win32.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+mkdir build-win32
+cd build-win32
+cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain.mingw32 ..
+make
View
2  lib/serial_port_win32.cpp
@@ -157,9 +157,7 @@ size_t serial_port::p_read( uint8_t * data, size_t size )
const uint64_t serial_port::getTime( void )
{
- /*
timeval tv;
gettimeofday( &tv, NULL );
return (uint64_t)tv.tv_sec * 1000000 + (uint64_t)tv.tv_usec ;
- */
}
View
2  util/CMakeLists.txt
@@ -10,10 +10,10 @@ find_library(HAS_OPENCV NAMES cv highgui)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_executable (jsdrive jsdrive.cpp)
target_link_libraries (jsdrive cutter pthread)
+endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_executable (test_speed test_speed.cpp)
target_link_libraries (test_speed cutter)
-endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_executable (test_serial test_serial.cpp)
target_link_libraries (test_serial cutter)
Please sign in to comment.
Something went wrong with that request. Please try again.