3 # Copyright (c) 2014-2018. The SimGrid Team.
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of the license (GNU LGPL) which comes with this package.
9 SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
10 SIMGRID_GITHASH="@SIMGRID_GITHASH@"
12 CXX=@CMAKE_CXX_COMPILER@
14 INCLUDEARGS="@includeflag@"
15 CMAKE_LINKARGS="-L@libdir@"
19 list_set CXXFLAGS "-std=gnu++11"
21 if [ "@WIN32@" != "1" ]; then
22 # list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
23 list_add CXXFLAGS "-fpic"
24 if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
25 list_add LINKARGS "-shared"
27 echo "Warning: smpicxx pretends to be a regular compiler (SMPI_PRETEND_CC is set). Produced binaries will not be usable in SimGrid."
29 list_add LINKARGS "-lsimgrid"
31 list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_main.h"
32 list_add LINKARGS "@libdir@\libsimgrid.dll"
36 while [ $# -gt 0 ]; do
46 SRCFILE="$(readlink -f ${ARG} 2>/dev/null)"
47 if [ -z "$SRCFILE" ] ; then
50 list_add CMDARGS "${SRCFILE}"
52 '-version' | '--version')
53 printf '%b\n' "$SIMGRID_VERSION"
56 "-git-version" | "--git-version")
57 printf '%b\n' "$SIMGRID_GITHASH"
60 '-compiler-version' | '--compiler-version')
64 list_add CMDARGS "${ARG}"
69 list_set CMDLINE "${CXX}"
70 list_add_not_empty CMDLINE "${CXXFLAGS}"
71 list_add_not_empty CMDLINE ${INCLUDEARGS}
72 list_add_not_empty CMDLINE ${CMAKE_LINKARGS}
73 list_add_not_empty CMDLINE "${CMDARGS}"
74 list_add_not_empty CMDLINE "${LINKARGS}"
76 eval $(list_get CMDLINE)