This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9503285
commit e2ac164
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
|
||
project(minrt C ASM) | ||
set(CMAKE_INCLUDE_FLAG_ASM "-Wa,-I") | ||
|
||
add_library(minrt STATIC | ||
src/gba/crt0.s | ||
src/gba/ram.c | ||
src/gba/rom_header.s | ||
) | ||
|
||
target_include_directories(minrt PUBLIC include/) | ||
target_include_directories(minrt PRIVATE src/gba/) | ||
|
||
target_compile_options(minrt PRIVATE | ||
$<$<COMPILE_LANGUAGE:C>:-Os -g3 -gdwarf-4 -ffunction-sections -fdata-sections -std=c99 -Wall -Wpedantic -mabi=aapcs -mcpu=arm7tdmi -mthumb> | ||
) | ||
|
||
target_link_options(minrt INTERFACE | ||
-mthumb | ||
-specs=lib/nocrt0.specs | ||
-L${CMAKE_CURRENT_LIST_DIR}/lib | ||
-Trom.mem | ||
-Tgba.x | ||
) | ||
|
||
add_library(minrt_multiboot STATIC | ||
src/gba/crt0.s | ||
src/gba/ram.c | ||
src/gba/multiboot_header.s | ||
) | ||
|
||
target_include_directories(minrt_multiboot PUBLIC include/) | ||
target_include_directories(minrt_multiboot PRIVATE src/gba/) | ||
|
||
target_compile_options(minrt_multiboot PRIVATE | ||
$<$<COMPILE_LANGUAGE:C>:-Os -g3 -gdwarf-4 -ffunction-sections -fdata-sections -std=c99 -Wall -Wpedantic -mabi=aapcs -mcpu=arm7tdmi -mthumb> | ||
) | ||
|
||
target_link_options(minrt_multiboot INTERFACE | ||
-mthumb | ||
-specs=lib/nocrt0.specs | ||
-L${CMAKE_CURRENT_LIST_DIR}/lib | ||
-Tmultiboot.mem | ||
-Tgba.x | ||
) | ||
|
||
add_library(minrt_mb ALIAS minrt_multiboot) | ||
|
||
if(EXISTS $ENV{DEVKITPRO}) | ||
install(TARGETS minrt minrt_multiboot DESTINATION "$ENV{DEVKITPRO}/minrt/lib") | ||
install(DIRECTORY include/ DESTINATION "$ENV{DEVKITPRO}/minrt/include") | ||
install(FILES LICENSE.txt DESTINATION "$ENV{DEVKITPRO}/minrt") | ||
endif() |