Rearrange source tree.

This commit is contained in:
James Benton 2017-05-07 01:37:13 +01:00
parent cbb377b4b6
commit bfeac63818
33 changed files with 71 additions and 43 deletions

6
.gitmodules vendored
View File

@ -1,9 +1,9 @@
[submodule "tools/ext/zlib"]
path = tools/ext/zlib
path = externals/zlib
url = https://github.com/madler/zlib.git
[submodule "tools/ext/cppformat"]
path = tools/ext/cppformat
path = externals/cppformat
url = https://github.com/cppformat/cppformat.git
[submodule "tools/ext/excmd"]
path = tools/ext/excmd
path = externals/excmd
url = https://github.com/exjam/excmd

View File

@ -11,36 +11,8 @@ if(NOT DEVKITPPC)
message(FATAL_ERROR "You must have defined DEVKITPPC before calling cmake.")
endif()
externalproject_add(crt
SOURCE_DIR "${CMAKE_SOURCE_DIR}/crt"
CMAKE_GENERATOR "Unix Makefiles"
INSTALL_DIR "${CMAKE_BINARY_DIR}/staging"
CMAKE_CACHE_ARGS
-DDEVKITPPC:string=${DEVKITPPC}
-DWUT_ROOT:string=${CMAKE_SOURCE_DIR}
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>
-DCMAKE_TOOLCHAIN_FILE:string=${CMAKE_SOURCE_DIR}/cmake/wut-toolchain.cmake)
externalproject_add(crt-lite
SOURCE_DIR "${CMAKE_SOURCE_DIR}/crt-lite"
CMAKE_GENERATOR "Unix Makefiles"
INSTALL_DIR "${CMAKE_BINARY_DIR}/staging"
CMAKE_CACHE_ARGS
-DDEVKITPPC:string=${DEVKITPPC}
-DWUT_ROOT:string=${CMAKE_SOURCE_DIR}
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>
-DCMAKE_TOOLCHAIN_FILE:string=${CMAKE_SOURCE_DIR}/cmake/wut-toolchain.cmake)
externalproject_add(rpl
SOURCE_DIR "${CMAKE_SOURCE_DIR}/rpl"
CMAKE_GENERATOR "Unix Makefiles"
INSTALL_DIR "${CMAKE_BINARY_DIR}/staging"
CMAKE_CACHE_ARGS
-DDEVKITPPC:string=${DEVKITPPC}
-DWUT_ROOT:string=${CMAKE_SOURCE_DIR}
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>
-DCMAKE_TOOLCHAIN_FILE:string=${CMAKE_SOURCE_DIR}/cmake/wut-toolchain.cmake)
add_subdirectory(src)
add_subdirectory(externals)
add_subdirectory(tools)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/"

View File

View File

64
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,64 @@
externalproject_add(crt
SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/crt"
CMAKE_GENERATOR "Unix Makefiles"
INSTALL_DIR "${CMAKE_BINARY_DIR}/staging"
CMAKE_CACHE_ARGS
-DDEVKITPPC:string=${DEVKITPPC}
-DWUT_ROOT:string=${CMAKE_SOURCE_DIR}
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>
-DCMAKE_TOOLCHAIN_FILE:string=${CMAKE_SOURCE_DIR}/cmake/wut-toolchain.cmake)
externalproject_add(crt-lite
SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/crt-lite"
CMAKE_GENERATOR "Unix Makefiles"
INSTALL_DIR "${CMAKE_BINARY_DIR}/staging"
CMAKE_CACHE_ARGS
-DDEVKITPPC:string=${DEVKITPPC}
-DWUT_ROOT:string=${CMAKE_SOURCE_DIR}
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>
-DCMAKE_TOOLCHAIN_FILE:string=${CMAKE_SOURCE_DIR}/cmake/wut-toolchain.cmake)
externalproject_add(rpl
SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/rpl"
CMAKE_GENERATOR "Unix Makefiles"
INSTALL_DIR "${CMAKE_BINARY_DIR}/staging"
CMAKE_CACHE_ARGS
-DDEVKITPPC:string=${DEVKITPPC}
-DWUT_ROOT:string=${CMAKE_SOURCE_DIR}
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>
-DCMAKE_TOOLCHAIN_FILE:string=${CMAKE_SOURCE_DIR}/cmake/wut-toolchain.cmake)
externalproject_add(libgfd
SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/libgfd"
CMAKE_GENERATOR "Unix Makefiles"
INSTALL_DIR "${CMAKE_BINARY_DIR}/staging"
CMAKE_CACHE_ARGS
-DDEVKITPPC:string=${DEVKITPPC}
-DWUT_ROOT:string=${CMAKE_SOURCE_DIR}
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>
-DCMAKE_TOOLCHAIN_FILE:string=${CMAKE_SOURCE_DIR}/cmake/wut-toolchain.cmake)
# We must force build because changes are not detected with ExternalProject...
externalproject_add_step(crt forcebuild
COMMAND ${CMAKE_COMMAND} -E echo "Force build of crt"
DEPENDEES "configure"
DEPENDERS "build"
ALWAYS 1)
externalproject_add_step(crt-lite forcebuild
COMMAND ${CMAKE_COMMAND} -E echo "Force build of crt-lite"
DEPENDEES "configure"
DEPENDERS "build"
ALWAYS 1)
externalproject_add_step(rpl forcebuild
COMMAND ${CMAKE_COMMAND} -E echo "Force build of rpl"
DEPENDEES "configure"
DEPENDERS "build"
ALWAYS 1)
externalproject_add_step(libgfd forcebuild
COMMAND ${CMAKE_COMMAND} -E echo "Force build of libgfd"
DEPENDEES "configure"
DEPENDERS "build"
ALWAYS 1)

View File

@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.2)
project(wut-crt-lite)
include(../cmake/wut-toolchain.cmake)
set_property(SOURCE crt0.S PROPERTY LANGUAGE C)
add_library(crt-lite
@ -10,6 +8,6 @@ add_library(crt-lite
set_target_properties(crt-lite PROPERTIES
COMPILE_FLAGS "-fno-builtin -ffreestanding"
LINKER_FLAGS "-fPIC")
target_include_directories(crt-lite PRIVATE "../include")
target_include_directories(crt-lite PRIVATE "../../include")
install(TARGETS crt-lite ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")

View File

@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.2)
project(wut-crt)
include(../cmake/wut-toolchain.cmake)
set_property(SOURCE crt0.S PROPERTY LANGUAGE C)
add_library(crt
@ -12,6 +10,6 @@ add_library(crt
set_target_properties(crt PROPERTIES
COMPILE_FLAGS "-fno-builtin -ffreestanding"
LINKER_FLAGS "-fPIC")
target_include_directories(crt PRIVATE "../include")
target_include_directories(crt PRIVATE "../../include")
install(TARGETS crt ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")

View File

@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.2)
project(wut-libraries)
include(../cmake/wut-toolchain.cmake)
set_property(SOURCE common/stub.S PROPERTY LANGUAGE C)
set(WUT_RPL_COMPILE_FLAGS "-Wno-unused-variable -fno-builtin -ffreestanding")

View File

@ -4,8 +4,6 @@ project(wut-tools)
set(CMAKE_CXX_STANDARD 14)
include_directories("common")
add_subdirectory(ext)
add_subdirectory(elf2rpl)
add_subdirectory(readrpl)
add_subdirectory(implcheck)