-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
14 changed files
with
1,967 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/bin | ||
/build |
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,6 @@ | ||
[submodule "cmake"] | ||
path = cmake | ||
url = https://github.com/dnasdw/libsundaowen_cmake.git | ||
[submodule "dep/libsundaowen"] | ||
path = dep/libsundaowen | ||
url = https://github.com/dnasdw/libsundaowen_src.git |
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,73 @@ | ||
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) | ||
project(nstool) | ||
if(MSVC_VERSION EQUAL 1700 AND MSVC_IDE) | ||
set(CMAKE_GENERATOR_TOOLSET "v110_xp" CACHE STRING "Name of generator toolset." FORCE) | ||
endif() | ||
if(MSVC_VERSION EQUAL 1800 AND MSVC_IDE) | ||
set(CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "Name of generator toolset." FORCE) | ||
endif() | ||
if(MSVC_VERSION EQUAL 1900 AND MSVC_IDE) | ||
set(CMAKE_GENERATOR_TOOLSET "v140_xp" CACHE STRING "Name of generator toolset." FORCE) | ||
endif() | ||
if(MSVC_VERSION GREATER 1909 AND MSVC_VERSION LESS 1920 AND MSVC_IDE) | ||
set(CMAKE_GENERATOR_TOOLSET "v141_xp" CACHE STRING "Name of generator toolset." FORCE) | ||
endif() | ||
if(MSVC_VERSION GREATER 1600 AND NOT MSVC_IDE) | ||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE,5.02") | ||
else() | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE,5.01") | ||
endif() | ||
endif() | ||
if(APPLE) | ||
set(CMAKE_MACOSX_RPATH 1) | ||
endif() | ||
set(NSTOOL_MAJOR 1) | ||
set(NSTOOL_MINOR 0) | ||
set(NSTOOL_PATCHLEVEL 0) | ||
if(NOT MSVC_IDE AND NOT XCODE_VERSION AND NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE) | ||
endif() | ||
option(BUILD64 "Build x86_64(unix only)" ON) | ||
set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}") | ||
set(ROOT_SOURCE_DIR "${PROJECT_SOURCE_DIR}") | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ROOT_SOURCE_DIR}/cmake") | ||
include(AddDep) | ||
include(AddTarget) | ||
include(AutoFiles) | ||
ADD_DEP_INCLUDE_DIR("${ROOT_SOURCE_DIR}/dep/libsundaowen") | ||
if(UNIX OR MINGW) | ||
if(CYGWIN) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") | ||
else() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | ||
if(NOT APPLE) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") | ||
endif() | ||
endif() | ||
if((UNIX AND BUILD64) OR (MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 8)) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") | ||
else() | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") | ||
endif() | ||
endif() | ||
if(MSVC_IDE OR XCODE_VERSION) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin") | ||
else() | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}") | ||
endif() | ||
add_definitions(-DNSTOOL_VERSION="${NSTOOL_MAJOR}.${NSTOOL_MINOR}.${NSTOOL_PATCHLEVEL}") | ||
if(WIN32) | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
endif() | ||
if(UNIX OR MINGW) | ||
add_definitions(-D_FILE_OFFSET_BITS=64) | ||
if(NOT APPLE) | ||
add_definitions(-Wno-multichar -Wno-unused-result) | ||
endif() | ||
set(CMAKE_INSTALL_RPATH .) | ||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) | ||
endif() | ||
add_subdirectory(src) |
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 |
---|---|---|
@@ -1 +1,52 @@ | ||
# nstool | ||
# nstool | ||
|
||
## History | ||
|
||
- v1.0.0 @ 2018.07.01 - Support romfs | ||
|
||
## Platforms | ||
|
||
- Windows | ||
- Linux | ||
- macOS | ||
|
||
## Building | ||
|
||
### Dependencies | ||
|
||
- cmake | ||
- libiconv | ||
|
||
### Compiling | ||
|
||
- make 64-bit version | ||
~~~ | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
~~~ | ||
|
||
- make 32-bit version | ||
~~~ | ||
mkdir build | ||
cd build | ||
cmake -DBUILD64=OFF .. | ||
make | ||
~~~ | ||
|
||
### Installing | ||
|
||
~~~ | ||
make install | ||
~~~ | ||
|
||
## Usage | ||
|
||
~~~ | ||
nstool [option...] [option]... | ||
~~~ | ||
|
||
## Options | ||
|
||
See `nstool --help` messages. |
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,4 @@ | ||
// regex: ECMAScript grammar and case insensitive | ||
//ignore: | ||
|
||
//remap ignore: |
Submodule libsundaowen
added at
e7a321
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,23 @@ | ||
AUTO_FILES("." "src" "\\.(cpp|h)$") | ||
AUTO_FILES("${ROOT_SOURCE_DIR}/dep/libsundaowen" "src" "\\.(cpp|h)$") | ||
include_directories(${DEP_INCLUDE_DIR}) | ||
link_directories(${DEP_LIBRARY_DIR}) | ||
add_definitions(-DSDW_MAIN) | ||
if(APPLE) | ||
add_definitions(-DSDW_XCONVERT) | ||
endif() | ||
if(MSVC) | ||
string(REPLACE "/MDd" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") | ||
string(REPLACE "/MD" "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}") | ||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT") | ||
string(REPLACE "/MD" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") | ||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") | ||
string(REPLACE "/MD" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") | ||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT") | ||
endif() | ||
ADD_EXE(nstool "${src}") | ||
if(APPLE OR CYGWIN) | ||
target_link_libraries(nstool iconv) | ||
endif() | ||
install(TARGETS nstool DESTINATION bin) |
Oops, something went wrong.