forked from Bananymous/banan-os
BuildSystem: Add banan-os cmake platform
This commit is contained in:
2
toolchain/.gitignore
vendored
2
toolchain/.gitignore
vendored
@@ -1 +1 @@
|
|||||||
*/
|
local/
|
||||||
|
|||||||
@@ -193,6 +193,8 @@ build_cmake() {
|
|||||||
|
|
||||||
cp -r ./bin/* $BANAN_TOOLCHAIN_PREFIX/bin/
|
cp -r ./bin/* $BANAN_TOOLCHAIN_PREFIX/bin/
|
||||||
cp -r ./share/* $BANAN_TOOLCHAIN_PREFIX/share/
|
cp -r ./share/* $BANAN_TOOLCHAIN_PREFIX/share/
|
||||||
|
|
||||||
|
cp $BANAN_TOOLCHAIN_DIR/cmake-platform/* $BANAN_TOOLCHAIN_PREFIX/share/cmake-3.26/Modules/Platform/
|
||||||
}
|
}
|
||||||
|
|
||||||
BUILD_BINUTILS=1
|
BUILD_BINUTILS=1
|
||||||
|
|||||||
2
toolchain/cmake-platform/banan-os-GNU-ASM.cmake
Normal file
2
toolchain/cmake-platform/banan-os-GNU-ASM.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/banan-os-GNU)
|
||||||
|
__banan_os_compiler_gnu(ASM)
|
||||||
2
toolchain/cmake-platform/banan-os-GNU-C.cmake
Normal file
2
toolchain/cmake-platform/banan-os-GNU-C.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/banan-os-GNU)
|
||||||
|
__banan_os_compiler_gnu(C)
|
||||||
2
toolchain/cmake-platform/banan-os-GNU-CXX.cmake
Normal file
2
toolchain/cmake-platform/banan-os-GNU-CXX.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
include(Platform/banan-os-GNU)
|
||||||
|
__banan_os_compiler_gnu(CXX)
|
||||||
20
toolchain/cmake-platform/banan-os-GNU.cmake
Normal file
20
toolchain/cmake-platform/banan-os-GNU.cmake
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# This module is shared by multiple languages; use include blocker.
|
||||||
|
include_guard()
|
||||||
|
|
||||||
|
macro(__banan_os_compiler_gnu lang)
|
||||||
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-rpath,")
|
||||||
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
|
||||||
|
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_${lang}_FLAG "-Wl,-rpath-link,")
|
||||||
|
set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-soname,")
|
||||||
|
set(CMAKE_EXE_EXPORTS_${lang}_FLAG "-Wl,--export-dynamic")
|
||||||
|
|
||||||
|
# Initialize link type selection flags. These flags are used when
|
||||||
|
# building a shared library, shared module, or executable that links
|
||||||
|
# to other libraries to select whether to use the static or shared
|
||||||
|
# versions of the libraries.
|
||||||
|
foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
|
||||||
|
set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic")
|
||||||
|
set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
endmacro()
|
||||||
2
toolchain/cmake-platform/banan-os-Initialize.cmake
Normal file
2
toolchain/cmake-platform/banan-os-Initialize.cmake
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
set(BANAN_OS 1)
|
||||||
|
set(UNIX 1)
|
||||||
9
toolchain/cmake-platform/banan-os.cmake
Normal file
9
toolchain/cmake-platform/banan-os.cmake
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
set(CMAKE_DL_LIBS "")
|
||||||
|
set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
|
||||||
|
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
|
||||||
|
|
||||||
|
# Shared libraries with no builtin soname may not be linked safely by
|
||||||
|
# specifying the file path.
|
||||||
|
set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
|
||||||
|
|
||||||
|
include(Platform/UnixPaths)
|
||||||
Reference in New Issue
Block a user