ENDIF(SIZEOF_LONG EQUAL 4)
if(WIN32)
+
set(INCLUDES_MORE $ENV{INCLUDE})
string(REPLACE "\\" "/" INCLUDES_MORE "${INCLUDES_MORE}")
foreach(include_dir ${INCLUDES_MORE})
set(INCLUDES "${INCLUDES} -I\"${include_dir}\"")
endforeach(include_dir ${INCLUDES_MORE})
- message("Be sure all those variables are correctely set.")
- message(" -- C_COMPILER $ENV{CC}")
- message(" -- CXX_COMPILER $ENV{CXX}")
- message(" -- RC_COMPILER $ENV{RC}")
- message(" -- INCLUDE $ENV{INCLUDE}")
- message(" -- LIB $ENV{LIB}")
- message(" -- MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM}")
- message(" -- CMAKE_BUILD_TOOL ${CMAKE_BUILD_TOOL}")
- message(" -- LINKER ${CMAKE_LINKER}")
- message(" -- CMAKE_GENERATOR ${CMAKE_GENERATOR}")
- message(" -- INCLUDES ${INCLUDES}")
- message(" -- BORLAND ${BORLAND}")
- message(" -- VISUALC ${MSVC}")
- message(" -- GNUC ${CMAKE_COMPILER_IS_GNUCC}\n\n")
+ set(INCLUDES "${INCLUDES} -I${PROJECT_DIRECTORY}/include/xbt -I${PROJECT_DIRECTORY}/src/xbt") #for win32_ucontext.[ch]
+
if(BORLAND) ### BORLAND COMPILER
set(__BORLANDC__ 1)
+ set(CMAKE_COMPILER_IS_GNUCC 0)
+ set(MSVC 0)
set(_XBT_BORLANDC_COMPILER 1)
endif(BORLAND)
if(MSVC) ### MicroSoftVisualC COMPILER
set(__VISUALC__ 1)
+ set(BORLAND 0)
+ set(CMAKE_COMPILER_IS_GNUCC 0)
set(_XBT_VISUALC_COMPILER 1)
set(_MSC_VER 1)
set(__STRICT_ANSI__ 1)
if(CMAKE_COMPILER_IS_GNUCC)
set(__GNUC__ 1)
+ set(MSVC 0)
+ set(BORLAND 0)
endif(CMAKE_COMPILER_IS_GNUCC)
if(ARCH_32_BITS) ### Arch 32bits
endif(ARCH_32_BITS)
set(_XBT_WIN32 1)
+
+ message("Be sure all those variables are correctely set.")
+ message(" -- C_COMPILER $ENV{CC}")
+ message(" -- CXX_COMPILER $ENV{CXX}")
+ message(" -- RC_COMPILER $ENV{RC}")
+ message(" -- INCLUDE $ENV{INCLUDE}")
+ message(" -- LIB $ENV{LIB}")
+ message(" -- MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM}")
+ message(" -- CMAKE_BUILD_TOOL ${CMAKE_BUILD_TOOL}")
+ message(" -- LINKER ${CMAKE_LINKER}")
+ message(" -- CMAKE_GENERATOR ${CMAKE_GENERATOR}")
+ message(" -- INCLUDES ${INCLUDES}")
+ message(" -- BORLAND ${BORLAND}")
+ message(" -- VISUALC ${MSVC}")
+ message(" -- GNUC ${CMAKE_COMPILER_IS_GNUCC}\n\n")
+
endif(WIN32)
add_definitions (${INCLUDES})
endif(HAVE_JAVA)
### Make tests
+if(NOT WIN32)
include(${PROJECT_DIRECTORY}/buildtools/Cmake/AddTests.cmake)
include(${PROJECT_DIRECTORY}/buildtools/Cmake/CTestConfig.cmake)
+endif(NOT WIN32)
### Setup the distrib
include(${PROJECT_DIRECTORY}/buildtools/Cmake/Distrib.cmake)
### depend of some variables setted upper
# -->CONTEXT_THREADS
-if(${CONTEXT_THREADS} OR WIN32)
+if(${CONTEXT_THREADS}) #pthread
set(SURF_SRC
${SURF_SRC}
src/xbt/xbt_os_thread.c
${EXTRA_DIST}
src/simix/smx_context_sysv.c
)
-else(${CONTEXT_THREADS} OR WIN32)
+else(${CONTEXT_THREADS}) #ucontext
set(SURF_SRC
${SURF_SRC}
src/simix/smx_context_sysv.c
)
- set(EXTRA_DIST
- ${EXTRA_DIST}
- src/xbt/xbt_os_thread.c
- src/simix/smx_context_thread.c
- )
-endif(${CONTEXT_THREADS} OR WIN32)
+
+ if(WIN32)
+ set(SURF_SRC
+ ${SURF_SRC}
+ src/xbt/xbt_os_thread.c
+ src/simix/smx_context_thread.c)
+ else(WIN32)
+ set(EXTRA_DIST
+ ${EXTRA_DIST}
+ src/xbt/xbt_os_thread.c
+ src/simix/smx_context_thread.c)
+ endif(WIN32)
+endif(${CONTEXT_THREADS})
+
+
+
# -->HAVE_GTNETS
if(HAVE_GTNETS)
### Make Libs\r
- \r
-add_library(simgrid SHARED ${simgrid_sources})\r
-add_library(simgrid_static STATIC ${simgrid_sources})\r
-add_library(gras SHARED ${gras_sources})\r
-add_library(gras_static STATIC ${gras_sources})\r
-\r
-set_target_properties(simgrid PROPERTIES VERSION ${libsimgrid_version})\r
-set_target_properties(gras PROPERTIES VERSION ${libgras_version})\r
-\r
+#>gcc c:\simgrid-trunk\examples\msg\icomms\peer.c -static -Lc:\simgrid-trunk\lib -lsimgrid -Ic:\simgrid-trunk\include -lwsock32 \r
+add_library(simgrid STATIC ${simgrid_sources})\r
+add_library(gras STATIC ${gras_sources})\r
\r
if(MSVC)\r
- set_target_properties(gras PROPERTIES COMPILE_FLAGS "/D _XBT_DLL_EXPORT")\r
- set_target_properties(gras_static PROPERTIES COMPILE_FLAGS "/D _XBT_DLL_STATIC"\r
+ set_target_properties(gras PROPERTIES COMPILE_FLAGS "/D _XBT_DLL_STATIC"\r
OUTPUT_NAME "gras")\r
- set_target_properties(simgrid PROPERTIES COMPILE_FLAGS "/D _XBT_DLL_EXPORT")\r
- set_target_properties(simgrid_static PROPERTIES COMPILE_FLAGS "/D _XBT_DLL_STATIC"\r
+ set_target_properties(simgrid PROPERTIES COMPILE_FLAGS "/D _XBT_DLL_STATIC"\r
OUTPUT_NAME "simgrid")\r
else(MSVC)\r
if(CMAKE_COMPILER_IS_GNUCC)\r
- set_target_properties(gras PROPERTIES COMPILE_FLAGS "-D _XBT_DLL_EXPORT")\r
- set_target_properties(gras_static PROPERTIES COMPILE_FLAGS "-D _XBT_DLL_STATIC"\r
+ set_target_properties(gras PROPERTIES COMPILE_FLAGS "-D _XBT_DLL_STATIC"\r
OUTPUT_NAME "gras")\r
- set_target_properties(simgrid PROPERTIES COMPILE_FLAGS "-D _XBT_DLL_EXPORT")\r
- set_target_properties(simgrid_static PROPERTIES COMPILE_FLAGS "-D _XBT_DLL_STATIC"\r
+ set_target_properties(simgrid PROPERTIES COMPILE_FLAGS "-D _XBT_DLL_STATIC"\r
OUTPUT_NAME "simgrid")\r
else(CMAKE_COMPILER_IS_GNUCC)\r
message(FATAL_ERROR "Compilateur non connu!!!")\r
set(SIMGRID_DEP "wsock32")\r
\r
target_link_libraries(simgrid ${SIMGRID_DEP})\r
-target_link_libraries(simgrid_static ${SIMGRID_DEP})\r
target_link_libraries(gras ${GRAS_DEP})\r
-target_link_libraries(gras_static ${GRAS_DEP})\r
\r
### Make EXEs\r
\r
#testsuite/xbt\r
add_subdirectory(${PROJECT_DIRECTORY}/testsuite/xbt)\r
\r
-#testsuite/surf\r
-add_subdirectory(${PROJECT_DIRECTORY}/testsuite/surf)\r
-\r
#testsuite/simdag\r
add_subdirectory(${PROJECT_DIRECTORY}/testsuite/simdag)
\ No newline at end of file
add_executable(testall ${USE_TEST_UNITS})
### Add definitions for compile
-target_link_libraries(testall gras m)
+if(NOT WIN32)
+ target_link_libraries(testall gras m)
+else(NOT WIN32)
+ target_link_libraries(testall gras)
+endif(NOT WIN32)
add_dependencies(testall units_files)
\ No newline at end of file
#ifdef HAVE_RUBY
void SIMIX_ctx_ruby_factory_init(smx_context_factory_t *factory);
#endif
-
+
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_context, simix, "Context switching mecanism");
const char *xbt_ctx_factory_to_use = NULL;
#ifdef CONTEXT_THREADS
/* context switch based os thread */
SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
-#elif !defined(_XBT_WIN32)
+#elif defined(CONTEXT_UCONTEXT)
/* context switch based ucontext */
SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
+#elif defined(_XBT_WIN32)
+ /* context switch based windows */
#else
/* context switch is not allowed on Windows */
#error ERROR [__FILE__, line __LINE__]: no context based implementation specified.
#if defined(_XBT_BORLAND_COMPILER)
-# include <win32/compiler/borland.h>
-
+ # include <win32/compiler/borland.h>
#elif defined(__GNUC__)
- /* data comes from autoconf when using gnuc (cross-compiling?) */
-# include "gras_config.h"
-typedef unsigned int uint32_t;
-
+ /* data comes from autoconf when using gnuc (cross-compiling?) */
+ # include "gras_config.h"
+ #ifndef _XBT_WIN32
+ typedef unsigned int uint32_t;
+ #endif
#elif defined(_XBT_VISUALC_COMPILER)
-# include <win32/compiler/visualc.h>
+ # include <win32/compiler/visualc.h>
# else
-# error "Unknown compiler - please report the problems to the main simgrid mailing list (http://gforge.inria.fr/mail/?group_id=12)"
+ # error "Unknown compiler - please report the problems to the main simgrid mailing list (http://gforge.inria.fr/mail/?group_id=12)"
#endif
typedef int socklen_t;
#include "portable.h" /* CONTEXT_THREADS */
#ifndef CONTEXT_THREADS
+#ifndef WIN32
/* xbt_threads is loaded in libsimgrid when they are used to implement the xbt_context.
* The decision (and the loading) is made in xbt/context.c.
("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)");
}
#endif
+#endif
add_executable(sd_test sd_test.c)
### Add definitions for compile
+if(NOT WIN32)
target_link_libraries(sd_test simgrid m )
+else(NOT WIN32)
+target_link_libraries(sd_test simgrid )
+endif(NOT WIN32)
add_executable(trace_usage "trace_usage.c")
### Add definitions for compile
+if(NOT WIN32)
target_link_libraries(lmm_usage simgrid m )
target_link_libraries(maxmin_bench simgrid m )
target_link_libraries(surf_usage simgrid m )
target_link_libraries(surf_usage2 simgrid m )
-target_link_libraries(trace_usage simgrid m )
+target_link_libraries(trace_usage simgrid m )
+else(NOT WIN32)
+target_link_libraries(lmm_usage simgrid )
+target_link_libraries(maxmin_bench simgrid )
+target_link_libraries(surf_usage simgrid )
+target_link_libraries(surf_usage2 simgrid )
+target_link_libraries(trace_usage simgrid )
+endif(NOT WIN32)
\ No newline at end of file
add_executable(heap_bench "heap_bench.c")
### Add definitions for compile
+if(NOT WIN32)
target_link_libraries(log_usage gras m )
target_link_libraries(graphxml_usage simgrid m )
target_link_libraries(heap_bench gras m )
+else(NOT WIN32)
+target_link_libraries(log_usage gras )
+target_link_libraries(graphxml_usage simgrid )
+target_link_libraries(heap_bench gras )
+endif(NOT WIN32)
\ No newline at end of file
add_executable(gras_stub_generator stub_generator.c unix_stub_generator.c windows_stub_generator.c)
### Add definitions for compile
-target_link_libraries(gras_stub_generator simgrid pthread m)
\ No newline at end of file
+if(NOT WIN32)
+ target_link_libraries(gras_stub_generator gras simgrid pthread m)
+else(NOT WIN32)
+ target_link_libraries(gras_stub_generator gras simgrid)
+endif(NOT WIN32)
\ No newline at end of file