mirror of
https://github.com/nicbarker/clay.git
synced 2025-05-15 14:58:03 +00:00
Compare commits
2 Commits
83f1fc24fa
...
f144876bc1
Author | SHA1 | Date | |
---|---|---|---|
|
f144876bc1 | ||
|
e5cf195d8a |
@ -9,7 +9,6 @@ option(CLAY_INCLUDE_CPP_EXAMPLE "Build C++ example" OFF)
|
||||
option(CLAY_INCLUDE_RAYLIB_EXAMPLES "Build raylib examples" OFF)
|
||||
option(CLAY_INCLUDE_SDL2_EXAMPLES "Build SDL 2 examples" OFF)
|
||||
option(CLAY_INCLUDE_SDL3_EXAMPLES "Build SDL 3 examples" OFF)
|
||||
option(CLAY_INCLUDE_ALLEGRO4_EXAMPLE "Build Allegro 4.x example" OFF)
|
||||
|
||||
message(STATUS "CLAY_INCLUDE_DEMOS: ${CLAY_INCLUDE_DEMOS}")
|
||||
|
||||
@ -34,9 +33,6 @@ endif ()
|
||||
if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_SDL2_EXAMPLES)
|
||||
add_subdirectory("examples/SDL2-video-demo")
|
||||
endif ()
|
||||
if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_ALLEGRO4_EXAMPLE)
|
||||
add_subdirectory("examples/allegro4-demo")
|
||||
endif ()
|
||||
if(NOT MSVC AND (CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_SDL3_EXAMPLES))
|
||||
add_subdirectory("examples/SDL3-simple-demo")
|
||||
endif()
|
||||
|
@ -1,40 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.27)
|
||||
project(allegro4_demo C)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
include(FetchContent)
|
||||
set(FETCHCONTENT_QUIET FALSE)
|
||||
|
||||
# Fetch pre-built MinGW binaries
|
||||
FetchContent_Declare(
|
||||
allegro4
|
||||
URL https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/A443Deluxe.7z
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(allegro4)
|
||||
|
||||
link_directories(${allegro4_SOURCE_DIR}/lib/)
|
||||
|
||||
add_executable(allegro4_demo main.c ../../renderers/alleg4/alleg4.c)
|
||||
|
||||
target_compile_options(allegro4_demo PUBLIC)
|
||||
target_include_directories(allegro4_demo PUBLIC . ${CMAKE_SOURCE_DIR} ${allegro4_SOURCE_DIR}/include/)
|
||||
|
||||
# All global variables Allegro makes available are lost when linking statically,
|
||||
# at least not when extern-ing all over the place.
|
||||
target_link_libraries(allegro4_demo PUBLIC alleg44.dll.a)
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||
|
||||
add_custom_command(TARGET allegro4_demo POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${allegro4_SOURCE_DIR}/bin/dlls/alleg44.dll"
|
||||
$<TARGET_FILE_DIR:allegro4_demo>
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
TARGET allegro4_demo POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/res
|
||||
${CMAKE_CURRENT_BINARY_DIR}/res)
|
3
examples/allegro4-demo/README
Normal file
3
examples/allegro4-demo/README
Normal file
@ -0,0 +1,3 @@
|
||||
# Allegro 4 demo
|
||||
|
||||
To build this demo on your system of choice, include all source files in this directory, as well as in "renderers/alleg4" and link with a 4.x version of Allegro. It's probably easiest to go with a pre-built binary.
|
@ -483,13 +483,4 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <WinDef.h>
|
||||
|
||||
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
|
||||
return main(__argc, __argv);
|
||||
}
|
||||
|
||||
#endif
|
||||
END_OF_MAIN()
|
||||
|
Loading…
Reference in New Issue
Block a user