diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-19 03:09:28 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-19 03:09:28 +0200 |
| commit | 7c1795401be49831b6601ad31632ffe55c29c8f7 (patch) | |
| tree | a75d04fb10f46471790e96413394202bea9fa01a /CMakeLists.txt | |
| parent | 3cb276b19fa21699aa7241956f5b11d1d5b24fe3 (diff) | |
Deprecate <TARGET>_BUILD in favor of CMAKE_TOOLCHAIN_FILE
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e96f88..1c09380 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,22 +1,5 @@ cmake_minimum_required(VERSION 3.13) -option(PS1_BUILD "Build for the original Sony Playstation" OFF) -option(HOST_BUILD "Build for host platform using SDL-1.2" OFF) -option(WIN9X_BUILD "Build for Win9x using SDL-1.2" OFF) - -if(NOT PS1_BUILD AND NOT HOST_BUILD AND NOT WIN9X_BUILD) - message(STATUS "Assuming native build. " -"Please use one of the available options in CMakeLists.txt to " -"cross-compile for a specific target.") - set(HOST_BUILD ON) -endif() - -if(PS1_BUILD) - include("cmake/ps1-toolchain.cmake") -elseif(WIN9X_BUILD) - include("cmake/win9x-toolchain.cmake") -endif() - set(TOOLS_PREFIX ${CMAKE_BINARY_DIR}/tools) include(ExternalProject) ExternalProject_Add(tools @@ -26,6 +9,14 @@ ExternalProject_Add(tools project(rts) +if(CMAKE_TOOLCHAIN_FILE MATCHES "ps1") + set(PS1_BUILD 1) +elseif(CMAKE_TOOLCHAIN_FILE MATCHES "win9x") + set(WIN9X_BUILD 1) +else() + set(HOST_BUILD 1) +endif() + add_executable(${PROJECT_NAME} "src/main.c") set(cdroot ${CMAKE_BINARY_DIR}/cdimg) # Avoid C11 since it is not supported by the i386-mingw32 toolchain. |
