Skip to content

Commit

Permalink
cmake: Cleanup some CMake stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
exjam committed Jun 15, 2018
1 parent f9799cf commit 39429c0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
7 changes: 7 additions & 0 deletions cafe/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
6 changes: 6 additions & 0 deletions libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
6 changes: 1 addition & 5 deletions share/wut.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
10 changes: 3 additions & 7 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit 39429c0

Please sign in to comment.