From 7d195d357102f4d555003cf9787c12d5d54eff87 Mon Sep 17 00:00:00 2001 From: shibbo Date: Thu, 23 Jul 2020 22:37:15 -0400 Subject: [PATCH] improvements to build script --- compile.py | 11 ++++++----- source/example.cpp | 4 +--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/compile.py b/compile.py index e9128b8d..c2255a65 100644 --- a/compile.py +++ b/compile.py @@ -9,10 +9,12 @@ sdkRoot = os.getenv('SDK_ROOT') if sdkRoot == None: error("Error: SDK_ROOT not set.") -compilerPath = f"{sdkRoot}/Compilers/NX/nx/aarch64/bin/clang++.exe" -includePath = f"{sdkRoot}/Include" -libraryPath = f"{sdkRoot}/Libraries/NX-NXFP2-a64/Release" -releasePath = f"{sdkRoot}/Common/Configs/Targets/NX-NXFP2-a64/Include" +root = pathlib.Path(sdkRoot) + +compilerPath = root / "Compilers/NX/nx/aarch64/bin/clang++.exe" +includePath = root / "Include" +libraryPath = root / "Libraries/NX-NXFP2-a64/Release" +releasePath = root / "Common/Configs/Targets/NX-NXFP2-a64/Include" compilerCommand = f"{compilerPath} -x c++ -std=gnu++14 -fno-common -fno-short-enums -ffunction-sections -fdata-sections -fPIC -Wall -O3 -fomit-frame-pointer -mcpu=cortex-a57+fp+simd+crypto+crc -g -DNN_NINTENDO_SDK -DNN_SDK_BUILD_RELEASE -I include -I {includePath} -I {releasePath} -c " @@ -23,7 +25,6 @@ numFiles = 0 for cpp_file in cpp_files: compilerCommand += str(cpp_file) + " " - numFiles += 1 if subprocess.call(compilerCommand) == 1: sys.exit(1) diff --git a/source/example.cpp b/source/example.cpp index 8736e2d0..2d0d72f1 100644 --- a/source/example.cpp +++ b/source/example.cpp @@ -2,7 +2,5 @@ int doStuff() { - nn::os::AllocateMemoryBlock(nullptr, 0x100); - int i = 0; - return i; + return 0; } \ No newline at end of file