<commit_before>CMAKE_MINIMUM_REQUIRED(VERSION 3.0 FATAL_ERROR)

PROJECT(swordbow-magic)

INCLUDE(FindPkgConfig)

# Dependency tree for targets
#                   sbm
#                   /  \
#                  /    \
#                 /      \
#                /        \
#          sbm-client  sbm-server
#              /            \
#             /              \
#            /                \
#           /                  \
#          /                    \
# swordbow-magic-client swordbow-magic-server


#Create a library containing game-functionality shared between server and client
ADD_LIBRARY(sbm SHARED
    src/componentmanager.cpp
    src/deltatime.cpp
    src/hashgridsystem.cpp
    src/ipaddress.cpp
    src/logger.cpp
    src/rect.cpp
    src/systemmanager.cpp
    src/timer.cpp
)

#Server specific sources
ADD_LIBRARY(sbm-server SHARED
    src/animationsystem.cpp
    src/attacksystem.cpp
    src/collisionsystem.cpp
    src/entitymanager.cpp
    src/healthsystem.cpp
    src/idmanager.cpp
    src/inputsystem.cpp
    src/movediffsystem.cpp
    src/movesystem.cpp
    src/noisebrush.cpp
    src/playsound.cpp
    src/positionboundingbox.cpp
    src/removesystem.cpp
    src/renderdiffsystem.cpp
    src/sizeboundingbox.cpp
    src/world.cpp
)

#Client specific sources
ADD_LIBRARY(sbm-client SHARED
    src/camerasystem.cpp
    src/renderer.cpp
    src/rendersystem.cpp
    src/soundengine.cpp
    src/text.cpp
    src/textureboundingbox.cpp
)

#Flags for compiler and linker
#SET(CMAKE_CXX_COMPILER "g++")
SET(CMAKE_EXPORT_COMPILE_COMMANDS 1)

SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -pthread -std=c++14 -stdlib=libc++")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os -pthread -fomit-frame-pointer -march=native -flto -s -std=c++14")

#Need to link to wsock32 on windows
IF(${CMAKE_SYSTEM_NAME} EQUAL "Windows")
    TARGET_LINK_LIBRARIES(sbm -lwsock32)
ENDIF()

#Find SDL2 dependencies
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image)
PKG_SEARCH_MODULE(SDL2TTF REQUIRED SDL2_ttf)
PKG_SEARCH_MODULE(SDL2MIXER REQUIRED SDL2_mixer)
INCLUDE_DIRECTORIES(./include/ ./catch/ ${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS} ${SDL2TTF_INCLUDE_DIRS} ${SDL2MIXER_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(sbm-client sbm ${SDL2_LIBRARIES} ${SDL2IMAGE_LIBRARIES} ${SDL2TTF_LIBRARIES} ${SDL2MIXER_LIBRARIES})

#Find modules that isn't supported by cmake. Have to put .cmake files in the
#/cmake/Modules/ folder for that to work. Find those files by googling.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

FIND_PACKAGE(Cereal REQUIRED)
INCLUDE_DIRECTORIES(${CEREAL_INCLUDE_DIRS})<commit_msg>fixed build error on linux<commit_after>CMAKE_MINIMUM_REQUIRED(VERSION 3.0 FATAL_ERROR)

PROJECT(swordbow-magic)

INCLUDE(FindPkgConfig)

# Dependency tree for targets
#                   sbm
#                   /  \
#                  /    \
#                 /      \
#                /        \
#          sbm-client  sbm-server
#              /            \
#             /              \
#            /                \
#           /                  \
#          /                    \
# swordbow-magic-client swordbow-magic-server


#Create a library containing game-functionality shared between server and client
ADD_LIBRARY(sbm SHARED
    src/componentmanager.cpp
    src/deltatime.cpp
    src/hashgridsystem.cpp
    src/ipaddress.cpp
    src/logger.cpp
    src/rect.cpp
    src/systemmanager.cpp
    src/timer.cpp
)

#Server specific sources
ADD_LIBRARY(sbm-server SHARED
    src/animationsystem.cpp
    src/attacksystem.cpp
    src/collisionsystem.cpp
    src/entitymanager.cpp
    src/healthsystem.cpp
    src/idmanager.cpp
    src/inputsystem.cpp
    src/movediffsystem.cpp
    src/movesystem.cpp
    src/noisebrush.cpp
    src/playsound.cpp
    src/positionboundingbox.cpp
    src/removesystem.cpp
    src/renderdiffsystem.cpp
    src/sizeboundingbox.cpp
    src/world.cpp
)

#Client specific sources
ADD_LIBRARY(sbm-client SHARED
    src/camerasystem.cpp
    src/renderer.cpp
    src/rendersystem.cpp
    src/soundengine.cpp
    src/text.cpp
    src/textureboundingbox.cpp
)

#Flags for compiler and linker
#SET(CMAKE_CXX_COMPILER "g++")
SET(CMAKE_EXPORT_COMPILE_COMMANDS 1)

SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -pthread -std=c++14")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os -pthread -fomit-frame-pointer -march=native -flto -s -std=c++14")

#Need to link to wsock32 on windows
IF(${CMAKE_SYSTEM_NAME} EQUAL "Windows")
    TARGET_LINK_LIBRARIES(sbm -lwsock32)
ENDIF()

#Find SDL2 dependencies
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image)
PKG_SEARCH_MODULE(SDL2TTF REQUIRED SDL2_ttf)
PKG_SEARCH_MODULE(SDL2MIXER REQUIRED SDL2_mixer)
INCLUDE_DIRECTORIES(./include/ ./catch/ ${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS} ${SDL2TTF_INCLUDE_DIRS} ${SDL2MIXER_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(sbm-client sbm ${SDL2_LIBRARIES} ${SDL2IMAGE_LIBRARIES} ${SDL2TTF_LIBRARIES} ${SDL2MIXER_LIBRARIES})

#Find modules that isn't supported by cmake. Have to put .cmake files in the
#/cmake/Modules/ folder for that to work. Find those files by googling.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

FIND_PACKAGE(Cereal REQUIRED)
INCLUDE_DIRECTORIES(${CEREAL_INCLUDE_DIRS})
{'fraction_non_alphanumeric': 0.0935412026726058, 'fraction_numerical': 0.010393466963622866, 'mean_word_length': 2.890974729241877, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1013139', 'n_tokens_mistral': 2085, 'n_tokens_neox': 1897, 'n_words': 324}