mirror of
https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
synced 2024-12-27 12:03:37 +01:00
cmake: default to compiler install with gint, and GiteaPC support
This commit is contained in:
parent
412d0f5623
commit
e6d2aa0638
3 changed files with 36 additions and 3 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -3,3 +3,7 @@
|
|||
/prefix
|
||||
*.txt
|
||||
!CMakeLists.txt
|
||||
|
||||
# GiteaPC config files
|
||||
giteapc-config.make
|
||||
giteapc-config-*.make
|
||||
|
|
|
@ -10,6 +10,9 @@ option(SHARED "Build a shared library")
|
|||
option(STANDARD_NAMESPACE "Use libc.a and put headers in global include folder")
|
||||
|
||||
set(TARGET_FOLDERS ${FXLIBC_TARGET})
|
||||
# Install paths
|
||||
set(LIBDIR "lib")
|
||||
set(INCDIR "include")
|
||||
|
||||
if(FXLIBC_TARGET STREQUAL vhex-sh)
|
||||
list(APPEND TARGET_FOLDERS vhex-generic sh-generic)
|
||||
|
@ -41,6 +44,13 @@ if(FXLIBC_TARGET STREQUAL gint)
|
|||
list(APPEND TARGET_FOLDERS sh-generic)
|
||||
set(FXLIBC_ARCH sh)
|
||||
add_definitions(-D__SUPPORT_GINT)
|
||||
|
||||
# Default to fxSDK install path
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "${FXSDK_COMPILER_INSTALL}" CACHE PATH "..." FORCE)
|
||||
set(LIBDIR ".")
|
||||
set(INCDIR "include")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(sh-generic IN_LIST TARGET_FOLDERS)
|
||||
|
@ -223,11 +233,11 @@ set_target_properties(fxlibc PROPERTIES
|
|||
|
||||
# Install
|
||||
|
||||
install(TARGETS fxlibc DESTINATION lib/)
|
||||
install(DIRECTORY include/ DESTINATION include PATTERN "target" EXCLUDE)
|
||||
install(TARGETS fxlibc DESTINATION ${LIBDIR})
|
||||
install(DIRECTORY include/ DESTINATION ${INCDIR} PATTERN "target" EXCLUDE)
|
||||
|
||||
foreach(FOLDER IN LISTS TARGET_FOLDERS)
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include/target/${FOLDER}")
|
||||
install(DIRECTORY include/target/${FOLDER}/ DESTINATION include)
|
||||
install(DIRECTORY include/target/${FOLDER}/ DESTINATION ${INCDIR})
|
||||
endif()
|
||||
endforeach()
|
||||
|
|
19
giteapc.make
Normal file
19
giteapc.make
Normal file
|
@ -0,0 +1,19 @@
|
|||
# giteapc: version=1 depends=Lephenixnoir/sh-elf-gcc,Lephenixnoir/OpenLibm
|
||||
|
||||
-include giteapc-config.make
|
||||
|
||||
configure:
|
||||
@ cmake -B build-gint -DFXLIBC_TARGET=gint -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-sh.cmake
|
||||
|
||||
build:
|
||||
@ make -C build-gint
|
||||
|
||||
install:
|
||||
@ make -C build-gint install
|
||||
|
||||
uninstall:
|
||||
@ if [ -e build-gint/install_manifest.txt ]; then \
|
||||
xargs rm -f < build-gint/install_manifest.txt; \
|
||||
fi
|
||||
|
||||
.PHONY: configure build install uninstall
|
Loading…
Reference in a new issue