mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-04-04 17:47:11 +02:00
cmake: install in the fxSDK sysroot
This commit is contained in:
parent
6ea2f991a3
commit
126d1506ac
2 changed files with 16 additions and 23 deletions
|
@ -238,8 +238,7 @@ fxconv_declare_assets(${ASSETS_FX} ${ASSETS_CG})
|
|||
|
||||
include_directories(
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
"${PROJECT_BINARY_DIR}/include"
|
||||
"${FXSDK_COMPILER_INSTALL}/include/openlibm")
|
||||
"${PROJECT_BINARY_DIR}/include")
|
||||
add_compile_options(-Wall -Wextra -std=c11 -Os -fstrict-volatile-bitfields -mtas)
|
||||
|
||||
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
|
||||
|
@ -259,16 +258,16 @@ endif()
|
|||
set_target_properties("${NAME}" PROPERTIES OUTPUT_NAME "${NAME}")
|
||||
|
||||
# Library file
|
||||
install(TARGETS "${NAME}" DESTINATION "${FXSDK_COMPILER_INSTALL}")
|
||||
install(TARGETS "${NAME}" DESTINATION "${FXSDK_LIB}")
|
||||
# Linker script
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_SCRIPT}"
|
||||
DESTINATION "${FXSDK_COMPILER_INSTALL}")
|
||||
DESTINATION "${FXSDK_LIB}")
|
||||
# Headers
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
DESTINATION "${FXSDK_COMPILER_INSTALL}"
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/"
|
||||
DESTINATION "${FXSDK_INCLUDE}"
|
||||
FILES_MATCHING PATTERN "*.h")
|
||||
# Auto-generated config header
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/gint/config.h"
|
||||
DESTINATION "${FXSDK_COMPILER_INSTALL}/include/gint")
|
||||
DESTINATION "${FXSDK_INCLUDE}/gint")
|
||||
# CMake module to find gint
|
||||
install(FILES cmake/FindGint.cmake DESTINATION "${FXSDK_CMAKE_MODULE_PATH}")
|
||||
|
|
|
@ -14,18 +14,16 @@ endif()
|
|||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -print-file-name=libgint-${PC}.a
|
||||
OUTPUT_VARIABLE GINT_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -print-file-name=include/gint/config.h
|
||||
OUTPUT_VARIABLE GINT_CONFIG_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -print-file-name=libc.a
|
||||
OUTPUT_VARIABLE FXLIBC_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(
|
||||
COMMAND fxsdk path include
|
||||
OUTPUT_VARIABLE FXSDK_INCLUDE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(GINT_CONFIG_PATH "${FXSDK_INCLUDE}/gint/config.h")
|
||||
|
||||
if("${GINT_PATH}" STREQUAL "libgint-${PC}.a")
|
||||
unset(PATH_TO_LIBGINT)
|
||||
|
@ -49,8 +47,7 @@ endif()
|
|||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Gint
|
||||
REQUIRED_VARS PATH_TO_FXLIBC PATH_TO_LIBGINT
|
||||
VERSION_VAR GINT_VERSION
|
||||
)
|
||||
VERSION_VAR GINT_VERSION)
|
||||
|
||||
if(Gint_FOUND)
|
||||
if(NOT TARGET Gint::Fxlibc)
|
||||
|
@ -58,8 +55,7 @@ if(Gint_FOUND)
|
|||
endif()
|
||||
set_target_properties(Gint::Fxlibc PROPERTIES
|
||||
IMPORTED_LOCATION "${FXLIBC_PATH}"
|
||||
INTERFACE_LINK_OPTIONS "-lgcc"
|
||||
)
|
||||
INTERFACE_LINK_OPTIONS "-lgcc")
|
||||
|
||||
if(NOT TARGET Gint::Gint)
|
||||
add_library(Gint::Gint UNKNOWN IMPORTED)
|
||||
|
@ -68,10 +64,8 @@ if(Gint_FOUND)
|
|||
IMPORTED_LOCATION "${GINT_PATH}"
|
||||
INTERFACE_COMPILE_OPTIONS -fstrict-volatile-bitfields
|
||||
INTERFACE_COMPILE_DEFINITIONS "${INTF_DEFN}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FXSDK_COMPILER_INSTALL}/include/openlibm"
|
||||
INTERFACE_LINK_LIBRARIES "-lopenlibm;-lgcc"
|
||||
INTERFACE_LINK_OPTIONS "${INTF_LINK}"
|
||||
)
|
||||
INTERFACE_LINK_OPTIONS "${INTF_LINK}")
|
||||
|
||||
target_link_libraries(Gint::Gint INTERFACE Gint::Fxlibc)
|
||||
target_link_libraries(Gint::Fxlibc INTERFACE Gint::Gint)
|
||||
|
|
Loading…
Add table
Reference in a new issue