Skip to content

Commit

Permalink
genesis 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SeadexTM committed May 10, 2023
1 parent d774c5e commit 2a84ccf
Show file tree
Hide file tree
Showing 186 changed files with 6,720 additions and 5,194 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,8 @@ Generated\ Files/
*.pidb
*.svclog
*.scc
*.VC.db
*.VC.db


# Node.js modules
node_modules
Empty file added .gitmodules
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)

if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
Expand All @@ -7,7 +7,7 @@ endif()
# Seadex preprocessor definitions


option("SX_NO_LOGGING" "Use when you want to use no logging at all (no logging code is created).")
option("SX_NO_LOGGING" "Use if you don't want to use logging at all (no logging code is created).")
if( "${SX_NO_LOGGING}" )
set(extra_flags "${extra_flags} -D \"SX_NO_LOGGING\"")
message(STATUS "No logging used.")
Expand All @@ -16,14 +16,14 @@ else()
endif()


option("SX_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.")
option("SX_NO_STD_MAKE_UNIQUE" "When std::make_unique is not available (e.g. no C++14 support), you have to set this preprocessor definition. A yasmine drop-in replacement template will be used then instead.")
if( "${SX_NO_STD_MAKE_UNIQUE}" )
set(extra_flags "${extra_flags} -D \"SX_NO_STD_MAKE_UNIQUE\"")
message(STATUS "SX_NO_STD_MAKE_UNIQUE is defined.")
endif()


option("SX_GCC_EXPAND_TEMPLATE_PARAM_PACK_BUG" "Sets to use a workaround for bug in GCC with expansion of template parameter pack that appears in a lambda-expression (bug reported for GCC 4.8.4)")
option("SX_GCC_EXPAND_TEMPLATE_PARAM_PACK_BUG" "Use a workaround for a bug in GCC with the expansion of a template parameter pack that appears in a lambda-expression (bug reported for GCC 4.8.4)")
if( "${SX_GCC_EXPAND_TEMPLATE_PARAM_PACK_BUG}" )
set(extra_flags "${extra_flags} -D \"SX_GCC_EXPAND_TEMPLATE_PARAM_PACK_BUG\"")
message(STATUS "SX_GCC_EXPAND_TEMPLATE_PARAM_PACK_BUG is defined.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)

if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()

add_compiler_flag("-Wall")

if(NOT DEFINED CPP_VERSION)
set(CPP_VERSION "17")
elseif("${CPP_VERSION}" STREQUAL "03")
message(SEND_ERROR "Error: C++03 is no longer supported!")
endif()


if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
#gcc/clang compiler flags

if(DEFINED CPP_VERSION AND "${CPP_VERSION}" STREQUAL "03")
message(SEND_ERROR "Error: C++03 is no longer supported!")
endif()


#gcc/clang compiler flags
if(NOT "SX_PEDANTIC" STREQUAL "OFF")
add_compiler_flag("-pedantic")
endif()

if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
add_compiler_flag("-g")
endif()

if("${CPP_VERSION}" STREQUAL "03")
add_compiler_flag("-std=c++03")
add_compiler_flag("-D \"SX_CPP03_BOOST\"")
add_compiler_flag("-D \"SX_NO_VARIADIC_MACRO\"")
elseif("${CPP_VERSION}" STREQUAL "03")
add_compiler_flag("-std=c++14")
# for release
if( "${CMAKE_BUILD_TYPE}" STREQUAL "Release" )
message(STATUS "Build release.")
add_compiler_flag("-s ")
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
message(STATUS "Build debug.")
else()
add_compiler_flag("-std=c++11")
add_compiler_flag("-D \"SX_NO_STD_MAKE_UNIQUE\"")
endif()

# platform
if( "${CMAKE_CXX_FLAGS}" STREQUAL "-m64" )
add_compiler_flag("-m64")
message(STATUS "setting platform x64")
elseif("${CMAKE_CXX_FLAGS}" STREQUAL "-m32")
add_compiler_flag("-m32")
message(STATUS "setting platform x86")
message(WARNING "No build type selected via CMAKE_BUILD_TYPE!")
endif()

add_compiler_flag("-std=c++${CPP_VERSION}")
endif()


if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Checks buffer security.
set(extra_flags "${extra_flags} /GS")
Expand Down Expand Up @@ -95,7 +95,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")


# for release
if( "${CMAKE_BUILD_TYPE}" STREQUAL "Release" )
if( "${CMAKE_BUILD_TYPE}" STREQUAL "Release" )
#Creates fast code.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /PDB-")
Expand All @@ -108,5 +108,10 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
#Creates a program database (PDB) file.
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /PDB")
endif()

endif()

add_compiler_flag("/std=c++${CPP_VERSION}")

endif()

set(CMAKE_CXX_STANDARD ${CPP_VERSION})
message(STATUS "C++ standard set to c++${CPP_VERSION}.")
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)

if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
Expand All @@ -12,11 +12,6 @@ function(use_pthread varName)
endfunction()


function(use_boost_libraries varName)
set(${varName} ${${varName}} ${Boost_LIBRARIES} PARENT_SCOPE)
endfunction()


function(add_library_for_linking varName libraryName)
set(${varName} ${${varName}} ${libraryName} PARENT_SCOPE)
endfunction()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)

include(CheckCXXCompilerFlag)

Expand Down
29 changes: 21 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
cmake_minimum_required(VERSION 3.8)

if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()

include(./CMakeHelpers/setVariables.cmake)
project(genesis_all)

include(./CMakeHelpers/addBoost.cmake)
include(./CMakeHelpers/functions.cmake)
include(./CMakeHelpers/functionsAddCompilerFlags.cmake)

add_subdirectory(externals)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D \"FMT_HEADER_ONLY\" -D \"SPDLOG_FMT_EXTERNAL\"")

if( (NOT "${FMT_LIB_INCLUDE}" STREQUAL "") AND (NOT "${FMT_LIB}" STREQUAL "") AND (NOT "${SPDLOG_LIB_INCLUDE}" STREQUAL "") AND (NOT "${SPDLOG_LIB}" STREQUAL "") AND (NOT "${ESSENTIALS_LIB_INCLUDE}" STREQUAL "") AND (NOT "${ESSENTIALS_LIB}" STREQUAL "") )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D \"SPDLOG_FMT_EXTERNAL\"")
message(STATUS "essentials library, libfmt or spdlog paths provided by user.")
else()
if(EXISTS "${PROJECT_SOURCE_DIR}/build/conan_toolchain.cmake")
message(STATUS "Using Conan.")
set(SPDLOG_FMT_EXTERNAL ON CACHE BOOL "")
else()
message(STATUS "Conan CMake file not present. Conan is not used.")
endif()
endif()

add_subdirectory(genesis)
add_subdirectory(examples)

if(GEN_BUILD_EXAMPLES AND EXISTS "${PROJECT_SOURCE_DIR}/examples")
message(STATUS "Build examples.")
add_subdirectory(examples)
endif()
34 changes: 0 additions & 34 deletions CmakeHelpers/addBoost.cmake

This file was deleted.

30 changes: 0 additions & 30 deletions CmakeHelpers/addSeadexOptions.cmake

This file was deleted.

112 changes: 0 additions & 112 deletions CmakeHelpers/addSpecificFlags.cmake

This file was deleted.

Loading

0 comments on commit 2a84ccf

Please sign in to comment.