Skip to content

Commit

Permalink
yasmine 1.0.0
Browse files Browse the repository at this point in the history
yasmine 1.0.0 build - first stable release

Changelog: http://yasmine.seadex.de/Changelog.html
Documentation: http://yasmine.seadex.de/Documentation.html
  • Loading branch information
SeadexTM committed Jan 20, 2017
1 parent 37062ed commit 4c04c71
Show file tree
Hide file tree
Showing 317 changed files with 7,882 additions and 4,812 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 3.5)

project(yasmine)
add_subdirectory(libyasmine)

add_subdirectory(examples)
4 changes: 3 additions & 1 deletion yasmine/build/c++03.props → build/c++03.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<BOOST_PATH>..\..\..\..\..\3rd party\boost\Content\boost_1_60_0</BOOST_PATH>
<BOOST_LIB_PATH>..\..\..\..\..\3rd party\boost\Content\boost_1_60_0\stage\VS2015\$(Platform)\lib</BOOST_LIB_PATH>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<_PropertySheetDisplayName>c++03</_PropertySheetDisplayName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>Y_NO_VARIADIC_MACRO;Y_CPP03_BOOST;BOOST_SP_USE_STD_ATOMIC;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
2 changes: 1 addition & 1 deletion yasmine/build/debug_info.props → build/debug_info.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ClCompile />
<Link>
<TargetMachine>NotSet</TargetMachine>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<ClCompile>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
Expand Down
17 changes: 17 additions & 0 deletions build/use_c++03.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>Y_NO_VARIADIC_MACRO;Y_CPP03_BOOST;BOOST_SP_USE_STD_ATOMIC;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link />
<Link>
<AdditionalLibraryDirectories>$(BOOST_LIB_PATH);$(SolutionDir)\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
18 changes: 18 additions & 0 deletions build/use_yasmine.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\..\libyasmine\include;..\..\libyasmine\include_impl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<Lib />
<Link>
<AdditionalLibraryDirectories>$(SolutionDir)\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libyasmine.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\yasmine;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\libyasmine\include;..\libyasmine\include_impl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
<Lib />
<Link>
<AdditionalLibraryDirectories>$(SolutionDir)\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>yasmine.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libyasmine.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
Expand Down
26 changes: 15 additions & 11 deletions yasmine/build/vs2013.props → build/vs2013.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<TreatWarningAsError>false</TreatWarningAsError>
<PreprocessorDefinitions>Y_CPP03_BOOST;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>
2 changes: 2 additions & 0 deletions yasmine/build/yasmine.props → build/yasmine.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<PreprocessorDefinitions>Y_OPTIMIZE_4_SPEED;WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<WholeProgramOptimization>false</WholeProgramOptimization>
<TreatWarningAsError>true</TreatWarningAsError>
<AdditionalIncludeDirectories>include;include_impl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link />
<Link>
Expand Down
3 changes: 0 additions & 3 deletions yasmine/CMakeLists.txt → examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
cmake_minimum_required(VERSION 3.5)

project(yasmine)
add_subdirectory(yasmine)

add_subdirectory(hello_yasmine)
add_subdirectory(classic_farmroad)
add_subdirectory(forty_two)
Expand Down
185 changes: 185 additions & 0 deletions examples/classic_farmroad/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
cmake_minimum_required(VERSION 3.5)

project(classic_farmroad)

set(CMAKE_VERBOSE_MAKEFILE, 1)

set(HEADER_FILES "./../../libyasmine/include/*.hpp")
file(GLOB classic_farmroad_SRC "./*.cpp" ${HEADER_FILES})

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)


if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if( "${CMAKE_CXX_FLAGS}" STREQUAL "-m64" )
set(extra_flags "${extra_flags} -m64")
message(STATUS "setting platform x64")
else()
set(extra_flags "${extra_flags} -m32")
message(STATUS "setting platform x86")
endif()

if("${CPP_VERSION}" STREQUAL "03")
set(extra_flags "${extra_flags} -std=c++03 -Wall -Wpedantic -g -Wno-unknown-pragmas -D \"Y_CPP03_BOOST\" -D \"Y_NO_VARIADIC_MACRO\"")
else()
set(extra_flags "${extra_flags} -std=c++14 -Wall -Wpedantic -g")
endif()

# yasmine's preprocessor definitions
set(Y_OPTIMIZE "SPEED" CACHE STRING "Sets the optimize type. Supported values: SPEED and SIZE. Default value is SPEED.")
if( "${Y_OPTIMIZE}" STREQUAL "SIZE" )
set(extra_flags "${extra_flags} -D \"Y_OPTIMIZE_4_SIZE\"")
else()
set(extra_flags "${extra_flags} -D \"Y_OPTIMIZE_4_SPEED\"")
endif()

option("Y_NO_LOGGING" "Use when you want to use no logging at all (no logging code is created).")
if( "${Y_NO_LOGGING}" )
set(extra_flags "${extra_flags} -D \"Y_NO_LOGGING\"")
endif()

option("Y_NO_STD_MAKE_UNIQUE" "When the standard make_unique is not available (e.g. no C++14 support), you have to define this preprocessor definition. A yasmine drop-in replacement template will be used instead then.")
if( "${Y_NO_STD_MAKE_UNIQUE}" )
set(extra_flags "${extra_flags} -D \"Y_NO_STD_MAKE_UNIQUE\"")
endif()

option("Y_LEAN_AND_MEAN" "If you compile the library with Y_LEAN_AND_MEAN being defined or if you define the macro locally before including yasmine.hpp, all the state pseudostates and the asynchronous simple state (with the asynchronous behavior) are excluded (i.e. those headers are not included). This can reduce compile time.")
if( "${Y_LEAN_AND_MEAN}" )
set(extra_flags "${extra_flags} -D \"Y_LEAN_AND_MEAN\"")
endif()

option("Y_PROFILER" "If Y_PROFILER is defined, the state machine will count the number of events that were processed. The user can query the counter by calling the 'get_number_of_processed_events' method.")
if( "${Y_PROFILER}" )
set(extra_flags "${extra_flags} -D \"Y_PROFILER\"")
endif()

elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Checks buffer security.
set(extra_flags "${extra_flags} /GS")

#Sets output warning level.
set(extra_flags "${extra_flags} /W4")

#Disable specific Warnings.
set(extra_flags "${extra_flags} /wd\"4127\" /wd\"4250\"")

#Defines constants and macros.
set(extra_flags "${extra_flags} /D \"_CRT_SECURE_NO_WARNINGS\"")

#Enables function-level linking.
set(extra_flags "${extra_flags} /Gy")

#Specifies standard behavior under /Ze.
set(extra_flags "${extra_flags} /Zc:wchar_t /Zc:inline")

#Disable minimal rebuild.
set(extra_flags "${extra_flags} /Gm-")

#Enables additional security features and warnings.
set(extra_flags "${extra_flags} /sdl")

#Specifies floating-point behavior.
set(extra_flags "${extra_flags} /fp:precise")

#Multibyte character sets macro.
set(extra_flags "${extra_flags} /D \"_MBCS\"")

#Enables you to provide internal compiler error (ICE) information directly to the Visual C++ team.
set(extra_flags "${extra_flags} /errorReport:prompt")

#Treats warnings as errors.
set(extra_flags "${extra_flags} /WX")

#Generates intrinsic functions.
set(extra_flags "${extra_flags} /Oi")

#Specifies the model of exception handling.
set(extra_flags "${extra_flags} /EHsc")

#Creates an object file.
set(extra_flags "${extra_flags} /Fo")

#Marks an executable as verified to be compatible with the Windows Data Execution Prevention feature.
#set(extra_flags "${extra_flags} /NXCOMPAT")

# yasmine's preprocessor definitions
set(Y_OPTIMIZE "SPEED" CACHE STRING "Sets the optimize type. Supported values: SPEED and SIZE. Default value is SPEED.")
if( "${Y_OPTIMIZE}" STREQUAL "SIZE" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"Y_OPTIMIZE_4_SIZE\"")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"Y_OPTIMIZE_4_SPEED\"")
endif()

option("Y_NO_LOGGING" "Use when you want to use no logging at all (no logging code is created).")
if( "${Y_NO_LOGGING}" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"Y_NO_LOGGING\"")
endif()

option("Y_NO_STD_MAKE_UNIQUE" "When the standard make_unique is not available (e.g. no C++14 support), you have to define this preprocessor definition. A yasmine drop-in replacement template will be used instead then.")
if( "${Y_NO_STD_MAKE_UNIQUE}" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"Y_NO_STD_MAKE_UNIQUE\"")
endif()

option("Y_LEAN_AND_MEAN" "If you compile the library with Y_LEAN_AND_MEAN being defined or if you define the macro locally before including yasmine.hpp, all the state pseudostates and the asynchronous simple state (with the asynchronous behavior) are excluded (i.e. those headers are not included). This can reduce compile time.")
if( "${Y_LEAN_AND_MEAN}" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"Y_LEAN_AND_MEAN\"")
endif()

option("Y_PROFILER" "If Y_PROFILER is defined, the state machine will count the number of events that were processed. The user can query the counter by calling the 'get_number_of_processed_events' method.")
if( "${Y_PROFILER}" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"Y_PROFILER\"")
endif()

endif()

# for release
if( "${CMAKE_BUILD_TYPE}" STREQUAL "Release" )
#Creates fast code.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")

#Controls LINK optimizations.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /OPT:REF /OPT:ICF")

# for debug
elseif( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" )
#Creates a program database (PDB) file.
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /PDB")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${extra_flags}")

add_executable(classic_farmroad ${classic_farmroad_SRC})
include_directories("./../../libyasmine/include")

#using boost
if("${CPP_VERSION}" STREQUAL "03")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
link_directories("${Y_BOOST_LIB_PATH}")
endif()
endif()


if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if("${CPP_VERSION}" STREQUAL "03")
target_link_libraries (classic_farmroad LINK_PUBLIC libyasmine pthread boost_system boost_thread boost_chrono boost_random)
else()
target_link_libraries (classic_farmroad LINK_PUBLIC libyasmine pthread)
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_link_libraries (classic_farmroad LINK_PUBLIC libyasmine)
endif()


if("${CPP_VERSION}" STREQUAL "03")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(Boost_USE_STATIC_LIBS ON)
SET(BOOST_ROOT "${Y_BOOST_LIB_INCLUDE}")
SET(Boost_INCLUDE_DIRS "${Y_BOOST_LIB_INCLUDE}")
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(classic_farmroad LINK_PUBLIC ${Boost_LIBRARIES})
endif()
endif()

install(TARGETS classic_farmroad DESTINATION bin)
Loading

0 comments on commit 4c04c71

Please sign in to comment.