aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
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.