Skip to content
Snippets Groups Projects
Commit 57037e41 authored by Eidolon's avatar Eidolon
Browse files

cmake: fixes to enable linux compilation

string.c, capitalization, find fixes
parent 68f8a5b0
No related branches found
No related tags found
No related merge requests found
...@@ -27,19 +27,8 @@ find_library(SDL2_LIBRARY ...@@ -27,19 +27,8 @@ find_library(SDL2_LIBRARY
"/usr/local/lib" "/usr/local/lib"
) )
find_library(SDL2_MAIN_LIBRARY
NAMES SDL2_main
PATHS
${SDL2_PKGCONF_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
# set include dir variables # set include dir variables
set(SDL2_PROCESS_INCLUDES SDL2_INCLUDE_DIR) set(SDL2_PROCESS_INCLUDES SDL2_INCLUDE_DIR)
set(SDL2_PROCESS_LIBS SDL2_LIBRARY) set(SDL2_PROCESS_LIBS SDL2_LIBRARY)
set(SDL2_MAIN_PROCESS_INCLUDES SDL2_INCLUDE_DIR)
set(SDL2_MAIN_PROCESS_LIBS SDL2_MAIN_LIBRARY)
libfind_process(SDL2) libfind_process(SDL2)
libfind_process(SDL2_MAIN)
...@@ -11,7 +11,7 @@ libfind_pkg_check_modules(SDL2_MAIN_PKGCONF SDL2) ...@@ -11,7 +11,7 @@ libfind_pkg_check_modules(SDL2_MAIN_PKGCONF SDL2)
# includes # includes
find_path(SDL2_MAIN_INCLUDE_DIR find_path(SDL2_MAIN_INCLUDE_DIR
NAMES SDL_main.h NAMES SDL.h
PATHS PATHS
${SDL2_MAIN_PKGCONF_INCLUDE_DIRS} ${SDL2_MAIN_PKGCONF_INCLUDE_DIRS}
"/usr/include/SDL2" "/usr/include/SDL2"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
set(SRB2_CONFIG_SDL2_USEMIXER ON CACHE BOOL "Use SDL2_mixer or regular sdl sound") set(SRB2_CONFIG_SDL2_USEMIXER ON CACHE BOOL "Use SDL2_mixer or regular sdl sound")
if(${SRB2_CONFIG_SDL2_USEMIXER}) if(${SRB2_CONFIG_SDL2_USEMIXER})
find_package(SDL2_MIXER) find_package(SDL2_mixer)
if(${SDL2_MIXER_FOUND}) if(${SDL2_MIXER_FOUND})
set(SRB2_HAVE_MIXER ON) set(SRB2_HAVE_MIXER ON)
set(SRB2_SDL2_SOUNDIMPL mixer_sound.c) set(SRB2_SDL2_SOUNDIMPL mixer_sound.c)
...@@ -75,6 +75,10 @@ if(${SDL2_FOUND}) ...@@ -75,6 +75,10 @@ if(${SDL2_FOUND})
set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES} set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES}
${CMAKE_SOURCE_DIR}/src/win32/win_dbg.c ${CMAKE_SOURCE_DIR}/src/win32/win_dbg.c
${CMAKE_SOURCE_DIR}/src/win32/Srb2win.rc ${CMAKE_SOURCE_DIR}/src/win32/Srb2win.rc
)
endif()
if(NOT CLANG)
set(SRB2_SDL2_TOTAL_SOURCES ${SRB2_SDL2_TOTAL_SOURCES}
${CMAKE_SOURCE_DIR}/src/string.c ${CMAKE_SOURCE_DIR}/src/string.c
) )
endif() endif()
...@@ -109,6 +113,8 @@ if(${SDL2_FOUND}) ...@@ -109,6 +113,8 @@ if(${SDL2_FOUND})
${PNG_LIBRARIES} ${PNG_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
m #need math lol
rt # this too
) )
endif() endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment