mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 11:12:29 +00:00
feat(gx): add incomplete 'CGxDeviceGLSDL' (#2)
* chore(build): add vendored SDL 3.0.0 library * chore(build): add vendored glew-cmake-2.2.0 library * feat(console): in the presence of -opengl launch flag, change GxApi to OpenGl * feat(gx): add uncompleted CGxDeviceGLSDL targeting Windows and Linux * chore(build): change SDL3 linkage from shared (bad) to to static (good)
This commit is contained in:
parent
934e0fb600
commit
706c8903a1
2043 changed files with 663533 additions and 5 deletions
62
vendor/glew-cmake-2.2.0/GeneratePkgConfig.cmake
vendored
Normal file
62
vendor/glew-cmake-2.2.0/GeneratePkgConfig.cmake
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
function(GeneratePkgConfigFile target description)
|
||||
cmake_parse_arguments(pc "" "NAME;LIBRARY_DIR" "REQUIRES" ${ARGV})
|
||||
if(NOT pc_LIBRARY_DIR)
|
||||
set(pc_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
if(WIN32)
|
||||
set(PKGCONFIG_INSTALL_DIR)
|
||||
else()
|
||||
set(PKGCONFIG_INSTALL_DIR ${pc_LIBRARY_DIR}/pkgconfig)
|
||||
endif()
|
||||
if(NOT pc_NAME)
|
||||
set(pc_NAME ${target})
|
||||
endif()
|
||||
|
||||
get_property(raw_definitions TARGET ${target} PROPERTY INTERFACE_COMPILE_DEFINITIONS)
|
||||
set(definitions "")
|
||||
foreach(def IN LISTS raw_definitions)
|
||||
if(def MATCHES "-D")
|
||||
list(APPEND definitions ${def})
|
||||
else()
|
||||
list(APPEND definitions "-D${def}")
|
||||
endif()
|
||||
endforeach()
|
||||
list(JOIN definitions " " definitions)
|
||||
|
||||
get_property(target_output TARGET ${target} PROPERTY OUTPUT_NAME)
|
||||
get_filename_component(target_output ${target_output} NAME)
|
||||
set(links "-l${target_output}")
|
||||
get_property(raw_links TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES)
|
||||
foreach(link IN LISTS raw_links)
|
||||
if(link MATCHES "-l")
|
||||
list(APPEND links ${link})
|
||||
elseif(TARGET ${link})
|
||||
get_property(is_imported TARGET ${link} PROPERTY IMPORTED)
|
||||
if(NOT is_imported)
|
||||
get_property(link_target TARGET ${link} PROPERTY OUTPUT_NAME)
|
||||
list(APPEND links ${link_target})
|
||||
endif()
|
||||
else()
|
||||
list(APPEND links "-l${link}")
|
||||
endif()
|
||||
endforeach()
|
||||
list(JOIN links " " links)
|
||||
get_property(version TARGET ${target} PROPERTY VERSION)
|
||||
|
||||
set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${pc_NAME}.pc")
|
||||
file(WRITE ${out_file} "prefix=${CMAKE_INSTALL_PREFIX}\n")
|
||||
file(APPEND ${out_file} "exec_prefix=\${prefix}\n")
|
||||
file(APPEND ${out_file} "libdir=\${prefix}/${pc_LIBRARY_DIR}\n")
|
||||
file(APPEND ${out_file} "includedir=\${prefix}/include\n")
|
||||
file(APPEND ${out_file} "\n")
|
||||
file(APPEND ${out_file} "Name: ${pc_NAME}\n")
|
||||
file(APPEND ${out_file} "Description: ${description}\n")
|
||||
file(APPEND ${out_file} "Version: ${version}\n")
|
||||
file(APPEND ${out_file} "Cflags: -I\${includedir} ${definitions}\n")
|
||||
file(APPEND ${out_file} "Libs: -L\${libdir} ${links}\n")
|
||||
if(pc_REQUIRES)
|
||||
string(REPLACE ";" " " REQUIRES "${pc_REQUIRES}")
|
||||
file(APPEND ${out_file} "Requires: ${REQUIRES}")
|
||||
endif()
|
||||
install(FILES ${out_file} DESTINATION "${PKGCONFIG_INSTALL_DIR}")
|
||||
endfunction()
|
||||
Loading…
Add table
Add a link
Reference in a new issue