Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Issues building with steamworks enabled by linking nfd and GTK3. #783

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 45 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,47 @@ endif()

# EOS Tokens

if (DEFINED ENV{BUILD_ENV_PR} AND NOT DEFINED BUILD_ENV_PR) # TODO: We should make all environment variable checks in this file not overwrite whatever was explicitly passed in on the command line...
set (BUILD_ENV_PR $ENV{BUILD_ENV_PR})
endif()
if (EOS_ENABLED AND "${BUILD_ENV_PR}" STREQUAL "")
#if (DEFINED ENV{BUILD_ENV_PR} AND NOT DEFINED BUILD_ENV_PR) # TODO: We should make all environment variable checks in this file not overwrite whatever was explicitly passed in on the command line...
# set (BUILD_ENV_PR $ENV{BUILD_ENV_PR})
#endif()

if (EOS_ENABLED AND "$ENV{BUILD_ENV_PR}" STREQUAL "")
message(FATAL_ERROR "BUILD_ENV_PR must be specified if EOS is enabled.")
endif()

if (DEFINED ENV{BUILD_ENV_SA} AND NOT DEFINED BUILD_ENV_SA)
set (BUILD_ENV_SA $ENV{BUILD_ENV_SA})
endif()
if (EOS_ENABLED AND "${BUILD_ENV_SA}" STREQUAL "")
#if (DEFINED ENV{BUILD_ENV_SA} AND NOT DEFINED BUILD_ENV_SA)
# set (BUILD_ENV_SA $ENV{BUILD_ENV_SA})
#endif()
if (EOS_ENABLED AND "$ENV{BUILD_ENV_SA}" STREQUAL "")
message(FATAL_ERROR "BUILD_ENV_SA must be specified if EOS is enabled.")
endif()

if (DEFINED ENV{BUILD_ENV_DE} AND NOT DEFINED BUILD_ENV_DE)
set (BUILD_ENV_DE $ENV{BUILD_ENV_DE})
endif()
if (EOS_ENABLED AND "${BUILD_ENV_DE}" STREQUAL "")
#if (DEFINED ENV{BUILD_ENV_DE} AND NOT DEFINED BUILD_ENV_DE)
# set (BUILD_ENV_DE $ENV{BUILD_ENV_DE})
#endif()
if (EOS_ENABLED AND "$ENV{BUILD_ENV_DE}" STREQUAL "")
message(FATAL_ERROR "BUILD_ENV_DE must be specified if EOS is enabled.")
endif()

if (DEFINED ENV{BUILD_ENV_CC} AND NOT DEFINED BUILD_ENV_CC)
set (BUILD_ENV_CC $ENV{BUILD_ENV_CC})
endif()
if (EOS_ENABLED AND "${BUILD_ENV_CC}" STREQUAL "")
#if (DEFINED ENV{BUILD_ENV_CC} AND NOT DEFINED BUILD_ENV_CC)
# set (BUILD_ENV_CC $ENV{BUILD_ENV_CC})
#endif()

if (EOS_ENABLED AND "$ENV{BUILD_ENV_CC}" STREQUAL "")
message(FATAL_ERROR "BUILD_ENV_CC must be specified if EOS is enabled.")
endif()

if (DEFINED ENV{BUILD_ENV_CS} AND NOT DEFINED BUILD_ENV_CS)
set (BUILD_ENV_CS $ENV{BUILD_ENV_CS})
endif()
if (EOS_ENABLED AND "${BUILD_ENV_CS}" STREQUAL "")
#if (DEFINED ENV{BUILD_ENV_CS} AND NOT DEFINED BUILD_ENV_CS)
# set (BUILD_ENV_CS $ENV{BUILD_ENV_CS})
#endif()
if (EOS_ENABLED AND "$ENV{BUILD_ENV_CS}" STREQUAL "")
message(FATAL_ERROR "BUILD_ENV_CS must be specified if EOS is enabled.")
endif()

if (DEFINED ENV{BUILD_ENV_GSE} AND NOT DEFINED BUILD_ENV_GSE)
set (BUILD_ENV_GSE $ENV{BUILD_ENV_GSE})
endif()
if (EOS_ENABLED AND "${BUILD_ENV_GSE}" STREQUAL "")
#if (DEFINED ENV{BUILD_ENV_GSE} AND NOT DEFINED BUILD_ENV_GSE)
# set (BUILD_ENV_GSE $ENV{BUILD_ENV_GSE})
#endif()
if (EOS_ENABLED AND "$ENV{BUILD_ENV_GSE}" STREQUAL "")
message(FATAL_ERROR "BUILD_ENV_GSE must be specified if EOS is enabled.")
endif()

Expand Down Expand Up @@ -457,6 +459,25 @@ if (GAME_ENABLED)
if (STEAMWORKS_ENABLED)
target_link_libraries(barony ${STEAMWORKS_LIBRARY})
#target_link_libraries(barony ${STEAMWORKS_CWRAPPER_LIBRARIES} -lstdc++)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB REQUIRED glib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
target_link_libraries(barony ${GLIB_LIBRARIES})

find_library(NFD_LIBRARY NAMES nfd PATHS $ENV{NFD_DIR}/lib NO_DEFAULT_PATH)
if(NOT NFD_LIBRARY)
message(FATAL_ERROR "NFD library not found")
endif()
include_directories($ENV{NFD_DIR}/include/nfd)
target_link_libraries(barony ${NFD_LIBRARY})

find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
include_directories(${GTK3_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS})
add_definitions(${GTK3_CFLAGS_OTHER})
target_link_libraries(barony ${GTK3_LIBRARIES})

endif()
if (EOS_ENABLED)
target_link_libraries(barony ${EOS_LIBRARIES})
Expand Down
4 changes: 2 additions & 2 deletions VS.2015/Barony/Barony.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ if %errorlevel% leq 1 exit 0 else exit %errorlevel%</Command>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);USE_EOS;STEAMWORKS;USE_THEORA_VIDEO;USE_IMGUI;CURL_STATICLIB;USE_LIBCURL</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);STEAMWORKS;USE_THEORA_VIDEO;USE_IMGUI;CURL_STATICLIB;USE_LIBCURL</PreprocessorDefinitions>
<AdditionalIncludeDirectories>"$(SolutionDir)\..\VS-includes"</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<UndefinePreprocessorDefinitions>
Expand All @@ -665,7 +665,7 @@ if %errorlevel% leq 1 exit 0 else exit %errorlevel%</Command>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>OpenGL32.lib;glu32.lib;SDL2.lib;SDL2main.lib;SDL2_net.lib;SDL2_image.lib;fmod_vc.lib;libpng16.lib;zlib.lib;steam_api64.lib;SDL2_ttf.lib;physfs.lib;EOSSDK-Win64-Shipping.lib;libtheoraplayer.lib;glew32.lib;nfd.lib;libcurl.lib;ws2_32.lib;Normaliz.lib;Crypt32.lib;Wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>OpenGL32.lib;glew32.lib;SDL2.lib;SDL2main.lib;SDL2_net.lib;SDL2_image.lib;fmod_vc.lib;libpng16.lib;zlib.lib;steam_api64.lib;SDL2_ttf.lib;physfs.lib;libtheoraplayer.lib;nfd.lib;libcurl.lib;ws2_32.lib;Normaliz.lib;Crypt32.lib;Wldap32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<Profile>true</Profile>
</Link>
Expand Down