summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/cmake/BuildXercesC.cmake23
-rw-r--r--src/uscxml/transform/ChartToC.cpp2
-rw-r--r--test/CMakeLists.txt16
-rw-r--r--test/src/test-c-machine.scxml.c2
-rw-r--r--test/src/test-gen-c.cpp8
5 files changed, 31 insertions, 20 deletions
diff --git a/contrib/cmake/BuildXercesC.cmake b/contrib/cmake/BuildXercesC.cmake
index 34be8eb..d6fcc04 100644
--- a/contrib/cmake/BuildXercesC.cmake
+++ b/contrib/cmake/BuildXercesC.cmake
@@ -36,6 +36,8 @@ elseif(WIN32)
set(VC_VERSION VC11)
elseif (MSVC_VERSION LESS 1900)
set(VC_VERSION VC12)
+ else()
+ # set(VC_PLATFORM /p:PlatformToolset=v140)
endif()
set(VSPROJECT_PATH "projects/Win32/${VC_VERSION}/xerces-all/XercesLib")
@@ -47,8 +49,13 @@ elseif(WIN32)
BUILD_IN_SOURCE 1
PREFIX ${CMAKE_BINARY_DIR}/deps/xerces-c
CONFIGURE_COMMAND ""
- BUILD_COMMAND cd ${VSPROJECT_PATH} && devenv /Upgrade XercesLib.vcxproj && msbuild /p:Configuration=Static\ Release /p:Platform=x64 /t:build XercesLib.vcxproj
- INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory Build/Win64/${VC_VERSION}/Static\ Release/ ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/ && ${CMAKE_COMMAND} -E copy_directory src/ ${CMAKE_BINARY_DIR}/deps/xerces-c/include/
+ # BUILD_COMMAND cd ${VSPROJECT_PATH} && msbuild /p:Configuration=Static\ Release /p:Platform=x64 /p:RuntimeLibrary=MD_DynamicRelease ${VC_PLATFORM} /t:build XercesLib.vcxproj
+ # INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory Build/Win64/${VC_VERSION}/Static\ Release/ ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/ && ${CMAKE_COMMAND} -E copy_directory src/ ${CMAKE_BINARY_DIR}/deps/xerces-c/include/
+ BUILD_COMMAND cd ${VSPROJECT_PATH} && msbuild /p:Configuration=Release /p:Platform=x64 ${VC_PLATFORM} /t:build XercesLib.vcxproj
+ INSTALL_COMMAND
+ ${CMAKE_COMMAND} -E copy_directory Build/Win64/${VC_VERSION}/Release/ ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/ &&
+ ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/xerces-c_3_1.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} &&
+ ${CMAKE_COMMAND} -E copy_directory src/ ${CMAKE_BINARY_DIR}/deps/xerces-c/include/
)
else()
externalproject_add(xerces-c
@@ -57,8 +64,13 @@ elseif(WIN32)
BUILD_IN_SOURCE 1
PREFIX ${CMAKE_BINARY_DIR}/deps/xerces-c
CONFIGURE_COMMAND ""
- BUILD_COMMAND cd ${VSPROJECT_PATH} && devenv /Upgrade XercesLib.vcxproj && msbuild /p:Configuration=Static\ Release /p:Platform=Win32 /t:build XercesLib.vcxproj
- INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory Build/Win32/${VC_VERSION}/Static\ Release/ ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/ && ${CMAKE_COMMAND} -E copy_directory src/ ${CMAKE_BINARY_DIR}/deps/xerces-c/include/
+ # BUILD_COMMAND cd ${VSPROJECT_PATH} && msbuild /p:Configuration=Static\ Release /p:Platform=Win32 /p:RuntimeLibrary=MD_DynamicRelease ${VC_PLATFORM} /t:build XercesLib.vcxproj
+ # INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory Build/Win32/${VC_VERSION}/Static\ Release/ ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/ && ${CMAKE_COMMAND} -E copy_directory src/ ${CMAKE_BINARY_DIR}/deps/xerces-c/include/
+ BUILD_COMMAND cd ${VSPROJECT_PATH} && msbuild /p:Configuration=Release /p:Platform=Win32 ${VC_PLATFORM} /t:build XercesLib.vcxproj
+ INSTALL_COMMAND
+ ${CMAKE_COMMAND} -E copy_directory Build/Win32/${VC_VERSION}/Release/ ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/ &&
+ ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/xerces-c_3_1.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} &&
+ ${CMAKE_COMMAND} -E copy_directory src/ ${CMAKE_BINARY_DIR}/deps/xerces-c/include/
)
endif()
endif()
@@ -72,7 +84,8 @@ if (APPLE)
elseif(UNIX)
set(XercesC_LIBRARIES ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/libxerces-c.so)
elseif(WIN32)
- set(XercesC_LIBRARIES ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/xerces-c_static_3.lib)
+ # set(XercesC_LIBRARIES ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/xerces-c_static_3.lib)
+ set(XercesC_LIBRARIES ${CMAKE_BINARY_DIR}/deps/xerces-c/lib/xerces-c_3.lib)
else()
message(FATAL_ERROR "Unknown platform!")
endif()
diff --git a/src/uscxml/transform/ChartToC.cpp b/src/uscxml/transform/ChartToC.cpp
index d4a462a..4891bfe 100644
--- a/src/uscxml/transform/ChartToC.cpp
+++ b/src/uscxml/transform/ChartToC.cpp
@@ -932,7 +932,7 @@ void ChartToC::writeHelpers(std::ostream& stream) {
stream << " const char* seperator = \"\";" << std::endl;
stream << " for (i = 0; i < length; i++) {" << std::endl;
stream << " if (BIT_HAS(i, a)) {" << std::endl;
- stream << " printf(\"%s%lu\", seperator, i);" << std::endl;
+ stream << " printf(\"%s%zu\", seperator, i);" << std::endl;
stream << " seperator = \", \";" << std::endl;
stream << " }" << std::endl;
stream << " }" << std::endl;
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 43b89c0..53f2b79 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,6 +1,10 @@
set(TEST_TIMEOUT 15)
set(TEST_BENCHMARK_ITERATIONS 1000)
+if (WIN32)
+ set(GETOPT_FILES ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c)
+endif()
+
find_program(SPIN spin)
find_program(CC gcc)
find_program(CXX g++)
@@ -11,9 +15,7 @@ function(USCXML_TEST_COMPILE)
set(multiValueArgs FILES ARGS)
cmake_parse_arguments(USCXML_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- if (WIN32)
- list(APPEND USCXML_TEST_FILES "${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c")
- endif()
+ list(APPEND USCXML_TEST_FILES ${GETOPT_FILES})
add_executable(${USCXML_TEST_NAME} ${USCXML_TEST_FILES})
target_link_libraries(${USCXML_TEST_NAME} uscxml)
@@ -30,15 +32,11 @@ USCXML_TEST_COMPILE(NAME test-lifecycle LABEL general/test-lifecycle FILES src/t
USCXML_TEST_COMPILE(NAME test-validating LABEL general/test-validating FILES src/test-validating.cpp)
# the one binary to test for pass / fail final states
-if (WIN32)
- add_executable(test-state-pass src/test-state-pass.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c)
-else()
- add_executable(test-state-pass src/test-state-pass.cpp)
-endif()
+add_executable(test-state-pass src/test-state-pass.cpp ${GETOPT_FILES})
target_link_libraries(test-state-pass uscxml)
set_target_properties(test-state-pass PROPERTIES FOLDER "Tests")
-add_executable(test-gen-c src/test-gen-c.cpp)
+add_executable(test-gen-c src/test-gen-c.cpp ${GETOPT_FILES})
target_link_libraries(test-gen-c uscxml)
set_target_properties(test-gen-c PROPERTIES FOLDER "Tests")
diff --git a/test/src/test-c-machine.scxml.c b/test/src/test-c-machine.scxml.c
index 4cfc37c..586a286 100644
--- a/test/src/test-c-machine.scxml.c
+++ b/test/src/test-c-machine.scxml.c
@@ -1077,7 +1077,7 @@ static void printBitsetIndices(const unsigned char* a, size_t length) {
const char* seperator = "";
for (i = 0; i < length; i++) {
if (BIT_HAS(i, a)) {
- printf("%s%lu", seperator, i);
+ printf("%s%zu", seperator, i);
seperator = ", ";
}
}
diff --git a/test/src/test-gen-c.cpp b/test/src/test-gen-c.cpp
index 8f70b26..327858c 100644
--- a/test/src/test-gen-c.cpp
+++ b/test/src/test-gen-c.cpp
@@ -85,7 +85,7 @@ public:
}
void init() {
- sessionId = UUID::getUUID();
+ sessionId = uscxml::UUID::getUUID();
isFinalized = false;
// clear and initialize machine context
@@ -284,10 +284,10 @@ public:
invokedMachine->invokeId = invocation->id;
} else if (invocation->idlocation != NULL) {
// test224
- invokedMachine->invokeId = (invocation->sourcename != NULL ? std::string(invocation->sourcename) + "." : "") + UUID::getUUID();
+ invokedMachine->invokeId = (invocation->sourcename != NULL ? std::string(invocation->sourcename) + "." : "") + uscxml::UUID::getUUID();
USER_DATA(ctx)->dataModel.assign(invocation->idlocation, Data(invokedMachine->invokeId, Data::VERBATIM));
} else {
- invokedMachine->invokeId = UUID::getUUID();
+ invokedMachine->invokeId = uscxml::UUID::getUUID();
}
allMachines[invokedMachine->invokeId] = invokedMachine;
topMachine->invocationIds[invocation] = invokedMachine->invokeId;
@@ -344,7 +344,7 @@ public:
if (send->id != NULL) {
sendid = send->id;
} else {
- sendid = UUID::getUUID();
+ sendid = uscxml::UUID::getUUID();
if (send->idlocation != NULL) {
USER_DATA(ctx)->dataModel.assign(send->idlocation, Data(sendid, Data::VERBATIM));
} else {