Skip to content

Commit

Permalink
Add more external links
Browse files Browse the repository at this point in the history
NOTE: pkg-config case for Ogg and Vorbis isn't working. Look into it!
  • Loading branch information
swagtoy committed Nov 5, 2024
1 parent 15733c9 commit 9c48859
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
30 changes: 7 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ add_subdirectory(external/sexp-cpp)
add_subdirectory(external/partio_zip)
# Workaround tinygettext wanting Iconv
SET(HAVE_SDL TRUE CACHE BOOL "Use SDL_iconv instead of system iconv")
add_subdirectory(external/tinygettext) # NOTE need libiconv for this
add_subdirectory(external/tinygettext)
add_subdirectory(external/findlocale)
add_subdirectory(external/obstack)
include(SuperTux/ProvideOpenGL)

## Build stuff
Expand All @@ -168,7 +170,7 @@ include(SuperTux/BuildDocumentation)
include(SuperTux/BuildMessagePot)

## Build list of sources for supertux binary
file(GLOB SUPERTUX_SOURCES_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/obstack/*.c external/findlocale/findlocale.c)
set(SUPERTUX_SOURCES_C ${CMAKE_CURRENT_SOURCE_DIR})

file(GLOB SUPERTUX_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*/*.cpp src/supertux/menu/*.cpp src/video/sdl/*.cpp src/video/null/*.cpp)
file(GLOB SUPERTUX_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_BINARY_DIR}/tmp/*.rc")
Expand Down Expand Up @@ -210,34 +212,16 @@ set_target_properties(supertux2 PROPERTIES COMPILE_FLAGS "${SUPERTUX2_EXTRA_WARN
#endif()
#endif()

## Some additional include paths
target_include_directories(supertux2 SYSTEM PUBLIC
external/findlocale/
external/obstack/
)


# Include altivec wrapper on ppc
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc.*")
target_include_directories(supertux2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/ppc)
endif()

# Linking fixes
set_source_files_properties(external/findlocale/findlocale.c PROPERTIES COMPILE_FLAGS -fPIE)
set_source_files_properties(external/obstack/obstack.c PROPERTIES COMPILE_FLAGS -fPIE)

## Link supertux binary with squirrel and other libraries

target_link_libraries(supertux2 PUBLIC simplesquirrel)
target_link_libraries(supertux2 PUBLIC tinygettext)
target_link_libraries(supertux2 PUBLIC sexp)
target_link_libraries(supertux2 PUBLIC SDL_SavePNG)
target_link_libraries(supertux2 PUBLIC PartioZip)
target_link_libraries(supertux2 PUBLIC OpenAL)
target_link_libraries(supertux2 PUBLIC glm)
target_link_libraries(supertux2 PUBLIC
simplesquirrel tinygettext sexp SDL_SavePNG
PartioZip OpenAL FindLocale obstack glm fmt PhysFS)
target_compile_definitions(supertux2 PUBLIC GLM_ENABLE_EXPERIMENTAL)
target_link_libraries(supertux2 PUBLIC fmt)
target_link_libraries(supertux2 PUBLIC PhysFS)

if(NOT EMSCRIPTEN)
target_link_libraries(supertux2 PUBLIC
Expand Down
5 changes: 5 additions & 0 deletions external/findlocale/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project(FindLocale)

add_library(FindLocale OBJECT ${PROJECT_SOURCE_DIR}/findlocale.c)
set_target_properties(FindLocale PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(FindLocale PUBLIC ${PROJECT_SOURCE_DIR})
5 changes: 5 additions & 0 deletions external/obstack/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project(obstack)

add_library(obstack OBJECT ${PROJECT_SOURCE_DIR}/obstack.c)
set_target_properties(obstack PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(obstack PUBLIC ${PROJECT_SOURCE_DIR})

0 comments on commit 9c48859

Please sign in to comment.