Skip to content

Fix cmake configure on Linux #106

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

Open
wants to merge 2 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
16 changes: 8 additions & 8 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/entt)

# OpenAL
find_package(OpenAL REQUIRED)
AddImportedTarget(OpenAL::OpenAL
${OPENAL_LIBRARY}
${OPENAL_INCLUDE_DIR}
)
#AddImportedTarget(OpenAL::OpenAL
# ${OPENAL_LIBRARY}
#${OPENAL_INCLUDE_DIR}
#)

if(TARGET_OS_IOS)
set(THIRDPARTY_IOS_DIR_PATH ${CMAKE_SOURCE_DIR}/thirdparty/ios)
Expand Down Expand Up @@ -92,10 +92,10 @@ find_package(FFmpeg REQUIRED COMPONENTS

# swresample
find_package(Libswresample REQUIRED)
AddImportedTarget(SWRESAMPLE::SWRESAMPLE
${LIBSWRESAMPLE_LIBRARIES}
${LIBSWRESAMPLE_INCLUDE_DIRS}
)
#AddImportedTarget(SWRESAMPLE::SWRESAMPLE
# ${LIBSWRESAMPLE_LIBRARIES}
#${LIBSWRESAMPLE_INCLUDE_DIRS}
#)

endif() # TARGET_OS_IOS

Expand Down
2 changes: 1 addition & 1 deletion cmake/Preamble.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ endif()

include(cmake/PreventInSourceBuild.cmake)
include(cmake/PlatformCheck.cmake)
include(cmake/AddImportedTarget.cmake)
#include(cmake/AddImportedTarget.cmake)
include(cmake/Dependencies.cmake)
include(cmake/ProjectOptions.cmake)
6 changes: 3 additions & 3 deletions src/Audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ target_link_libraries(Audio
PRIVATE ProjectOptions
PRIVATE System
PUBLIC FFmpegUtil
PUBLIC OpenAL::OpenAL
PRIVATE SWRESAMPLE::SWRESAMPLE
PRIVATE SDL2::SDL2
PUBLIC OpenAL:OpenAL
PRIVATE SWRESAMPLE:SWRESAMPLE
PRIVATE SDL2:SDL2
)
4 changes: 2 additions & 2 deletions src/ECS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ target_include_directories(ECS PRIVATE ../)
target_link_libraries(ECS
PRIVATE ProjectOptions
PRIVATE System
PUBLIC EnTT::EnTT
PUBLIC EnTT:EnTT
PUBLIC Common
PRIVATE SDL2::SDL2
PRIVATE SDL2:SDL2
)

2 changes: 1 addition & 1 deletion src/Events/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ source_group("Source Files" FILES ${EVENTS_SOURCE_FILES})
target_include_directories(Events PRIVATE ../)
target_link_libraries(Events
PRIVATE ProjectOptions
PRIVATE SDL2::SDL2
PRIVATE SDL2:SDL2
)
8 changes: 4 additions & 4 deletions src/FFMPEG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ target_include_directories(FFmpegUtil PRIVATE ../)
target_link_libraries(FFmpegUtil
PRIVATE ProjectOptions
PRIVATE System
PUBLIC FFMPEG::AVCODEC
PUBLIC FFMPEG::AVFORMAT
PUBLIC FFMPEG::AVUTIL
PUBLIC FFMPEG::SWSCALE
PUBLIC FFMPEG:AVCODEC
PUBLIC FFMPEG:AVFORMAT
PUBLIC FFMPEG:AVUTIL
PUBLIC FFMPEG:SWSCALE
)

2 changes: 1 addition & 1 deletion src/FFMPEG/FFmpegUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using namespace Sourcehold;
using namespace System;

static AVInputFormat *bink_input;
static AVInputFormat *bink_input const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This throws an error:

/home/runner/work/Sourcehold/Sourcehold/src/FFMPEG/FFmpegUtil.cpp:7:33: error: expected ';' after top level declarator [clang-diagnostic-error]
static AVInputFormat *bink_input const;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove the const again?

bool Game::InitAvcodec() {
av_log_set_level(AV_LOG_ERROR);
bink_input = av_find_input_format("bink");
Expand Down
4 changes: 2 additions & 2 deletions src/GUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ target_include_directories(GUI PRIVATE ../)
target_link_libraries(GUI
PRIVATE ProjectOptions
PRIVATE System
PRIVATE SDL2::SDL2
PRIVATE SDL2:SDL2
# GUI includes World.h .. fix this !
# GUI doesnt use EnTT!
PRIVATE EnTT::EnTT
PRIVATE EnTT:EnTT
PRIVATE Audio
PUBLIC Common
)
Expand Down
4 changes: 2 additions & 2 deletions src/Rendering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ target_link_libraries(Rendering
PRIVATE System
PRIVATE FFmpegUtil
PUBLIC Common
PUBLIC Sourcehold::SDL
PRIVATE OpenAL::OpenAL
PUBLIC Sourcehold:SDL
PRIVATE OpenAL:OpenAL
)

add_library(Sourcehold::Rendering ALIAS Rendering)
2 changes: 1 addition & 1 deletion src/SDL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ target_include_directories(SourceholdSDL
target_link_libraries(SourceholdSDL
PRIVATE ProjectOptions
PRIVATE System
PUBLIC SDL2::SDL2
PUBLIC SDL2:SDL2
PUBLIC Common
)

Expand Down