Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling a project with ROMFS #12

Open
D3fau4 opened this issue Jan 11, 2023 · 0 comments
Open

Error compiling a project with ROMFS #12

D3fau4 opened this issue Jan 11, 2023 · 0 comments

Comments

@D3fau4
Copy link

D3fau4 commented Jan 11, 2023

Hello, I'm trying to build the switchbrew example to read files from the romfs but the program never builds with romfs. I don't know if my cmakefiles.txt file is wrong.

cmake_minimum_required(VERSION 3.23)
project(cmake_switch_template)

set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 23)
enable_language(ASM C CXX)

# We have to add the cmake directory to have access to
# the Switch tools and also find_package for libnx.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

# SwitchTools provide various helper functions for building Switch file formats.
include(SwitchTools)

# Find libnx, which is required by our application.
find_package(LIBNX REQUIRED)

## Project sources
include_directories(${PROJECT_SOURCE_DIR}/include/)
file(GLOB_RECURSE SOURCES_ASM ${PROJECT_SOURCE_DIR}/source/*.s)
file(GLOB_RECURSE SOURCES_C ${PROJECT_SOURCE_DIR}/source/*.c)
file(GLOB_RECURSE SOURCES_CXX ${PROJECT_SOURCE_DIR}/source/*.cpp)

add_executable(cmake_switch_template ${SOURCES_ASM} ${SOURCES_C} ${SOURCES_CXX})

# Next, we need to set the required target properties
# so CMake can detect the metadata for the application.
set_target_properties(cmake_switch_template PROPERTIES
        APP_TITLE "Template Application"
        APP_AUTHOR "Valentin B."
        APP_VERSION "0.1.0"
        ROMFS "${PROJECT_SOURCE_DIR}/romfs")

# Then, we link the required libraries (libnx) against the executable.
target_link_libraries(cmake_switch_template switch::libnx)

# Set these variables if you don't want to use an icon or
# don't want `add_nro_target` to generate a .nacp file.
set(NO_ICON TRUE)
#set(NO_NACP TRUE)

# And finally we can add the actual binary (.nro) target.
add_nro_target(cmake_switch_template)

and this is my project folders.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant