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

BUILDING.md #44

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0620c2b
Add files via upload
000MDK Apr 10, 2024
bce361b
Update BUILDING.md -- fixed typo
000MDK Apr 10, 2024
eb5a7af
Update msys2mingw32-build-release.sh - changed .exe name to sc55emu.exe
000MDK Apr 11, 2024
3ffc9ab
Update BUILDING.md -- added info,formating,dependencies
000MDK Apr 11, 2024
6b2c728
Create app.rc -- adding appico
000MDK Apr 11, 2024
f314f61
adding app.ico
000MDK Apr 11, 2024
45bed4c
Update CMakeLists.txt -- adding AUTORCC
000MDK Apr 11, 2024
cc7de37
Update README.md -- added link to nukeykt github
000MDK Apr 11, 2024
f29ad72
Update BUILDING.md -- add VS2022
000MDK Apr 12, 2024
c3ed8e7
Update BUILDING.md -- fixed typo
000MDK Apr 12, 2024
70b6d61
Update BUILDING.md -- MacOS Xcode added
000MDK Apr 15, 2024
542e34d
Merge branch 'nukeykt:master' into building.md
000MDK Apr 15, 2024
1047d3a
Delete app.ico -- rebranching
000MDK Apr 15, 2024
b597897
Delete app.rc -- rebranching
000MDK Apr 15, 2024
8523ca7
Update CMakeLists.txt -- revert changes for rebranching
000MDK Apr 15, 2024
8cc6565
Update BUILDING.md -- added prereqs for VS22
000MDK Apr 15, 2024
273ec39
Update CMakeLists.txt -- fix building with MSVC
000MDK Apr 16, 2024
dbdd67d
Update BUILDING.md -- MSVS22 updated
000MDK Apr 16, 2024
7bc83ee
Update BUILDING.md -- fixed MSVS2022 example build type
000MDK Apr 16, 2024
d4ab507
Update BUILDING.md -- MSVS2022 prereq + example update 1
000MDK Apr 16, 2024
3bcd9c2
Update BUILDING.md -- MSVS2022 completed, MSYS2 updated
000MDK Apr 16, 2024
0632d93
Update BUILDING.md -- added generic instructions for cmake, fixed typos
000MDK Apr 16, 2024
f52a5c8
Update BUILDING.md -- replaced pkg-config with pkgconf
000MDK Apr 16, 2024
7d7ac04
Update BUILDING.md -- fixed formatting
000MDK Apr 16, 2024
98b1c9d
Update BUILDING.md -- MSVS2022 improvement - SDL2_DIR note
000MDK Apr 16, 2024
5110bea
Update BUILDING.md -- MSYS2 formatting
000MDK Apr 16, 2024
8cb3f3d
add file -- buildscript for msvc without vcpkg
000MDK Apr 16, 2024
2f02f41
Update BUILDING.md -- msvc-buildscript addition preflight
000MDK Apr 16, 2024
ba751d5
Update msvc-build-release64.cmd -- removed last line
000MDK Apr 16, 2024
6c54a44
add msvc buildscript (vcpkg)
000MDK Apr 16, 2024
92da4ee
Update BUILDING.md -- added MSVC buildscripts
000MDK Apr 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# **building instructions for Nuked-SC55**

## CMake

**generic instructions for CMake**

### Ninja

#### **install prerequisites:**

`git cmake pkg-config ninja SDL2` and a c-compiler capable of C++11

#### **build:**

```
git clone --recurse-submodules https://github.com/nukeykt/Nuked-SC55.git
cd .\Nuked-SC55
cmake . -DCMAKE_BUILD_TYPE=Release -GNinja
cmake --build .
```

## Linux

T.B.D.

## MacOS

### Xcode


#### **install prerequisites (brew/macports - untested):**
```
git
cmake
SDL2
```
#### **build:**

open terminal.app

`git clone --recurse-submodules https://github.com/nukeykt/Nuked-SC55.git`

create an Xcode project:

```
$ cd Nuked-SC55
$ cmake -G Xcode .
```

- open created Xcode project
- Product -> Scheme -> Edit Scheme -> Build Configuration set to Release
- build
- copy data/back.data the same directory as built binary



## Windows

### VisualStudio 2022

#### **install prerequisites:**
- ##### Visual Studio with Windows SDK and [CMake](https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170)

- ##### git:
in cmd:
```
winget install Git.Git
```

**[manual handling of SDL2 dependency](#underlined-text)**

#### **build:**

note: example msvc-build-release64.cmd uses hardcoded urls for SDL2-download and thus might fail
use VCPKG-version described [below](https://github.com/000MDK/Nuked-SC55/edit/building.md/BUILDING.md#vcpkg-handling-of-sdl2-dependency) instead.

#### **use `msvc-build-release64.cmd`**

in new cmd:

```
git clone --recurse-submodules https://github.com/nukeykt/Nuked-SC55.git
cd .\Nuked-SC55
.\msvc-build-release64.cmd
```

**[VCPKG handling of SDL2 dependency](#underlined-text)**

#### **install prerequisites:**

- ##### [vcpkg](https://github.com/microsoft/vcpkg):

in new cmd:
```
c:
cd %ProgramData%
git clone https://github.com/microsoft/vcpkg
cd vcpkg
setx VCPKG_PATH %cd%
setx PATH "%PATH%;%cd%"
.\bootstrap-vcpkg.bat -disableMetrics
```

in new admin-cmd:

`C:\ProgramData\vcpkg\vcpkg integrate install`

- ##### pkgconf:

in new cmd:
```
vcpkg install pkgconf
```

- ##### [SDL2](https://github.com/libsdl-org)

in new cmd:
```
vcpkg install SDL2 SDL2-image
```

#### **build:**

#### **use `msvc-vcpkg-build-release64.cmd`**

in new cmd:

```
git clone --recurse-submodules https://github.com/nukeykt/Nuked-SC55.git
cd .\Nuked-SC55
.\msvc-vcpkg-build-release64.cmd
```

###### note: if SDL2 can't be found use

`setx SDL2_DIR %VCPKG_PATH%\installed\x64-windows\share\sdl2` (permanent, must reopen cmd to use) or

`set SDL2_DIR=%VCPKG_PATH%\installed\x64-windows\share\sdl2` (temporary, only for currently open cmd)



### MSYS2

[MSYS2](https://www.msys2.org/wiki/MSYS2-installation/)-**MSYS2 MinGW32** shell

#### **install prerequisites:**
```
pacman -S base-devel libtool pkg-config make gettext gcc git cmake mingw-w64-i686-gcc mingw-w64-x86_64-gcc mingw-w64-i686-cmake mingw-w64-x86_64-cmake mingw-w64-i686-pkg-config mingw-w64-x86_64-pkg-config mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain mingw-w64-i686-SDL2 mingw-w64-x86_64-SDL2
```
note: you are asked twice to make a selection - just press "Return"/"Enter" to select all

#### **build:**

#### **use `msys2mingw32-build-release.sh`**

```
git clone --recurse-submodules https://github.com/nukeykt/Nuked-SC55.git
cd ./Nuked-SC55
sh ./msys2mingw32-build-release.sh
```
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ else()
target_link_libraries(nuked-sc55 PRIVATE ${SDL2_LIBRARIES})
endif()

# Add linker flag MSVC
if(MSVC)
set_property(TARGET "nuked-sc55" APPEND_STRING PROPERTY LINK_FLAGS " /ENTRY:WinMainCRTStartup")
endif()

if(USE_RTMIDI)
if(USE_SYSTEM_RTMIDI)
target_compile_options(nuked-sc55 PRIVATE ${SYSTEM_RTMIDI_CFLAGS})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Nuked SC-55
Roland SC-55 emulator, by nukeykt.
Roland SC-55 emulator, by [nukeykt](https://github.com/nukeykt).

Supported models:
- SC-55mk2 (v1.01 firmware is confirmed to work)
Expand Down
11 changes: 11 additions & 0 deletions msvc-build-release64.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@ECHO OFF
wget https://github.com/libsdl-org/SDL/releases/download/release-2.30.2/SDL2-devel-2.30.2-VC.zip
tar -xf SDL2-devel-2.30.2-VC.zip
del SDL2-devel-2.30.2-VC.zip
set SDL2_DIR %cd%\SDL2-2.30.2\cmake
cmake . -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -G"Visual Studio 17 2022"
cmake --build . --config Release
copy .\data\back.data .\Release
copy %SDL2_DIR%\..\lib\x64\SDL2.dll .\Release
move .\Release\nuked-sc55.exe .\Release\sc55emu.exe
start .\Release
5 changes: 5 additions & 0 deletions msvc-vcpkg-build-release64.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmake . -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -G"Visual Studio 17 2022"
cmake --build . --config Release
copy .\data\back.data .\Release
move .\Release\nuked-sc55.exe .\Release\sc55emu.exe
explorer .\Release
12 changes: 12 additions & 0 deletions msys2mingw32-build-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#/bin/sh
cmake . -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -G "MinGW Makefiles"
mingw32-make
mkdir ./release
cp ./nuked-sc55.exe ./release/sc55emu.exe
cp ./back.data ./release/back.data
cp ./README.md ./release/README.md
cp /mingw32/bin/libgcc_s_dw2-1.dll ./release/libgcc_s_dw2-1.dll
cp /mingw32/bin/libstdc++-6.dll ./release/libstdc++-6.dll
cp /mingw32/bin/SDL2.dll ./release/SDL2.dll
start release
cd ..