preprocessor macro, cmake conditional for SDL_main
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
include_directories(lib/cmake)
|
include_directories(lib/cmake)
|
||||||
|
|
||||||
|
|
||||||
# gui libraries ---------------------------------------------------------------------------------------------------
|
# gui libraries ---------------------------------------------------------------------------------------------------
|
||||||
set(IMGUI_PATH "lib/imgui")
|
set(IMGUI_PATH "lib/imgui")
|
||||||
file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp)
|
file(GLOB IMGUI_SOURCES ${IMGUI_PATH}/*.cpp)
|
||||||
@@ -67,16 +66,8 @@ target_include_directories(
|
|||||||
${GLEW_INCLUDE_DIRS}
|
${GLEW_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (WIN32)
|
set(
|
||||||
target_link_libraries(
|
ABSL_TARGETS
|
||||||
yaze
|
|
||||||
SDL2::SDL2main
|
|
||||||
)
|
|
||||||
add_definitions(-DSDL_MAIN_HANDLED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(
|
|
||||||
yaze
|
|
||||||
absl::strings
|
absl::strings
|
||||||
absl::flags
|
absl::flags
|
||||||
absl::status
|
absl::status
|
||||||
@@ -89,7 +80,19 @@ target_link_libraries(
|
|||||||
absl::raw_logging_internal
|
absl::raw_logging_internal
|
||||||
absl::failure_signal_handler
|
absl::failure_signal_handler
|
||||||
absl::flat_hash_map
|
absl::flat_hash_map
|
||||||
SDL2::SDL2
|
)
|
||||||
|
|
||||||
|
set(SDL_TARGETS SDL2::SDL2)
|
||||||
|
|
||||||
|
if(WIN32 OR MINGW)
|
||||||
|
list(PREPEND SDL_TARGETS SDL2::SDL2main)
|
||||||
|
add_definitions(-DSDL_MAIN_HANDLED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(
|
||||||
|
yaze
|
||||||
|
${ABSL_TARGETS}
|
||||||
|
${SDL_TARGETS}
|
||||||
${PNG_LIBRARIES}
|
${PNG_LIBRARIES}
|
||||||
${GLEW_LIBRARIES}
|
${GLEW_LIBRARIES}
|
||||||
${OPENGL_LIBRARIES}
|
${OPENGL_LIBRARIES}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
#ifndef YAZE_H
|
#ifndef YAZE_H
|
||||||
#define YAZE_H
|
#define YAZE_H
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#define main SDL_main
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "absl/debugging/failure_signal_handler.h"
|
#include "absl/debugging/failure_signal_handler.h"
|
||||||
#include "absl/debugging/symbolize.h"
|
#include "absl/debugging/symbolize.h"
|
||||||
#include "app/core/controller.h"
|
#include "app/core/controller.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user