Skip to content

Commit

Permalink
feat: Switch to the latest cpp-sc2 and adjust build routine
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Kurbatov <[email protected]>
  • Loading branch information
alkurbatov committed Aug 6, 2022
1 parent 23680d6 commit 08a295d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Copyright (c) 2017-2022 Alexander Kurbatov

cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.15)

project(Suvorov)

Expand All @@ -15,6 +15,9 @@ set(PROJECT_VERSION_PATCH 0)
# Specify output directories.
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin")

# Use statically linked runtime
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

# Build with c++14 support, required by sc2api.
set(CMAKE_CXX_STANDARD 14)

Expand Down
10 changes: 4 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,17 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")

# Create the executable.
add_executable(Suvorov ${BOT_SOURCES})
target_link_libraries(Suvorov
sc2api sc2lib sc2utils sc2protocol civetweb libprotobuf
)
target_link_libraries(Suvorov PRIVATE cpp_sc2)

if (MINGW)
target_link_libraries(Suvorov ssp)
target_link_libraries(Suvorov PRIVATE ssp)
endif()

if (APPLE)
target_link_libraries(Suvorov "-framework Carbon")
target_link_libraries(Suvorov PRIVATE "-framework Carbon")
endif ()

# Linux specific.
if (UNIX AND NOT APPLE)
target_link_libraries(Suvorov pthread dl)
target_link_libraries(Suvorov PRIVATE pthread dl)
endif ()

0 comments on commit 08a295d

Please sign in to comment.