cmake: Cleanup some CMake stuff.

This commit is contained in:
James Benton 2018-06-15 13:59:55 +01:00
parent f9799cf3dd
commit 39429c0cbc
5 changed files with 18 additions and 12 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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})

View File

@ -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)