From 5087ca6c88b5f86b23be0f2c79d74e66190a886f Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Fri, 3 May 2019 17:48:59 +1000 Subject: [PATCH] cmake: Add libwut as a standard library https://gitlab.kitware.com/cmake/cmake/issues/18222 --- share/wut.cmake | 3 --- share/wut.toolchain.cmake | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/share/wut.cmake b/share/wut.cmake index ab57920..6069722 100644 --- a/share/wut.cmake +++ b/share/wut.cmake @@ -53,9 +53,6 @@ function(wut_create_rpl target source) LINK_FLAGS "-specs=${WUT_ROOT}/share/rpl.specs") endif() - target_link_libraries(${source} - wut) - add_custom_target(${target} ALL COMMAND ${CMAKE_STRIP} -g ${source} COMMAND ${WUT_ELF2RPL} ${ELF2RPL_FLAGS} ${source} ${target} diff --git a/share/wut.toolchain.cmake b/share/wut.toolchain.cmake index 09c3e95..89f92f8 100644 --- a/share/wut.toolchain.cmake +++ b/share/wut.toolchain.cmake @@ -53,7 +53,12 @@ set(WUT_C_FLAGS "-mcpu=750 -meabi -mhard-float -Wl,-q -D__WIIU__ -D__ set(CMAKE_C_FLAGS "${WUT_C_FLAGS}" CACHE STRING "") set(CMAKE_CXX_FLAGS "${WUT_C_FLAGS}" CACHE STRING "") set(CMAKE_ASM_FLAGS "${WUT_C_FLAGS}" CACHE STRING "") -set(CMAKE_EXE_LINKER_FLAGS "\"-L${WUT_ROOT}/lib\" \"-L${WUT_ROOT}/lib/stubs\" -specs=${WUT_ROOT}/share/wut.specs" CACHE STRING "") +set(CMAKE_EXE_LINKER_FLAGS "\"-L${WUT_ROOT}/lib/stubs\" -specs=${WUT_ROOT}/share/wut.specs" CACHE STRING "") + +set(WUT_STANDARD_LIBRARIES "\"${WUT_ROOT}/lib/libwut.a\"") +set(CMAKE_C_STANDARD_LIBRARIES "${WUT_STANDARD_LIBRARIES}" CACHE STRING "") +set(CMAKE_CXX_STANDARD_LIBRARIES "${WUT_STANDARD_LIBRARIES}" CACHE STRING "") +set(CMAKE_ASM_STANDARD_LIBRARIES "${WUT_STANDARD_LIBRARIES}" CACHE STRING "") # Setup root to exclude host system headers + libraries set(CMAKE_FIND_ROOT_PATH "${DEVKITPPC}" "${DEVKITPRO}/tools" "${DEVKITPRO}/portlibs/wiiu" "${DEVKITPRO}/portlibs/ppc" "${WUT_ROOT}/share")