inital, almost working cross-compilation setup with Visual Studio and cmake
This commit is contained in:
23
CMakeLists.txt
Normal file
23
CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
project(GameEngine VERSION 0.1.0 LANGUAGES C CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# --- Validate preset variables ---
|
||||
if(NOT DEFINED SDL_LINK_TYPE OR NOT SDL_LINK_TYPE MATCHES "^(static|dynamic)$")
|
||||
message(FATAL_ERROR "SDL_LINK_TYPE must be 'static' or 'dynamic'. Use a CMake preset.")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED PLATFORM OR NOT PLATFORM MATCHES "^(windows|linux)$")
|
||||
message(FATAL_ERROR "PLATFORM must be 'windows' or 'linux'. Use a CMake preset.")
|
||||
endif()
|
||||
|
||||
message(STATUS "Build config: PLATFORM=${PLATFORM}, SDL_LINK_TYPE=${SDL_LINK_TYPE}, BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
|
||||
# --- Resolve SDL ---
|
||||
include(cmake/SDLSetup.cmake)
|
||||
|
||||
# --- Subdirectories ---
|
||||
add_subdirectory(engine)
|
||||
add_subdirectory(game)
|
||||
Reference in New Issue
Block a user