Skip to content

Commit 439ae00

Browse files
r4z396GAIGResearchmaichmuellerCommanderCeroegg-west
authored
Fixed python extension modules built for the wrong python version+ Added effects packs + Fixed mac errors(M1 arm64 and x64) + Updated and reorganized python bindings + Added BUILD_SFML_FROM_SOURCE (#128)
* Fixed python reference * Enable by default STRATEGA_BUILD_BINDINGS * Disabled friendly fire by default * Added agents example to python folder * Disabled STRATEGA_BUILD_BINDINGS by default * Added workflows (Builds + Python wheels build)+ Fixed python references in docs + Added generation of python wheels and pypi publishing + Added release creation + Fixed errors in Mac and Linux + Downgraded code to make binary compatible with most Linux distros (#86) * Update README.md * setup * Fixed file paths errors in python + Setup pypi files * Reorganized folders and names * Updated necessary files to upload package to pypi * Updated classifiers * Create wheels.yml * Workflow test * Updated wheels file * Minimal example test * Removed ubuntu from actions * Removed mac * Updated wheels * Updated new wheels only windows * Fixed build dist * Fixed calling wrong job * Changed setup.py * Added ubuntu and mac builds * Removed incompatible builds with SFML + Added Linux dependencies * Added more libraries for Linux + Fixed error for Mac * Change Macos deployment target 10.14 * Disable pp37-win_amd64 build + Changed macos deployment target to 10.15 * Disabled pp37 in macos and linux builds * Fix wheels startup fail * Minimal wheels builts + setup cmake for linux * Added configure cmake for linux * Moved steps for Linux * Cleaned wheels * Try to fix macos find wheels error * Check Linux build with static sfml library * Moved step in linux under configuring cibuildwheels * Added more libraries for linux * Added more libraries * Added more libraries * Added -y to command * Added new linux config and reorganized linux libraries * Remove default linux cmake config and moved to cibw enviroment * Moved linux cmake options * Updated wheels * Changed CIBW_BEFORE_ALL_COMMON * Reorganized wheels * Updated wheels * Updated wheels * Fixed Linux error LevelDefinition * Changed linux target * Removed CIBW_BEFORE_ALL_COMMON * Fixed commands calls * Updated wheels * Updated wheels * Updated wheels * Added Linux configure and build test * Added <cmath> to solve Linux errors * set CMAKE_CXX_STANDARD_REQUIRED ON * Install gcc-10 g++-10 * Fixed command * Include memory and lower the amout of linux libraries * Updated wheels * Added more #include <memory> * Added #include <memory> in EntityPlacement * Removed install linux gcc and g++10 * Disable LTO for pybind * Added CFLAGS='-fPIC' CXXFLAGS='-fPIC' * Updated CMakeList * Added -fPIC to CMakeList * Install linux dependiencies in docker image * Updated wheels * Moved Before build to Before all * Updated wheels * Remove command sudo * Changed apt-get to yum * Changed manylinux docker image to 2014 * Changed to manylinus debian 9 based * Removed sudo error * Added all linux libraries * Changed libraries * Added library libfreetype6 debian 9 based * Added apt install gcc-10 g++-10 * Updated to Ubuntu 20.04 * Changed to manylinux2014 * Test mac and windows * Second test windows and mac * Third test windows and mac * Build mac and linux with Python 3.7, 3.8, 3.9 * Check if the last job finds the generated wheels * Fourth test windows and mac * Build mac and linux with Python 3.7, 3.8, 3.9 and 3.10 * Ubuntu test * Removed libraries * Removed more libraries * Removed libraries * Removed more libraries * Removed libraries * Removed all libraries * Added libraries and package index * Linux test installing libraries * Changed to before all * Added -y to linux build * Test all libraries * Install x11 libraries * Changed to debian 9 * Test running c++17 standard * Removed #include <variant> * set CMAKE_CXX_STANDARD_REQUIRED ON * Testing with centOS * New test * Test with optional_lite * Changed to debian 9 * Removed #include <optional> in timer * Test removing std::sample * Added delete to copy constructor ITreeNode * Try to remove ITreeNode error * Test without nodes * Downgraded to C++14 for manylinux compability * Changed insert_or_assign * Removed #include <filesystem> * Cleaned wheels * Test windows and mac * Test manylinux python 3.7 * Build cp37-manylinux_x86_64 * Test cmake change * Fixed setp and cmakelist * Fixed CmakeList * Check if linux fails due to the output python module * Test removing stratega extra args * Build Mac, Windows and Linux * Disabled STRATEGA_BUILD_DOCS and build Mac, Linux and Win * Enabling STRATEGA_BUILD_BINDINGS from wheels * Test passing -DSTRATEGA_BUILD_BINDING to second cmake * Removed last command and removed build linux cp3.6 * Test linux * Added both options * Change set to option * Changed wheels * Updated wheels * Testing Mac, Win and Linux builds * Testing Linux with bindings off * Pass through CIBW_ENVIRONMENT * Cleaned wheels * Added -DSTRATEGA_BUILD_BINDINGS * Updated wheels * Test Linux * Fixed Wheels * Clean wheels * Updated wheels * Removed if * Testing updating wheels * Updated wheels * Build Mac, Linux and Win * Test build with TreeNodes * Test with MCTS * Test including to agentfactory MCTS * Test added all agents * Test ITreeNode * Updated ITreeNode * Updated ITreeNode * Cleaned code * Added new build CI + Edited readme * Fixed CI * Updated CI * Added Linux flags * Updated readme + Create release * Cleaned code + removed warnings Co-authored-by: GAIGResearch <35296018+GAIGResearch@users.noreply.github.com> * Updated readme badge links * fixed files for ubuntu compile * big refactor * Fixed function parameter not being assigned * further refactoring and cmake cleanup/setup * renames * working cmake refactoring potential errors with yaml-cpp handling remain * add ci action * test workflow * test workflow * typo fix * test workflow * typo * debug workflow * debug wf * debug * debug * debug * debug * debug * debug * debug * debug * add dependencies to linux run * typo fix * more cmake fixes * small change in devtoolscmake * move targets to respective subfolder * rearrange gui target slightly * update wf * rm gcc11 from wf * rm ctest enabling * rm altera clang-tidy checks * move remaining options to top cmakelists level * Added CTest + Bunch of new test * Added test structure + Call test from CI * Run test in windows fixed * Added bunch of new test * Added more Arena and GameRunner test * Changed test directory * Added missing configuration * Changed configuration type depending on the matrix * Changed shell * Removed CMAKE_BUILD_TYPE * Fixed paths * Fixed ConfigurationTest loading wrong paths * Removed few test * Fixed Mac and Linux ctest * Cleaned test * Updated CI * Updated CI * Updated CI * Update CI * Update CI * Update CI * Removed error Dijkstra positions and Update CI * Updated ActionsTest * Updated yaml * Updated yaml and test * Updated ActionTest * Updated README * Cleaned README * readded enable_testing command * upgrade gtest to 1.11 * Fixed python errors + Added Game Renderer options * Moved assets to gameConfigs folder * Moved assets to new folder resources * Check if is local module resource or absolute * Load resources module path + Added manifest * Updated Manifest + Updated TBS games to new resources path * Cleaned main + Fixed BasicTBS errors with bad configuration * Added to RTS yamls the GameRenderer section + Updated rts yamls * Updated test resources paths * Refactored * deactivate warnings as errors in wf * fix test folder reorder * conan findable with conanpath var, changed yaml-cpp to v0.6.3 * Refactor the main structure and place dependency management into the hands of Conan * Started refactoring * Test * Added second Workflow * Test * Test * Test * Test * Test * Test * Test * Fixed tests * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test wheels * Test * Test * Test * Test * Test * Test Warnings * Test * Test Cmake 3.8 and find python * Test * Test * Test * Test * Test * Test * Fixed conan override outputs * Fixed python module generation * Test * Test * Cleaned workflows and cmakelist * Disable build docs by default * Added resources to python module + Updated python docs * Updated GameRenderer section + Updated mains loading correct default config * Updated installation docs * Disabled workflow wheels on push * Updated docs references + yamls * Added assets * Removed old assets * Fixed Linux, MacOS, Windows warnings * Started refactoring * Test * Added second Workflow * Test * Test * Test * Test * Test * Test * Test * Fixed tests * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test wheels * Test * Test * Test * Test * Test * Test Warnings * Test * Test Cmake 3.8 and find python * Test * Test * Test * Test * Test * Test * Fixed conan override outputs * Fixed python module generation * Test * Test * Cleaned workflows and cmakelist * Disable build docs by default * Added resources to python module + Updated python docs * Updated GameRenderer section + Updated mains loading correct default config * Updated installation docs * Disabled workflow wheels on push * W1 level fixed warnings * W2 level fixed warnings * W3 level fixed warnings + render error * Test warnings level w3 * Test warnings level w1 * Test * Test * Test * Testing * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * FIxed last windows errors w3 * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Cleaned code + Test wheels pybind enabled * Python wheel test * Test * Test * Test * Test * Test * Revert "Test" This reverts commit 2022a43. * Added buffs system + Added min, max and default definition of parameters + New KillTheKing with buffs game * Added buffs yaml structure * Add buff type and parse buffs from yaml * Finish basic buffs/debuffs * Apply buffs to player * Parse min, max and default parameters + Add min,max values to player and entities + Add modifyParameterEntity/Player to FM * Refactored buff system * Added new buff system to player and entities * Refactored FM * Removed substract and divide modifiers * Added new conditions * Restored KtK game + parameter read * Added KtK with buffs + Fixed parameter parsing * Refactored code + Added comments * Updated FM + Updated Effects * Merge branch 'dev' into feat_buffs * Test * Test * Test * Test * Test * Test * Test * Updated docs * Updated game configurations + Added new function parameter method + Fixed FM modify paramter methods * Enabled bindings * Fixed warnings * Test * Fixed warnings + Fixed main * Updated pypi version * Trigger github actions wheels on branches master and dev * Updated pypi version * Enabled wheels on push and on tag create * Updated parameter definition to min, default, max + Updated Games * Parse yaml nodes from different files * Cleaned files + Updated gitignore * Added yaml reference * Updated pypi version * Added gamestate parameters + Added OnAdvance trigger + Add PushThemAll, ConquerTheZone and CaptureTheFlag games * Added CaptureTheFlag base * Added new game CaptureTheFlag + Added parameters to GameState * Added new game ConquerTheZone + New conditions * Added PushThemAll + few effects and conditions * Added OnAdvanceEffect + Updated PushTheAll * Added Pusher Agent * Updated GameConfigs * Test * Update conquer the zone + Test * Test * Test * Test * Test * Test * Updated configs * Updated yaml referece + Added CaptureTheZone/CaptureTheFlag/PushThemAll docs * Updated yaml referece + Added CaptureTheZone/CaptureTheFlag/PushThemAll docs * Updated main * Isolate GUI files in headless mode + Added SGA_BUILD_HEADLESS option in CMakeList * Add headless compilation mode * Test * Test * Test * Test * Test * Test * Test * Copy the resource files in headless mode * Added new GUI system + Support top down sprites+ Support different entity/tiles sprites * Started refactoring * Test * Added second Workflow * Test * Test * Test * Test * Test * Test * Test * Fixed tests * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test wheels * Test * Test * Test * Test * Test * Test Warnings * Test * Test Cmake 3.8 and find python * Test * Test * Test * Test * Test * Test * Fixed conan override outputs * Fixed python module generation * Test * Test * Cleaned workflows and cmakelist * Disable build docs by default * Added resources to python module + Updated python docs * Updated GameRenderer section + Updated mains loading correct default config * Updated installation docs * Disabled workflow wheels on push * W1 level fixed warnings * W2 level fixed warnings * W3 level fixed warnings + render error * Test warnings level w3 * Test warnings level w1 * Test * Test * Test * Testing * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * FIxed last windows errors w3 * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Add ResourceManager & TextureAtlas * Debug grid * Added NewTBSGameRender base * Added SGA Drwable + Widget definition + World definition * Setup working widget system and World render * Tile rendering + Grid layout working * Added MouseInformationWisget + WorldControllerWidget + Entity rendering * Added EntityInformation widget * Added ActionController Base * Fixed Entities render * Added Player Information + Added GameState Information Widget + Added Possible Actions Widget * Render available actions + Fixed available actions windows + TBS waiting position * Added gamestate interpolation + Basic animations(Move, Dissappear and Appear) * Added draw outline color entities * Highlight entity over mouse * Fixed Delta time errors + Added to widget Grid Info Tiles information * Reduced interpolate times * Fixed actions controller only selecting entities from the player + Fixed animation system (Binary flags) * Added animation system info in WorldWidget * Added FOW state + Added FOW controller widget + Fixed close window error + Fixed get entity error mouse info widget * Added RTS compatibility to new GUI * Removed old GUI code * Added tick limit to RTS games * Fixed player continuous actions error * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Added render config tile/sprite origin definition and isometric grid check + Updated all the game configs * Fixed different Tiles and Entity sprites * Test errors * Test errors Co-authored-by: Dominik Jeurissen <10519507+CommanderCero@users.noreply.github.com> * Fixed logs scopes * Added object system + New game OpenTheDoor * Added yaml object definition * Added basic object interation * Added Inventory conditions * Added Object and SlotObject action target and function parameter stuff +Few effects (Equip, UnEquipe obejct) and conditions(CanEquip) * Show GridInformationWidget while there is selected entities * Added slots information on GridInformationWidget + Added slots in used to condition CanEquip * Added OnTickActions to Objects * Added OnUseInventory, OnUseSlot, OnAddedInventory and OnEquip effects/conditions * Updated bread sprite + Updated GridInformation widget * Fixed World renderer not dissapearing objects * Added base OpenTheDoor * Fixed action target generation action space (Objects and SlotObject) * Refactored effects and conditions object * Added drop object effect * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Test errors * Fixed OpenTheDoor game * Fixed bindings * Added Object bindings * Recovered original KtK game + Added key sprite + Fixed OpenTheDoor game + Fixed games without objects parsing error * Added OpenTheDoor to docs + Updated docs yaml reference + Updated Gamerenderer docs * Updated OpenTheDoor game config * Disabled ENABLE_BUILD_DOCS by default * Added new logging structure * Updated new logging structure * Updated docs * Updated KTK base game + Added noise to OSLAAgent * Fixed entities moving to (0,0) in RTS + Fixed assigning multiple player actions to a entity in the same tick * Fixed and updated CPP docs * Fixed warning * Updated cmake-conan to 0.17.0 * Fixed cpp reference docs * Test * Test * Test * Test * Test * Test * Test * Test * Test * Cleaned * Fixed non consistent parameter values in different computers + Added boost::random to obtain consistent results in different computers + Changed arena output log * create KTKCombatAgent * create unitMCTS and relavant MDP Homomorphism * [DEBUG] add generateUnitActions * try to add Empty Action * fixedBug in KTKCombatAgent causing unordered_map invalid key * Apocrita complain about getName function for heuristic * change heuristic of MCTS, fixedBug infinite loop caused by continueSearch=True * fixedBug MCTSAgent infinite loop when continueSearch=true * fixedBug in UnitMCTS * Revert "Merge branch 'dev' into feat_homo" This reverts commit f934cae, reversing changes made to 55fa8a1. * Fixed logs scopes * make log like the old version * dont know what changed * Fixed non consistent parameter values in different computers + Added boost::random to obtain consistent results in different computers * Reduce maps for testing * Test OSLA agents * Test with KTKCombatAgent vs OSLAAgent * Test agents * Added log info * Added more info * Added more log information * Test info inrange * Check which parameter InRange is receiving * Fixed print entity info method + Check the initial parameters of the entities * Test new entity parameter init * Revert "Test new entity parameter init" This reverts commit 0c3840a. * Test changed vector to unordered_map * print console the current agent seed * Added info action random agent + Changed action types number to map * Added more debug info * Added boost random to deterministic results between different machines * Fixed linux conan file * Test boost fix * Test lower version boost * Test build everything * Changed Random to Osla + Changed moved action to use Dijsktra * Removed temporal debug console info + Changed agents to UnitMCTS vs KTKCombat * Removed Dijkstra to check number of actions * Removed UnitMCTS for the RandomAgent * Added MCTSAgent info + Reduced search * Added some more debug info to MCTS * Removed noise method * Remove noise 2 * KTK vs MCTS + added action index debug info * Restored files before merge * Test boost library components * Added more components * Added atomic component * Test * Enabled chrono component * Added container component * Added date_time component * Removed numpy from linux * Added more components * Just compile everything in linux * Solved binding error * add alex_test.yaml maps for KillTheKing * fix naming of map ymal file * Added back GUI * Fixed OSLA * Reorganized GUI * Fixed render * Restored games * Restored Arena * Added back RTS tick limit * Enabled python binds * Updated player * Fixed player * Fixed player * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test Co-authored-by: egg-west <708829300@qq.com> * Added expressions (#115) * Add cparse library * Fix cparse lib * Parse simply expression * Parse expression from yaml * Parse and execute expressions * Debug info + updated KTK * Parse and execute dice parameter * Test * Parse correct expression parameters * Changed back to union * Change back to union * Added cost expression parsing * Check entity cost * Restored games * Updated tutorial docs game * Test * Test * Test * Test * Test * Removed debug info * Merge branch 'dev' into feat_expressions * Test * Fixed player continuous actions * Added additional entity placements * Fixed animations loop * Add parameters to tiles * Added parameters to tiles structure * Added tile parameters structure * Added Tile target to action generation + Target target parse * Fixed GUI tile assign * Fixed valid targets * Fixed include vector * Restore KTK game * Added multiple tile entities * Reorganized getentities by pos methods + Parse entity grid level * Added new getEntities methods + Render world entities depending the grid level * Fixed getEntities methods + Added multiple conditions to check isOccupied * Updated all games + Fixed multiple entities in same tile errors * Added grids yaml definition * Reset KTK * Updated additional entity placements yaml definition * Fixed rendering drawables sorted * Added player and entities action queues * Added player action queue * Added ActionQueue class + Entity queue actions * Test zlib update * Added Queue action to GUI + Solved entity action queue error * Test * Added new games (Pathway, Into the breach and The battle of Stratega) * Add cparse library * Fix cparse lib * Parse simply expression * Parse expression from yaml * Parse and execute expressions * Debug info + updated KTK * Parse and execute dice parameter * Test * Parse correct expression parameters * Changed back to union * Change back to union * Added cost expression parsing * Check entity cost * Restored games * Updated tutorial docs game * Test * Test * Test * Test * Test * Removed debug info * Merge branch 'dev' into feat_expressions * Test * Added Into the breach game * Finished Into the breach * Add basic functions pathway * Completed Into the breach * Added rand and fixed function parser to allow , in methods * Added pathway elements * Fixed player continious actions + Fixed condition + Finish Pathway + Added TheBattleOfStratega * Reorganized games * Fixed main game * Fixed games new paths * Finished The battle of stratega * Fixed entity queue gui actions * Added inbuilt end turn action type + Added Into the breach spawn start actions * Added start spawn actions to Pathway * Fixed player actions GUI + Updated all game configs + Added new game configs (Into the breach, pathway and The battle of stratega) * Fixed RTS games + Fixed binding * Updated main game * Reorganized GUI * Fixed python extension modules built for the wrong python version (#123) * Test * Test * Test * Test * Test toml old setuptools * Test * Test min cp3.7 * Test build cp37 and cp38 * Added 3.9, 3.10 and 3.8 builds * Removed pp37 wheels * Updated wheels * Removed not compatible python wheels * Added effects packs (SampleEffect, RandomEffect and Conditional Effect) (#125) * Parse effects recursive * Entity sampling effects works * Added effect pack types * Added conditional and random effects * Updated effects structure * Cleaned and test effects * Fixed mac errors(M1 arm64 and x64) (#126) * Test * Test * Test shared * Test * Test * Test * Revert "Test" This reverts commit cbca9c1. * Test * Test * Test * Test * Test * Test * Test * Test * Test 2.6.0 sfml with mac * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test * Test Mac M1 * Test Mac M1 * Test * Test intel Mac * Test * Test Warnings * Test Warnings * Test * Test * Test Warnings * Test Warnings * Reorganized * Updated and reorganized python bindings + Added BUILD_SFML_FROM_SOURCE option (#127) * Reorganized files * Restructured and updated python bindings * Removed test agents.py * Test wheels * Test added SGA_BUILD_SFML_FROM_SOURCE + Fixed OpenTheDoor gameconfig * Fixed conanfiles * Test build SFML from source * Removed Linux conan sfml package * Fix Linux * Updated agents script with fixed paths Co-authored-by: GAIGResearch <35296018+GAIGResearch@users.noreply.github.com> Co-authored-by: der4twu <m.aichmueller@gmail.com> Co-authored-by: Dominik Jeurissen <10519507+CommanderCero@users.noreply.github.com> Co-authored-by: egg-west <708829300@qq.com>
1 parent 61fa072 commit 439ae00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2566
-1630
lines changed

.github/workflows/wheels-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Python Wheel Builds (TEST)
33
on:
44
push:
55
branches:
6-
- fix_python_wheels
6+
- update_bindings
77
env:
88
CIBW_SKIP: pp39-win_amd64 pp39-macosx_x86_64 pp39-manylinux_x86_64 pp38-win_amd64 pp38-macosx_x86_64 pp38-manylinux_x86_64 cp36-manylinux_x86_64 cp36-win_amd64 cp36-macosx_x86_64 pp37-win_amd64 pp37-macosx_x86_64 pp37-manylinux_x86_64 pp37-win_amd64
99
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_24_x86_64:latest

CMakeLists.txt

+59-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
cmake_minimum_required(VERSION 3.18)
2+
project(Stratega LANGUAGES C CXX)
23

3-
project(Stratega LANGUAGES CXX)
4+
#Uncomment if building for Apple
5+
#project(Stratega LANGUAGES C CXX OBJCXX OBJC)
6+
#enable_language(OBJC)
7+
#enable_language(OBJCXX)
8+
9+
#Uncomment if building for Apple with M1 arch arm64
10+
#set (CMAKE_OSX_ARCHITECTURES "arm64")
411

512
# project set'tings
613
set(CMAKE_CONFIG_FOLDER "cmake")
714
set(CMAKE_CXX_STANDARD_REQUIRED True)
815
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
9-
if (CMAKE_SYSTEM_NAME MATCHES Linux)
10-
set(CONANFILE conanfile_linux.txt)
11-
else ()
12-
set(CONANFILE conanfile.txt)
13-
endif ()
16+
17+
1418
set(DEPENDENCY_DIR "deps")
1519
set(PROJ_CXX_STD_FEATURE cxx_std_14)
1620
set(PROJ_CXX_STANDARD C++14)
@@ -51,6 +55,35 @@ option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors (If ENABLE_STRATEGA
5155

5256
option(SGA_BUILD_HEADLESS "Compile Stratega in headless mode" OFF)
5357

58+
# If you are building for MacOS with M1,this option should be ON
59+
option(SGA_BUILD_SFML_FROM_SOURCE "Compile SFML 2.6.x" OFF)
60+
61+
62+
# On linux SFML is not (yet) available from conan due to a missing lib dependency in their recipe.
63+
# We will have to fetch it manually in this case and add it to our project.
64+
if (CMAKE_SYSTEM_NAME MATCHES Linux)
65+
set(CONANFILE conanfile_linux.txt)
66+
message(STATUS "running on Linux conanfile_linux")
67+
elseif (CMAKE_SYSTEM_NAME MATCHES Darwin)
68+
69+
if (NOT SGA_BUILD_SFML_FROM_SOURCE)
70+
set(CONANFILE conanfile_mac_sfml.txt)
71+
message(STATUS "running on Mac conanfile_mac_sfml")
72+
else()
73+
set(CONANFILE conanfile_mac.txt)
74+
message(STATUS "running on Mac conanfile_mac")
75+
endif()
76+
else ()
77+
78+
if (NOT SGA_BUILD_SFML_FROM_SOURCE)
79+
set(CONANFILE conanfile_windows_sfml.txt)
80+
message(STATUS "running on Windows conanfile_sfml")
81+
else()
82+
set(CONANFILE conanfile_windows.txt)
83+
message(STATUS "running on Windows conanfile_windows")
84+
endif()
85+
endif ()
86+
5487
#If CMAKE_NO_SYSTEM_FROM_IMPORTED is OFF, pybind11 should be treated as SYSTEM and it should not throw warnings
5588
#but it does for some reason that we dont know.
5689
#The temporal solution for this problem is to disable the warnings when we want to build the pyhton bindings
@@ -117,10 +150,23 @@ include(${CMAKE_CONFIG_FOLDER}/settings/StaticAnalyzers.cmake)
117150

118151
# configure conan and fetch all dependencies
119152
if(NOT SGA_BUILD_HEADLESS)
120-
if (CMAKE_SYSTEM_NAME MATCHES Linux)
121153
# on linux SFML is not (yet) available from conan due to a missing lib dependency in their recipe.
122154
# We will have to fetch it manually in this case and add it to our project.
123-
include(${CMAKE_CONFIG_FOLDER}/modules/FetchSFML.cmake)
155+
if (SGA_BUILD_SFML_FROM_SOURCE OR CMAKE_SYSTEM_NAME MATCHES Linux)
156+
include(${CMAKE_CONFIG_FOLDER}/modules/FetchSFML.cmake)
157+
message(STATUS "FetchSFML 2.6.x")
158+
#if (CMAKE_SYSTEM_NAME MATCHES Linux)
159+
## # on linux SFML is not (yet) available from conan due to a missing lib dependency in their recipe.
160+
## # We will have to fetch it manually in this case and add it to our project.
161+
#include(${CMAKE_CONFIG_FOLDER}/modules/FetchSFML.cmake)
162+
#message(STATUS "running on Linux FetchSFML")
163+
#elseif (CMAKE_SYSTEM_NAME MATCHES Darwin)
164+
## #MacOS
165+
# include(${CMAKE_CONFIG_FOLDER}/modules/FetchSFML.cmake)
166+
# message(STATUS "running on Mac FetchSFML")
167+
#endif ()
168+
else()
169+
message(STATUS "NO FetchSFML 2.6.x")
124170
endif ()
125171
include(${CMAKE_CONFIG_FOLDER}/modules/FetchIMGUI-SFML.cmake)
126172
else()
@@ -144,8 +190,10 @@ find_package(Threads)
144190
if(NOT SGA_BUILD_HEADLESS)
145191
find_package(imgui REQUIRED)
146192
find_package(OpenGL REQUIRED)
147-
if (CMAKE_SYSTEM_NAME MATCHES Linux)
193+
if (SGA_BUILD_SFML_FROM_SOURCE OR CMAKE_SYSTEM_NAME MATCHES Linux)
148194
add_subdirectory(${sfml_SOURCE_DIR} ${sfml_BINARY_DIR} EXCLUDE_FROM_ALL)
195+
#find_package(SFML COMPONENTS system window graphics REQUIRED)
196+
#find_package(SFML 2.6 COMPONENTS system window graphics REQUIRED)
149197
else ()
150198
find_package(SFML COMPONENTS system window graphics REQUIRED)
151199
endif ()
@@ -156,10 +204,11 @@ find_package(yaml-cpp REQUIRED)
156204
find_package(recastnavigation REQUIRED)
157205

158206

207+
159208
# define the targets of the project
160209
if(NOT SGA_BUILD_HEADLESS)
161210
include(${CMAKE_CONFIG_FOLDER}/targets/IMGUI.cmake)
162-
include(${CMAKE_CONFIG_FOLDER}/targets/GUI.cmake)
211+
include(${CMAKE_CONFIG_FOLDER}/targets/GUI.cmake)
163212
endif()
164213

165214
include(${CMAKE_CONFIG_FOLDER}/targets/Arena.cmake)

cmake/modules/FetchIMGUI-SFML.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include(FetchContent)
22

3-
set(IMGUI-SFML_VERSION 2.3)
3+
set(IMGUI-SFML_VERSION 2.5)
44
FetchContent_Declare (
55
imgui-sfml
66
URL "https://github.com/eliasdaler/imgui-sfml/archive/refs/tags/v${IMGUI-SFML_VERSION}.zip"

cmake/modules/FetchSFML.cmake

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ include(FetchContent)
33
set(SFML_VERSION 2.5.1)
44
FetchContent_Declare (
55
sfml
6-
URL "https://github.com/SFML/SFML/archive/${SFML_VERSION}.zip"
6+
#URL "https://github.com/SFML/SFML/archive/${SFML_VERSION}.zip"
7+
URL "https://codeload.github.com/SFML/SFML/zip/refs/heads/2.6.x"
78
)
89
FetchContent_GetProperties(sfml)
910
if(NOT sfml_POPULATED)
1011
FetchContent_Populate(sfml)
1112
set(SFML_BUILD_NETWORK CACHE BOOL FALSE)
1213
set(SFML_BUILD_AUDIO CACHE BOOL FALSE)
13-
set(SFML_STATIC_LIBRARIES TRUE)
14-
# set(imgui-sfml_SOURCE_DIR ${sfml_SOURCE_DIR} PARENT_SCOPE)
15-
# set(imgui-sfml_BINARY_DIR ${sfml_BINARY_DIR} PARENT_SCOPE)
16-
endif()
14+
endif()

cmake/settings/Conan.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ macro(run_conan)
1414
https://api.bintray.com/conan/bincrafters/public-conan)
1515

1616
conan_cmake_run(
17+
#Uncomment if building for M1 Apple
18+
#ARCH armv8
1719
CONANFILE ${DEPENDENCY_DIR}/${CONANFILE}
1820
CONAN_COMMAND ${CONAN_PATH}
1921
${CONAN_EXTRA_REQUIRES}

cmake/targets/GUI.cmake

+42-13
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,49 @@ set(GUI_SOURCE_FILES
55
list(TRANSFORM GUI_SOURCE_FILES PREPEND "${SUBPROJ_GUI_SRC_DIR}/")
66

77
add_executable (gui ${GUI_SOURCE_FILES})
8-
98
target_include_directories(gui PUBLIC ${SUBPROJ_STRATEGA_INCLUDE_DIR})
109

11-
target_link_libraries(gui
12-
PUBLIC
13-
Stratega
14-
PRIVATE
15-
# other platforms use Conan's `sfml`
16-
"$<$<NOT:$<PLATFORM_ID:Linux>>:CONAN_PKG::sfml>"
17-
# for linux we have to use the targets of `sfml`'s components individually
18-
"$<$<PLATFORM_ID:Linux>:sfml-system>"
19-
"$<$<PLATFORM_ID:Linux>:sfml-graphics>"
20-
"$<$<PLATFORM_ID:Linux>:sfml-window>"
21-
)
10+
11+
if(SGA_BUILD_SFML_FROM_SOURCE OR CMAKE_SYSTEM_NAME MATCHES Linux)
12+
target_link_libraries(gui
13+
PUBLIC
14+
Stratega
15+
PRIVATE
16+
# other platforms use Conan's `sfml`
17+
# for mac we have to use the targets of `sfml`'s components individually
18+
#"$<$<PLATFORM_ID:Windows>:CONAN_PKG::sfml>"
19+
20+
sfml-system
21+
sfml-graphics
22+
sfml-window
23+
24+
## for linux we have to use the targets of `sfml`'s components individually
25+
#"$<$<PLATFORM_ID:Linux>:sfml-system>"
26+
#"$<$<PLATFORM_ID:Linux>:sfml-graphics>"
27+
#"$<$<PLATFORM_ID:Linux>:sfml-window>"
28+
)
29+
else()
30+
target_link_libraries(gui
31+
PUBLIC
32+
Stratega
33+
PRIVATE
34+
# other platforms use Conan's `sfml`
35+
# for mac we have to use the targets of `sfml`'s components individually
36+
#"$<$<PLATFORM_ID:Windows>:CONAN_PKG::sfml>"
37+
#
38+
#"$<$<PLATFORM_ID:Darwin>:sfml-system>"
39+
#"$<$<PLATFORM_ID:Darwin>:sfml-graphics>"
40+
#"$<$<PLATFORM_ID:Darwin>:sfml-window>"
41+
#
42+
## for linux we have to use the targets of `sfml`'s components individually
43+
#"$<$<PLATFORM_ID:Linux>:sfml-system>"
44+
#"$<$<PLATFORM_ID:Linux>:sfml-graphics>"
45+
#"$<$<PLATFORM_ID:Linux>:sfml-window>"
46+
47+
CONAN_PKG::sfml
48+
)
49+
endif()
50+
2251

2352

2453

@@ -37,4 +66,4 @@ set_target_properties(gui PROPERTIES
3766
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${RUNTIME_OUTPUT_DIRECTORY}
3867
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${ARCHIVE_OUTPUT_DIRECTORY}
3968
EXECUTABLE_OUTPUT_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_DIRECTORY}
40-
)
69+
)

cmake/targets/IMGUI.cmake

+14-2
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,29 @@ list(TRANSFORM IMGUI_SOURCE_FILES PREPEND "${imgui-sfml_SOURCE_DIR}/")
66

77
add_library(imgui STATIC ${IMGUI_SOURCE_FILES})
88
target_include_directories(imgui PUBLIC ${imgui-sfml_SOURCE_DIR})
9+
910
target_link_libraries(imgui
1011
PRIVATE
1112
CONAN_PKG::imgui
1213
# other platforms use Conan's `sfml`
13-
"$<$<NOT:$<PLATFORM_ID:Linux>>:CONAN_PKG::sfml>"
14-
"$<$<PLATFORM_ID:Linux>:OpenGL>"
14+
"$<$<PLATFORM_ID:Darwin>:CONAN_PKG::opengl>"
15+
#OpenGL
16+
"$<$<PLATFORM_ID:Linux>:CONAN_PKG::opengl>"
1517
"$<$<PLATFORM_ID:Windows>:CONAN_PKG::opengl>"
18+
#"$<$<PLATFORM_ID:Windows>:CONAN_PKG::sfml>"
19+
#CONAN_PKG::sfml
1620
#"$<$<NOT:$<PLATFORM_ID:Linux>>:CONAN_PKG::opengl>"
1721
# for linux we have to use the targets of `sfml`'s components individually
1822
"$<$<PLATFORM_ID:Linux>:sfml-system>"
1923
"$<$<PLATFORM_ID:Linux>:sfml-graphics>"
2024
"$<$<PLATFORM_ID:Linux>:sfml-window>"
25+
26+
"$<$<PLATFORM_ID:Darwin>:sfml-system>"
27+
"$<$<PLATFORM_ID:Darwin>:sfml-graphics>"
28+
"$<$<PLATFORM_ID:Darwin>:sfml-window>"
29+
30+
sfml-system
31+
sfml-graphics
32+
sfml-window
2133
#CONAN_PKG::opengl
2234
)

cmake/targets/Stratega.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ if(NOT SGA_BUILD_HEADLESS)
136136
target_link_libraries_system(Stratega CONAN_PKG::imgui)
137137
target_link_libraries_system(Stratega imgui)
138138

139-
if(UNIX AND NOT APPLE)
139+
#if(UNIX AND NOT APPLE)
140+
if(SGA_BUILD_SFML_FROM_SOURCE OR CMAKE_SYSTEM_NAME MATCHES Linux)
140141
target_link_libraries_system(Stratega sfml-system)
141142
target_link_libraries_system(Stratega sfml-graphics)
142143
target_link_libraries_system(Stratega sfml-window)

deps/conanfile_linux.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[requires]
22
zlib/1.2.12
33
gtest/1.11.0
4+
opengl/system
45
pybind11/2.6.1
56
recastnavigation/cci.20200511
67
yaml-cpp/0.7.0
@@ -9,13 +10,12 @@ doxygen/1.9.2
910
boost/1.78.0
1011

1112
[options]
12-
sfml:graphics=True
13-
sfml:window=True
14-
sfml:audio=False
15-
sfml:network=False
1613
boost:shared=False
1714

1815
[generators]
1916
cmake
2017
cmake_find_package
21-
cmake_paths
18+
cmake_paths
19+
20+
[imports]
21+
lib, *.dylib* -> ./bin

deps/conanfile_mac.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[requires]
2+
zlib/1.2.12
3+
opengl/system
4+
gtest/1.11.0
5+
pybind11/2.6.1
6+
recastnavigation/cci.20200511
7+
yaml-cpp/0.7.0
8+
imgui/1.84.2
9+
doxygen/1.9.2
10+
boost/1.78.0
11+
12+
[options]
13+
boost:shared=False
14+
15+
[generators]
16+
cmake
17+
cmake_find_package
18+
cmake_paths
19+
20+
[imports]
21+
lib, *.dylib* -> ./bin

deps/conanfile_mac_sfml.txt

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[requires]
2+
zlib/1.2.12
3+
opengl/system
4+
sfml/2.5.1
5+
gtest/1.11.0
6+
pybind11/2.6.1
7+
recastnavigation/cci.20200511
8+
yaml-cpp/0.7.0
9+
imgui/1.84.2
10+
doxygen/1.9.2
11+
boost/1.78.0
12+
13+
[options]
14+
boost:shared=False
15+
sfml:graphics=True
16+
sfml:window=True
17+
sfml:audio=False
18+
sfml:network=False
19+
boost:shared=False
20+
boost:without_atomic=True
21+
boost:without_chrono=True
22+
boost:without_container=True
23+
boost:without_context=True
24+
boost:without_contract=True
25+
boost:without_coroutine=True
26+
boost:without_date_time=True
27+
boost:without_exception=True
28+
boost:without_fiber=True
29+
boost:without_filesystem=True
30+
boost:without_graph=True
31+
boost:without_graph_parallel=True
32+
boost:without_iostreams=True
33+
boost:without_json=True
34+
boost:without_locale=True
35+
boost:without_log=True
36+
boost:without_math=True
37+
boost:without_mpi=True
38+
boost:without_nowide=True
39+
boost:without_program_options=False
40+
boost:without_python=True
41+
boost:without_random=False
42+
boost:without_regex=True
43+
boost:without_serialization=True
44+
boost:without_stacktrace=True
45+
boost:without_system=False
46+
boost:without_test=True
47+
boost:without_thread=True
48+
boost:without_timer=True
49+
boost:without_type_erasure=True
50+
boost:without_wave=True
51+
52+
[generators]
53+
cmake
54+
cmake_find_package
55+
cmake_paths
56+
57+
[imports]
58+
lib, *.dylib* -> ./bin

0 commit comments

Comments
 (0)