diff --git a/cafe/CMakeLists.txt b/cafe/CMakeLists.txt index a34dae3..bf4b0bf 100644 --- a/cafe/CMakeLists.txt +++ b/cafe/CMakeLists.txt @@ -1,4 +1,11 @@ cmake_minimum_required(VERSION 3.2) + +# Load up the in-tree toolchain +set(WUT_ROOT "{CMAKE_CURRENT_SOURCE_DIR}/.." CACHE STRING "") +set(WUT_RPLIMPORTGEN "" CACHE STRING "") +set(ENV{WUT_ROOT} ${WUT_ROOT}) +set(CMAKE_TOOLCHAIN_FILE $ENV{WUT_ROOT}/share/wut.toolchain.cmake) + project(cafe C CXX) enable_language(ASM) diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt index ec9a8ad..25d6dca 100644 --- a/libraries/CMakeLists.txt +++ b/libraries/CMakeLists.txt @@ -1,4 +1,10 @@ cmake_minimum_required(VERSION 3.2) + +# Load up the in-tree toolchain +set(WUT_ROOT "{CMAKE_CURRENT_SOURCE_DIR}/.." CACHE STRING "") +set(ENV{WUT_ROOT} ${WUT_ROOT}) +set(CMAKE_TOOLCHAIN_FILE $ENV{WUT_ROOT}/share/wut.toolchain.cmake) + project(libraries C) add_subdirectory(libgfd) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index e08a459..4e92877 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.2) +set(CMAKE_TOOLCHAIN_FILE $ENV{WUT_ROOT}/share/wut.toolchain.cmake) project(samples) include("${WUT_ROOT}/share/wut.cmake" REQUIRED) diff --git a/share/wut.toolchain.cmake b/share/wut.toolchain.cmake index 17308dc..f029f6e 100644 --- a/share/wut.toolchain.cmake +++ b/share/wut.toolchain.cmake @@ -10,11 +10,7 @@ if(NOT DEFINED ENV{DEVKITPPC}) endif() if(NOT DEFINED ENV{WUT_ROOT}) - if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../share/wut.cmake) - get_filename_component(ENV{WUT_ROOT} ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) - else() - message(FATAL_ERROR "You must have defined WUT_ROOT before calling cmake.") - endif() + message(FATAL_ERROR "You must have defined WUT_ROOT before calling cmake.") endif() set(DEVKITPPC $ENV{DEVKITPPC}) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 275a0c5..8d188cf 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,12 +1,8 @@ project(tools) -if(MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest") -elseif(APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z") -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") -endif() +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) add_subdirectory(libraries)