Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[windows] don't mess with -m32 or -m64 gcc flags
[simgrid.git] / tools / cmake / MakeLibWin.cmake
1 ### Make Libs
2 #>gcc c:\simgrid-trunk\examples\msg\icomms\peer.c -static -Lc:\simgrid-trunk\lib -lsimgrid -Ic:\simgrid-trunk\include -lwsock32
3
4 add_library(simgrid SHARED ${simgrid_sources})
5
6 if(MSVC)
7   set_target_properties(simgrid  PROPERTIES 
8        COMPILE_FLAGS "/D_XBT_DLL_EXPORT /DDLL_EXPORT" 
9        VERSION ${libsimgrid_version} )
10 else()
11   set_target_properties(simgrid  PROPERTIES 
12        COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" 
13        LINK_FLAGS "-shared" 
14        VERSION ${libsimgrid_version} 
15        PREFIX "lib" SUFFIX ".dll" 
16        IMPORT_PREFIX "lib" IMPORT_SUFFIX ".dll")
17
18   set(SIMGRID_DEP "-lws2_32 -lm")
19
20   if (HAVE_PTHREAD)
21     set(SIMGRID_DEP "${SIMGRID_DEP} -lpthread")
22   endif()
23
24   #if(ARCH_32_BITS)
25   #  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486 -D_I_X86_")
26   #  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -march=i486 -D_I_X86_")
27   #else()
28   #  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -D_AMD64_")
29   #  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -D_AMD64_")
30   #  #        message(FATAL_ERROR "Sorry, Simgrid fails with full 64bits for now! Please contact us.")
31   #endif()
32 endif()
33
34 target_link_libraries(simgrid   ${SIMGRID_DEP})
35