-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c8c1da
commit f67a0fa
Showing
15 changed files
with
201 additions
and
117 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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,13 @@ | ||
use_native_compiler() | ||
|
||
file(GLOB_RECURSE decoder_sources *.c) | ||
|
||
add_executable(decoder ${decoder_sources}) | ||
|
||
fetch_header(decoder stb stb_image.h /usr/include/stb https://github.com/nothings/stb ae721c50eaf761660b4f90cc590453cdb0c2acd0 "") # Commit Feb 13, 2024 | ||
fetch_header(decoder nanosvg nanosvgrast.h /usr/include/nanosvg https://github.com/memononen/nanosvg 93ce879dc4c04a3ef1758428ec80083c38610b1f "src") # Commit Dec 29, 2023 | ||
|
||
# Platform linking | ||
if (CMAKE_SYSTEM_NAME MATCHES Linux) | ||
target_link_libraries(decoder PRIVATE m) | ||
endif() |
This file contains 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 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 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,52 @@ | ||
use_host_compiler() | ||
|
||
file(GLOB_RECURSE engine_sources *.c) | ||
|
||
add_executable(${title} ${engine_sources} ${CMAKE_BINARY_DIR}/data.c) | ||
add_dependencies(${title} data) | ||
|
||
fetch_header(${title} sokol sokol_gfx.h /usr/include https://github.com/floooh/sokol 55bc9cf3fa4051d485d10412c75c893c3135e885 "") # Commit May 6, 2024 | ||
fetch_header(${title} sokol sokol_gl.h /usr/include https://github.com/floooh/sokol 55bc9cf3fa4051d485d10412c75c893c3135e885 "util") # Commit May 6, 2024 | ||
fetch_header(${title} sokol_gp sokol_gp.h /usr/include https://github.com/edubart/sokol_gp a6ce39f93fb2da2c47b70cdd4d1c0a35c0e756ef "") # Commit Mar 22, 2024 | ||
fetch_header(${title} physac physac.h /usr/include https://github.com/victorfisac/physac 29d9fc06860b54571a02402fff6fa8572d19bd12 "src") # Commit Dec 10, 2023 | ||
fetch_header(${title} minilua minilua.h /usr/include https://github.com/edubart/minilua 79a00fab1639517de38a372db9e60fd6cc730d69 "") # v5.4.6 | ||
fetch_header(${title} fontstash fontstash.h /usr/include https://github.com/memononen/fontstash b5ddc9741061343740d85d636d782ed3e07cf7be "src") # Commit Apr 22, 2019 | ||
fetch_header(${title} glibc force_link_glibc_2.23.h /usr/include https://github.com/wheybags/glibc_version_header 60d54829f34f21dc440126ad5630e6a9789a48b2 "version_headers/x64") # Commit May 3, 2019 | ||
|
||
# Platform linking | ||
if (CMAKE_SYSTEM_NAME MATCHES Linux) | ||
target_compile_options(${title} PRIVATE "-includeforce_link_glibc_2.23.h") | ||
target_link_libraries(${title} PRIVATE X11) | ||
target_link_libraries(${title} PRIVATE Xi) | ||
target_link_libraries(${title} PRIVATE Xcursor) | ||
target_link_libraries(${title} PRIVATE GL) | ||
target_link_libraries(${title} PRIVATE m) | ||
target_link_libraries(${title} PRIVATE asound) | ||
elseif(CMAKE_SYSTEM_NAME MATCHES Emscripten) | ||
set_target_properties(${title} PROPERTIES OUTPUT_NAME "index") | ||
set_target_properties(${title} PROPERTIES SUFFIX ".html") | ||
#target_link_options(${title} PRIVATE "--shell-file ${CMAKE_SOURCE_DIR}/index.html") | ||
target_link_options(${title} PRIVATE "-sFULL_ES3") | ||
target_link_options(${title} PRIVATE "-sTOTAL_MEMORY=67108864") | ||
#target_link_options(${title} PRIVATE "-sALLOW_MEMORY_GROWTH") | ||
elseif(CMAKE_SYSTEM_NAME MATCHES Windows) | ||
set_target_properties(${title} PROPERTIES SUFFIX ".exe") | ||
file(READ "${CMAKE_BINARY_DIR}/_deps/physac-src/src/physac.h" TEXT) | ||
string(REPLACE "int __stdcall QueryPerformanceCounter(unsigned long long int* lpPerformanceCount);" "" TEXT "${TEXT}") | ||
string(REPLACE "int __stdcall QueryPerformanceFrequency(unsigned long long int* lpFrequency);" "" TEXT "${TEXT}") | ||
string(REPLACE "GetCurrentTime" "GetCurrTime" TEXT "${TEXT}") | ||
file(WRITE "${CMAKE_BINARY_DIR}/_deps/physac-src/src/physac.h" "${TEXT}") | ||
target_link_options(${title} PRIVATE "-static") | ||
target_compile_options(${title} PRIVATE "-mwin32") | ||
target_link_options(${title} PRIVATE "-mwindows") | ||
target_link_libraries(${title} PRIVATE ole32) | ||
endif() | ||
|
||
# Output a zipped archive | ||
set(ZIP_FILE ${CMAKE_BINARY_DIR}/${title}_${HOST_SYSTEM_NAME}.tar.gz) | ||
add_custom_command( | ||
TARGET ${title} | ||
POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} | ||
ARGS -E tar "cfz" "${ZIP_FILE}" "$<TARGET_FILE:${title}>" | ||
) |
This file contains 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.