-
-
Notifications
You must be signed in to change notification settings - Fork 517
CMake Refactor #3093
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
swagtoy
wants to merge
233
commits into
SuperTux:master
Choose a base branch
from
swagtoy:cmake-refactor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
CMake Refactor #3093
Changes from 15 commits
Commits
Show all changes
233 commits
Select commit
Hold shift + click to select a range
94f8326
Move enscripten
d83f40c
Move to find_package directly in the CMakeLists.txt
c72db8b
Remove CMakeLists.txt.old (oops)
0476871
Remove supertux2_lib and supertux2_c
b249342
Fix warning from other cmakefiles
219b28d
Switch to PkgConfig for a few things (kind of a hack)
7d9a7ef
Remove my attribution from Copyright
ec7043e
Fix PIC linking issues
2d17b3f
Fix Emacs
8b9f20f
Use custom add_package to handle dependency checking in one line
67395f5
Fix install guide for Ubuntu and Arch
9866b82
Refactor add_package to a macro, do aliases, move to separate file
099690b
Fix incorrect terminology
1b58d75
Better ProvideDiscord warning
0063eec
Refactor tests a bit
2d9d3dd
MD5 unit test
4c29ca7
5am code
d4d8df9
make_unit_test; fix AATriangleTest
fd67dcd
Use SDL_rect.h instead of SDL.h for math/rect methods
6830c02
Custom assert function (broken)
5e6bc8d
GLM_ENABLE_EXPERIMENTAL
9fbf635
Make tests/assert more verbose
ca30f08
Merge branch 'cmake-refactor' of github.com:swagtoy/supertux into cma…
d13fd68
Add broken DynamicScopeTest for now
b86b57f
Fix title screen release check
a8237a4
Move SavePNG
7013c00
Fix SDL_SavePNG
d18ffea
Packages using provides code wot i dont think compiles anyway lole ju…
96ecc66
Merge branch 'cmake-refactor' of https://github.com/swagtoy/supertux …
84023d2
btich mingw
MatusGuy 5f72189
Merge branch 'master' of https://github.com/swagtoy/supertux into cma…
9a92c2d
Fix indention
15733c9
Workaround tinygettext wanting iconv
9c48859
Add more external links
b64184e
remove gprof thingy and wip mingw fix error handler
MatusGuy edc7666
mingw works!!! Create dbghelp.a using a predefined dbghelp.def
MatusGuy af14dc4
Add ALL_TESTS target; add FileSystemTest just to remove it anyway
cb08b63
Would help if I actually committed the tests
e65617f
add this file that i forgot to add for mingw
MatusGuy 244c8ea
Merge branch 'cmake-refactor' of https://github.com/swagtoy/supertux …
MatusGuy 40899c6
fix msvc, add option to disable testing, use console when in debug build
MatusGuy 99a050e
Allow for different package names when using pkg-config
MatusGuy 4106352
Update sexp-cpp
MatusGuy 03dbdb0
Better window title and git version detection
MatusGuy 79a6309
Better window title and git version detection
MatusGuy 13b42c6
Merge branch 'cmake-refactor' of https://github.com/swagtoy/supertux …
MatusGuy 7431a90
Fix git message
87bac26
Git run improvements
e2591a2
Modules thing (complete me)
142b602
Correctly use pkg-config and add option to prefer it
MatusGuy dd18bf0
Fix git revision checking
MatusGuy b0d9546
Fix _FOUND if statement
MatusGuy 1686dd6
Move Emscripten.cmake to correct path
MatusGuy efea468
Fix install target for portable package
MatusGuy 8059e00
Exclude submodules from all target and better release checking
MatusGuy a711134
Improve git version checking
MatusGuy 25ec5e5
FreeBSD (and others?) error handling
0b24861
Fix random weird components in WIX cpack generation
MatusGuy e950507
Fix simplesquirrel merge conflict
MatusGuy 02cc52a
Merge branch 'real-master' into nekobro-cmake-refactor
MatusGuy b8ee409
Update tinygettext
MatusGuy cc7187a
Update simplesquirrel
MatusGuy 06cbea1
Mark CTest porting for later
MatusGuy b062888
Merge branch 'real-master' into nekobro-cmake-refactor
MatusGuy 96a3ebc
Use simpler opengl check without GLEW
MatusGuy 840f469
Try gnulinux.yml
MatusGuy a5fde84
Fix comment
MatusGuy 20449fb
install fmt
MatusGuy afc29f4
install physfs
MatusGuy 6297944
strenghten addpackage
MatusGuy ad125e7
Fix glm on Fedora
MatusGuy db42c1f
Only check target in add_package
MatusGuy 9bb1822
Use cmake target features for cxx standard
MatusGuy 7777a9f
cmake policy for cxx standard
MatusGuy f1eff3d
hack
MatusGuy 7a3324b
Change add_subdirectory order
MatusGuy 2b285ed
try this and if it doesnt work i will die probably
MatusGuy 9e6b118
Ok it didnt work but updating sexp-cpp might work
MatusGuy 1a07ccd
Update compilers
MatusGuy f671506
update sexp
MatusGuy 9b74483
Update sexp again
MatusGuy e021967
Update sexp
MatusGuy d6b1410
Fix a bunch of things and fmt
MatusGuy 4287161
go my discord-rpc
MatusGuy e9a064d
Update discord sdk
MatusGuy 948bb63
Fix fix fix discord update fmt fix fix
MatusGuy 693ecb8
Update ubuntu version
MatusGuy 3dafafc
ugghhhh fix
MatusGuy 5b2be3b
fix gcc.version
MatusGuy bb0d039
no more coverage
MatusGuy f8e3336
go back to fmt addpackage
MatusGuy 3920673
fix 32bit
MatusGuy a90e775
Merge branch 'real-master' into nekobro-cmake-refactor
MatusGuy ad60575
Merge remote-tracking branch 'upstream/master' into nekobro-cmake-ref…
MatusGuy 125a455
Don't package when debug
MatusGuy 699c81f
fix clang warning
MatusGuy 5f1a252
remove arch args
MatusGuy e4de0b6
Prefer find package in physfs ci 32bit
MatusGuy 3dc7daf
Disable a clang warning
MatusGuy 02829a6
Remove CI werror
MatusGuy 0eb341b
idk what to do here
MatusGuy 05aebf2
vcpkg toolchain file in linux ci
MatusGuy b5b68ff
change vcpkg root in ci
MatusGuy 4f1f0fa
fix package.sh
MatusGuy 46f6a2b
32bit vcpkg triplet
MatusGuy 23ce17e
specify vcpkg root as env var
MatusGuy dffea05
add fuse
MatusGuy a863283
switch to pwsh aleluja
MatusGuy edfb00c
try fix
MatusGuy 4ebc21d
test
MatusGuy 5cf35b7
chg name
MatusGuy fffc748
test again
MatusGuy 473cf87
finally fix
MatusGuy 16eaa3b
fix fix fix fix fix fix fix fix
MatusGuy 046785a
AAHHHHHH HOW COULD I FORGET
MatusGuy ecd1e9b
test 2
MatusGuy 309aeb7
this should fix EVERYTHING
MatusGuy aafadf8
turn to string
MatusGuy c8435ae
fix docs
MatusGuy af08dab
try
MatusGuy 34fadce
fix indent
MatusGuy c9c9ef0
revert docs
MatusGuy 37c13f7
doc fix aaha
MatusGuy 39fc31f
normal boolean please???
MatusGuy 3baad69
AAAAAAAAAA DOCS YOU BT
MatusGuy 6dbf7d9
im desperate please work stop trolling me
MatusGuy 14d2f26
REport opengl
MatusGuy fd2495d
update desktop file install location
MatusGuy f342885
add glu
MatusGuy 943d0a7
Fix...?
MatusGuy e1b10f9
fix everythign????
MatusGuy dfd275f
change quotes
MatusGuy 53e6080
update windows ci
MatusGuy 17b1d08
add physfs and wait another 2 years
MatusGuy c7dbfde
Update windows.yml
MatusGuy 49d7425
Fix ubuntu touch
MatusGuy 8110670
fix ut fmt maybe?? lol
MatusGuy 8400cd9
fix macos??
MatusGuy 3b99f78
remove macos glbinding
MatusGuy fad8e38
add ppa
MatusGuy 989cb90
update fmt
MatusGuy 31e014b
get newer fmt
MatusGuy 33db3ab
forgot to commit script
MatusGuy fdf70c2
set pwd
MatusGuy eb3b675
dont change pwd
MatusGuy daa1faa
no way this work
MatusGuy 620b3c0
give up
MatusGuy 8ce39b9
try this
MatusGuy 1a8cb77
omfg leave me alone
MatusGuy 2ea3724
remove sudo
MatusGuy fc041c6
i have been trolled into oblivion
MatusGuy 5c2a96e
use the force
MatusGuy 2e41427
uuuuhhhh.. wakey wakey?
MatusGuy c64d63c
DON'T CARE
MatusGuy a7dfdfb
ok NEVERMIND
MatusGuy 4f40e3d
Fix sdl version
MatusGuy 17a433a
build fmt from source
MatusGuy 64d1938
try again
MatusGuy 22a75ed
aauu
MatusGuy bd02d47
gicve up
MatusGuy 1fe3a44
fix link
MatusGuy 88dcb76
use zip
MatusGuy d8147a5
fix cmake command fmt
MatusGuy b065041
add deps to pkgconfig path
MatusGuy d3598cf
add to env
MatusGuy f1c8ba4
no more tests
MatusGuy 556c041
update tinygettext and fix macos
MatusGuy f79adaa
remove macos tests
MatusGuy f34ab82
wasm vcpkg
MatusGuy 0843dbe
run emsdk env
MatusGuy 6dca29d
emscripten glew
MatusGuy 8431298
rm glew
MatusGuy 5b81cce
chainload emscripten
MatusGuy 49dacc0
fix fix fix
MatusGuy 30edf91
use emscripten ports
MatusGuy 6a019a4
move
MatusGuy fbcdbe1
install libpng
MatusGuy 2000c9e
disable sq install
MatusGuy bbd99d6
disable sq installer but better
MatusGuy 943d5c1
opengl emscripten but better
MatusGuy 1d23c02
update tinygettext
MatusGuy 2d85f5e
sdl savepng wasm
MatusGuy 11aade8
add wasm vorbis
MatusGuy 66cd726
link openal but better
MatusGuy 6059c1a
put opengl in link flags instead
MatusGuy 872f384
update sexp
MatusGuy 8d13db0
oops
MatusGuy 122d17f
add back raqm and sdl ttf fork
MatusGuy dfece05
use raqm 32bit package
MatusGuy 119ce90
Fix addpackage required flag
MatusGuy 95a192d
update sexp
MatusGuy 97c7599
Merge branch 'real-master' into nekobro-cmake-refactor
MatusGuy d5ce394
CMake 3.5 compat
MatusGuy 36084a6
str
MatusGuy 1e5948b
raqm vcpkg
MatusGuy ea537f8
RAQM try fix
MatusGuy e17e874
darn logic
MatusGuy a186c96
do this do that
MatusGuy 650b02d
try try try
MatusGuy fc9ad4c
Merge branch 'master' into cmake-refactor
MatusGuy 0fc349b
Fix arabic text FOREVER
MatusGuy 78abbfa
fix savepng emscripten
MatusGuy 146be1c
add sdl2ttf to emscripten
MatusGuy b486015
Add gles
MatusGuy 750c1fa
gl in use flags
MatusGuy 4d4d3c1
opengl es
MatusGuy dc1cf9d
add opengles compile def
MatusGuy 5a60ecf
move option
MatusGuy 010328d
uoooaaah add define manually
MatusGuy 652ce40
what is even going on anymore
MatusGuy 263578d
if this doesnt work im gonna DIE
MatusGuy ff4f343
WAKE UP
MatusGuy dd74053
testy
MatusGuy c7af1ae
set as cachevars auguh
MatusGuy d0e13f2
try fix github actions cache
MatusGuy aaa13c0
Print opengl src
MatusGuy 05e79c8
Foda-se!
MatusGuy 80302b2
final fix and im OUTTA HERE
MatusGuy e308384
Remove all unneeded files
MatusGuy c7928b4
add IPH and PCH
MatusGuy 3640c24
try fix windows dlls
MatusGuy 0055e56
we dont need these lets be honest
MatusGuy 8a41c04
try fux
MatusGuy b599765
OOPS
MatusGuy ff27e1e
Dude who tf is u
MatusGuy 330b313
wtf...
MatusGuy 40ee161
this is so unbearable
MatusGuy c4f8c87
Fix windows packaging???? Dear god
MatusGuy dfe140d
dont package on debug workflow
MatusGuy 5f4114a
Add vcpkg manifest file
MatusGuy e7d1eba
Manually specify supertux release
MatusGuy 75d70e2
Fix linux install
MatusGuy 50f83b8
Update compilation docs
MatusGuy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(CMAKE_EXECUTABLE_SUFFIX .html) | ||
set(IS_EMSCRIPTEN_BUILD ON) | ||
|
||
set(EM_USE_FLAGS "-sDISABLE_EXCEPTION_CATCHING=0") | ||
set(EM_LINK_FLAGS " -sINITIAL_MEMORY=134217728 -sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=536870912 -sERROR_ON_UNDEFINED_SYMBOLS=0 --preload-file ${BUILD_CONFIG_DATA_DIR} --use-preload-plugins -lidbfs.js") | ||
if(CMAKE_BUILD_TYPE MATCHES Debug) | ||
set(EM_USE_FLAGS "${EM_USE_FLAGS} -fsanitize=undefined") | ||
set(EM_LINK_FLAGS "${EM_LINK_FLAGS} -fsanitize=undefined -sSAFE_HEAP=1 -sASSERTIONS=1 -sDEMANGLE_SUPPORT=1") | ||
endif() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EM_USE_FLAGS}") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EM_USE_FLAGS}") | ||
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${EM_USE_FLAGS} ${EM_LINK_FLAGS}") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${EM_USE_FLAGS} ${EM_LINK_FLAGS}") | ||
|
||
target_link_options(supertux2 PUBLIC -sEXPORTED_FUNCTIONS=['_main','_set_resolution','_save_config','_onDownloadProgress','_onDownloadFinished','_onDownloadError','_onDownloadAborted','_getExceptionMessage'] PUBLIC -sEXPORTED_RUNTIME_METHODS=['ccall','cwrap']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# AddPackage.cmake - Portable find_package approach | ||
# | ||
# Copyright (C) 2024 Hyland B. <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
# | ||
|
||
# This monstrosity essentially adds a complex package wrapping | ||
# function, but it's honestly impressive. It essentially tries to | ||
# default to find_package, however, this may not always work, | ||
# especially on *NIX machines or anything weird like that. So, being | ||
# clever, it then tries to go to PkgConfig, which (generally speaking) | ||
# tends to produce more accurate results on *NIX | ||
# machines. Unfortunately, this may not always work (and sometimes by | ||
# design), so then it finally falls back to Supertux's old, weird | ||
# Provide files. And if that fails, then that means the package | ||
# doesn't exist or wasn't installed. | ||
|
||
# Usage: | ||
# | ||
# add_package(TARGET SDL2 <-- The output target, a "target alias" (sometimes) | ||
# PKG SDL2 <-- The find_package package, in this case it gets SDL2 | ||
# (might look similar to the output target) | ||
# PKG_USE SDL2::SDL2 <-- Specific target from the package we want to alias | ||
# CONFIG <-- (optional) Passed to find_package if its a CONFIG | ||
# REQUIRED <-- (optional) NOT passed to find_package, just a check to | ||
# throw an error if we've exhausted all options. | ||
# PKG_CONFIG sdl2 sdl2_ttf <-- (optional, recommended) List of packages for PkgConfig | ||
# PROVIDES ProvideSDL2 <-- (optional) Fallback to just look at the provided file. | ||
# ) Undecided if I should fall back to a FindXXXX.cmake yet | ||
|
||
find_package(PkgConfig) | ||
macro(add_package) | ||
cmake_parse_arguments(addpackage_args | ||
"CONFIG;REQUIRED" "TARGET;PROVIDES;PKG;PKG_USE" "PKG_CONFIG" | ||
${ARGN} | ||
) | ||
|
||
# Note: We don't pass "REQUIRED" here because we choose to fallback if it doesn't exist. | ||
# Later, however, we do choose to throw an error based on this flag. | ||
set(addpackage_fp_args "") | ||
if (${addpackage_args_CONFIG}) | ||
string(APPEND addpackage_fp_args "CONFIG") | ||
endif() | ||
|
||
find_package(${addpackage_args_PKG} ${addpackage_fp_args}) | ||
|
||
if(${addpackage_args_PKG}_FOUND) | ||
# See if its an alias (Is this needed?) | ||
get_target_property(addpackage_pkg_alias_check ${addpackage_args_PKG_USE} ALIASED_TARGET) | ||
if (addpackage_pkg_alias_check STREQUAL "addpackage_pkg_alias_check-NOTFOUND") | ||
add_library(${addpackage_args_TARGET} ALIAS ${addpackage_args_PKG_USE}) | ||
else() | ||
message(STATUS "Package \"${addpackage_args_PKG}\" is an alias. Realiasing it.") | ||
# "unalias" it, aka just export the "alias" as the new target, so a re-alias, really... | ||
get_target_property(${addpackage_args_TARGET} ${addpackage_args_PKG_USE} ALIASED_TARGET) | ||
endif() | ||
else() | ||
#message(STATUS "CMake Package \"${addpackage_args_PKG}\" doesn't exist, so falling back to PkgConfig") | ||
|
||
if (PkgConfig_FOUND) | ||
if (${addpackage_args_REQUIRED}) | ||
list(APPEND addpackage_args_pkg_config_args REQUIRED) | ||
endif() | ||
pkg_check_modules(${addpackage_args_TARGET} ${addpackage_args_pkg_config_args} ${addpackage_args_PKG_CONFIG}) | ||
elseif(addpackage_args_REQUIRED) | ||
# TODO look in Provides | ||
message(FATAL_ERROR "Package \"${addpackage_args_TARGET}\" couldn't be found, but it's required.\nI don't know what to do. Is it installed?") | ||
endif() | ||
endif() | ||
endmacro(add_package) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to include these packages in the vcpkg example!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please note that cmake 3.19 isn't in the apt repository of neither Ubuntu 18.04 or Ubuntu 20.04, so this won't work. It may work if you install cmake manually, I didn't test that.