Skip to content

Commit

Permalink
new builds
Browse files Browse the repository at this point in the history
  • Loading branch information
vins31 committed Jul 30, 2011
1 parent 0c7b786 commit 7563c15
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 23 deletions.
25 changes: 18 additions & 7 deletions netlog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ file(
source_files
src/*
include/*
# ../../ys_proto/src/*
#../../ys_proto/include/*
)

#Déclaration de l'exécutable
Expand All @@ -27,8 +25,21 @@ add_executable(
${source_files}
)

target_link_libraries(
netlog
_ys_proto
pthread
)
if (FORCE_CPU STREQUAL "32bits")
add_definitions( -m32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -m32")
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -m32")

target_link_libraries(netlog _ys_proto32 pthread)
set_target_properties(netlog PROPERTIES OUTPUT_NAME "netlog32")
else (FORCE_CPU STREQUAL "32bits")
target_link_libraries(netlog _ys_proto pthread)
endif (FORCE_CPU STREQUAL "32bits")

if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
message("Doing the Windows version!")
include_directories("/usr/i486-mingw32/include")
set (LIBS ${LIBS}pthread)
target_link_libraries(netlog pthread)
endif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
3 changes: 3 additions & 0 deletions netlog/build32bits
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cmake_clean
cmake . -G "Unix Makefiles" -DFORCE_CPU:STRING=32bits

2 changes: 2 additions & 0 deletions netlog/buildwin32
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cmake_clean
cmake -DCMAKE_TOOLCHAIN_FILE=toolchain_win.cmake
8 changes: 4 additions & 4 deletions netlog/include/activity_message.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef ACTIVITY_MESS
#define ACTIVITY_MESS

#if defined (Win32)
# include <windows.h>
# define psleep(sec) Sleep ((sec) * 1000)
#elif defined (__linux)
#if defined (__linux)
# include <unistd.h>
# define psleep(sec) sleep ((sec))
#else
# include <windows.h>
# define psleep(sec) Sleep ((sec) * 1000)
#endif

void * send_activity_message(void * p_data);
Expand Down
2 changes: 1 addition & 1 deletion netlog/src/activity_message.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ys_proto/apps/activity_message.h"
#include "activity_message.h"
#include "ys_proto/serialization/header.h"
#include "ys_proto/sockets/socketYS.h"

Expand Down
8 changes: 3 additions & 5 deletions netlog/src/ysclient.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#include "ysclient.h"
#include "ys_proto/serialization/includeAll.h"
#include "ys_proto/debug.h"
#include "ys_proto/apps/activity_message.h"
//#include "ys_proto/debug.h"
#include "activity_message.h"

//#include "readPoly.h"

//#include "xmlLog.h"
#include <pthread.h>



Expand Down
14 changes: 14 additions & 0 deletions netlog/toolchain_win.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER i486-mingw32-gcc)

SET(CMAKE_RC_COMPILER i486-mingw32-gcc)

SET(CMAKE_CXX_COMPILER i486-mingw32-g++)

# Define paths to search for libraries
SET(CMAKE_FIND_ROOT_PATH /usr/i486-mingw32/)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# Don't search in native paths, just the specified root paths
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
18 changes: 12 additions & 6 deletions sndmsg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ file(
source_files
src/*
include/*
# ../../ys_proto/src/*
#../../ys_proto/include/*
)

#Déclaration de l'exécutable
Expand All @@ -24,7 +22,15 @@ add_executable(
${source_files}
)

target_link_libraries(
ys-sndmsg
_ys_proto
)
if (FORCE_CPU STREQUAL "32bits")
add_definitions( -m32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} -m32")
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -m32")

target_link_libraries(ys-sndmsg _ys_proto32)
set_target_properties(ys-sndmsg PROPERTIES OUTPUT_NAME "ys-sndmsg32")
else (FORCE_CPU STREQUAL "32bits")
target_link_libraries(ys-sndmsg _ys_proto)
endif (FORCE_CPU STREQUAL "32bits")

0 comments on commit 7563c15

Please sign in to comment.