Skip to content

Commit

Permalink
build: change executable name into "cataclysm-bn-tiles" (#4989)
Browse files Browse the repository at this point in the history
* Update CMakeLists.txt

* Update cataclysm-launcher

* Update gen_cli_docs.ts

* Update windist.ps1

* Update Cataclysm.sh

* Update vs_cmake.md

* Update debug.cpp

* Update deno.jsonc

* Update msys.md

* Update windows_limit_memory.py

* Update Cataclysm-vcpkg-static.vcxproj

* Update makefile.md

* Update cygwin.md

* Update CMakeLists.txt

* Update Makefile

* Update CMakeLists.txt

* Update cataclysm-launcher

Co-authored-by: scarf <greenscarf005@gmail.com>

---------

Co-authored-by: Chaosvolt <chaosvolt@users.noreply.github.com>
Co-authored-by: scarf <greenscarf005@gmail.com>
  • Loading branch information
3 people authored Jul 15, 2024
1 parent 2af587d commit 0d766dc
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 88 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ ifndef VERBOSE
VERBOSE = 0
endif

TARGET_NAME = cataclysm
TARGET_NAME = cataclysm-bn
TILES_TARGET_NAME = $(TARGET_NAME)-tiles

TARGET = $(BUILD_PREFIX)$(TARGET_NAME)
Expand Down
2 changes: 1 addition & 1 deletion build-data/osx/Cataclysm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ if [[ -f cataclysm ]]; then
osascript -e "tell application \"Terminal\" to activate do script \"${V_SHELL_SCRIPT}\""
else
export ${K_LIBRARY_PATH}=. ${K_FRAMEWORK_PATH}=.
./cataclysm-tiles
./cataclysm-bn-tiles
fi
2 changes: 1 addition & 1 deletion build-scripts/windist.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if (Test-path bindist) {
}

mkdir bindist
cp cataclysm-tiles.exe bindist/cataclysm-tiles.exe
cp cataclysm-bn-tiles.exe bindist/cataclysm-bn-tiles.exe
cp tools/format/json_formatter.exe bindist/json_formatter.exe

mkdir bindist/lang
Expand Down
2 changes: 1 addition & 1 deletion cataclysm-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cd "$DIR" || {
if [ ! -f "$BIN" ] || [ "$BIN" = "cataclysm-launcher" ]
then
BIN=
for bin in cataclysm-tiles cataclysm
for bin in cataclysm-bn-tiles cataclysm-bn
do
[ -f "$bin" ] && BIN="$bin" && break
done
Expand Down
4 changes: 2 additions & 2 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"tasks": {
"doc": "deno task doc:cli & deno task doc:lua && deno fmt",
"doc:cli": "deno run --allow-run=./cataclysm-tiles --allow-write=doc/src/content/docs ./scripts/gen_cli_docs.ts",
"doc:lua": "./cataclysm-tiles --lua-doc && cp config/lua_doc.md doc/src/content/docs/en/mod/lua/reference/lua.md",
"doc:cli": "deno run --allow-run=./cataclysm-bn-tiles --allow-write=doc/src/content/docs ./scripts/gen_cli_docs.ts",
"doc:lua": "./cataclysm-bn-tiles --lua-doc && cp config/lua_doc.md doc/src/content/docs/en/mod/lua/reference/lua.md",
"migrate-unit": "deno run -A scripts/migrate_legacy_unit.ts --path data/json; deno run -A scripts/migrate_legacy_unit.ts --path data/mods; make style-all-json-parallel",
"dprint": "deno run -A npm:dprint"
},
Expand Down
2 changes: 1 addition & 1 deletion doc/src/content/docs/en/dev/guides/building/cygwin.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ but `CYGWIN=1`, `DYNAMIC_LINKING=1` and `BACKTRACE=0` are required to compile wi

```bash
cd /cygdrive/c/dev/Cataclysm-BN
./cataclysm-tiles
./cataclysm-bn-tiles
```

There is no functionality for running Cygwin-compiled CBN from outside of UXTerm.
2 changes: 1 addition & 1 deletion doc/src/content/docs/en/dev/guides/building/makefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ For curses builds:
For SDL:

```sh
./cataclysm-tiles
./cataclysm-bn-tiles
```

For `app` builds, launch Cataclysm.app from Finder.
Expand Down
2 changes: 1 addition & 1 deletion doc/src/content/docs/en/dev/guides/building/msys.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ switches, but `MSYS2=1` and `DYNAMIC_LINKING=1` are required to compile without
1. Run inside MSYS2 from Cataclysm's directory with the following command:

```bash
./cataclysm-tiles
./cataclysm-bn-tiles
```

**Note:** If you want to run the compiled executable outside of MSYS2, you will also need to update
Expand Down
12 changes: 6 additions & 6 deletions doc/src/content/docs/en/dev/guides/building/vs_cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ side effects.

To start the game, run

- `.\Release\cataclysm-tiles.exe`
- `.\Release\cataclysm-bn-tiles.exe`

To execute tests, run

Expand All @@ -157,7 +157,7 @@ To execute tests, run
### Visual Studio (Option 1, Recommended)

Close Visual Studio, then navigate to `out\build\<preset>\` and open `CataclysmBN.sln`. Set
`cataclysm-tiles` as Startup Project (can be done with right click from Solution Explorer), and
`cataclysm-bn-tiles` as Startup Project (can be done with right click from Solution Explorer), and
you'll be able to run and debug the game executable without additional issues. It will already be
preconfigured to look for the data files in the top project directory.

Expand All @@ -171,9 +171,9 @@ nicely: https://stackoverflow.com/a/62309569 Fortunately, VS allows customizing
on individual basis.

Open solution explorer and switch it into CMake Targets mode if you haven't already (can be done
with a right click). There, right click on the `cataclysm-tiles` target ->
with a right click). There, right click on the `cataclysm-bn-tiles` target ->
`Add Debug Configuration`. Visual Studio will open launch configurations file for this project, with
new configuration for the `cataclysm-tiles` target. Add the following line:
new configuration for the `cataclysm-bn-tiles` target. Add the following line:

```
"currentDir": "${workspaceRoot}",
Expand All @@ -192,8 +192,8 @@ The final result should look something like this:
"currentDir": "${workspaceRoot}",
"type": "default",
"project": "CMakeLists.txt",
"projectTarget": "cataclysm-tiles.exe (<PATH_TO_SOURCE_FOLDER>\\Debug\\cataclysm-tiles.exe)",
"name": "cataclysm-tiles.exe (<PATH_TO_SOURCE_FOLDER>\\Debug\\cataclysm-tiles.exe)"
"projectTarget": "cataclysm-bn-tiles.exe (<PATH_TO_SOURCE_FOLDER>\\Debug\\cataclysm-bn-tiles.exe)",
"name": "cataclysm-bn-tiles.exe (<PATH_TO_SOURCE_FOLDER>\\Debug\\cataclysm-bn-tiles.exe)"
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions msvc-full-features/Cataclysm-vcpkg-static.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<EmbedManifest>false</EmbedManifest>
<TargetName>cataclysm-tiles</TargetName>
<TargetName>cataclysm-bn-tiles</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<EmbedManifest>false</EmbedManifest>
<TargetName>cataclysm-tiles</TargetName>
<TargetName>cataclysm-bn-tiles</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<EmbedManifest>false</EmbedManifest>
<TargetName>cataclysm-tiles</TargetName>
<TargetName>cataclysm-bn-tiles</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<EmbedManifest>false</EmbedManifest>
<TargetName>cataclysm-tiles</TargetName>
<TargetName>cataclysm-bn-tiles</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen_cli_docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ${sections}
}

if (import.meta.main) {
const command = new Deno.Command("./cataclysm-tiles", { args: ["--help"] })
const command = new Deno.Command("./cataclysm-bn-tiles", { args: ["--help"] })
const { stdout } = await command.output()

const text = new TextDecoder().decode(stdout)
Expand Down
126 changes: 63 additions & 63 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,72 +31,72 @@ add_custom_command(
# Build tiles version if requested
if (TILES)
add_library(
cataclysm-tiles-common OBJECT
cataclysm-bn-tiles-common OBJECT
${CATACLYSM_BN_SOURCES}
${CATACLYSM_BN_HEADERS})
target_include_directories(cataclysm-tiles-common INTERFACE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(cataclysm-bn-tiles-common INTERFACE ${CMAKE_SOURCE_DIR}/src)

if (WIN32)
add_definitions(-DUSE_WINMAIN)
add_executable(
cataclysm-tiles WIN32
cataclysm-bn-tiles WIN32
${MAIN_CPP}
${MESSAGES_CPP}
${RESOURCE_RC})
else ()
add_executable(cataclysm-tiles
add_executable(cataclysm-bn-tiles
${MAIN_CPP}
${MESSAGES_CPP})
endif ()

if (LUA)
target_compile_definitions(cataclysm-tiles-common PUBLIC LUA)
target_compile_definitions(cataclysm-bn-tiles-common PUBLIC LUA)
if (UNIX)
target_compile_definitions(cataclysm-tiles-common PUBLIC LUA_USE_LINUX)
target_compile_definitions(cataclysm-bn-tiles-common PUBLIC LUA_USE_LINUX)
elseif (APPLE)
target_compile_definitions(cataclysm-tiles-common PUBLIC LUA_USE_MACOSX)
target_compile_definitions(cataclysm-bn-tiles-common PUBLIC LUA_USE_MACOSX)
endif()
target_link_libraries(cataclysm-tiles-common PUBLIC libsol)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC libsol)
endif ()

add_dependencies(cataclysm-tiles-common get_version)
add_dependencies(cataclysm-bn-tiles-common get_version)

target_link_libraries(cataclysm-tiles PRIVATE cataclysm-tiles-common)
target_compile_definitions(cataclysm-tiles-common PUBLIC TILES )
target_link_libraries(cataclysm-bn-tiles PRIVATE cataclysm-bn-tiles-common)
target_compile_definitions(cataclysm-bn-tiles-common PUBLIC TILES )

if (NOT "${CMAKE_EXPORT_COMPILE_COMMANDS}")
target_precompile_headers(cataclysm-tiles-common PRIVATE
target_precompile_headers(cataclysm-bn-tiles-common PRIVATE
${CMAKE_SOURCE_DIR}/pch/main-pch.hpp)
endif ()

if (CMAKE_USE_PTHREADS_INIT)
target_compile_options(cataclysm-tiles-common PUBLIC "-pthread")
target_compile_options(cataclysm-bn-tiles-common PUBLIC "-pthread")
endif ()

if (CMAKE_THREAD_LIBS_INIT)
target_link_libraries(cataclysm-tiles-common PUBLIC ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(cataclysm-bn-tiles-common PUBLIC ${CMAKE_THREAD_LIBS_INIT})
endif ()

if (NOT DYNAMIC_LINKING)
target_link_libraries(cataclysm-tiles-common PUBLIC
target_link_libraries(cataclysm-bn-tiles-common PUBLIC
SDL2::SDL2-static
SDL2_image::SDL2_image-static
SDL2_ttf::SDL2_ttf-static
)
else()
target_link_libraries(cataclysm-tiles-common PUBLIC
target_link_libraries(cataclysm-bn-tiles-common PUBLIC
SDL2::SDL2
SDL2_image::SDL2_image
SDL2_ttf::SDL2_ttf
)
endif ()
if (SOUND)
if (NOT DYNAMIC_LINKING)
target_link_libraries(cataclysm-tiles-common PUBLIC
target_link_libraries(cataclysm-bn-tiles-common PUBLIC
SDL2_mixer::SDL2_mixer-static
)
else()
target_link_libraries(cataclysm-tiles-common PUBLIC
target_link_libraries(cataclysm-bn-tiles-common PUBLIC
SDL2_mixer::SDL2_mixer
)
endif()
Expand All @@ -105,117 +105,117 @@ if (TILES)

if (WIN32)
# Global settings for Windows targets (at end)
target_link_libraries(cataclysm-tiles-common PUBLIC gdi32.lib)
target_link_libraries(cataclysm-tiles-common PUBLIC winmm.lib)
target_link_libraries(cataclysm-tiles-common PUBLIC imm32.lib)
target_link_libraries(cataclysm-tiles-common PUBLIC ole32.lib)
target_link_libraries(cataclysm-tiles-common PUBLIC oleaut32.lib)
target_link_libraries(cataclysm-tiles-common PUBLIC version.lib)
target_link_libraries(cataclysm-tiles-common PUBLIC setupapi.lib)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC gdi32.lib)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC winmm.lib)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC imm32.lib)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC ole32.lib)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC oleaut32.lib)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC version.lib)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC setupapi.lib)
if (SOUND)
target_link_libraries(cataclysm-tiles-common PUBLIC shlwapi.lib)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC shlwapi.lib)
endif()
if (BACKTRACE)
target_link_libraries(cataclysm-tiles-common PUBLIC dbghelp.lib)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC dbghelp.lib)
if (LIBBACKTRACE)
target_link_libraries(cataclysm-tiles-common PUBLIC backtrace)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC backtrace)
endif ()
endif ()
elseif (APPLE)
target_link_libraries(cataclysm-tiles-common PUBLIC "-framework CoreFoundation")
target_link_libraries(cataclysm-bn-tiles-common PUBLIC "-framework CoreFoundation")
endif ()

if (LIBBACKTRACE)
target_link_libraries(cataclysm-tiles-common PUBLIC backtrace)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC backtrace)
endif ()

if (USE_TRACY)
target_link_libraries(cataclysm-tiles-common PUBLIC TracyClient)
target_include_directories(cataclysm-tiles-common SYSTEM PUBLIC ${tracy_SOURCE_DIR}/public)
target_compile_definitions(cataclysm-tiles-common PUBLIC USE_TRACY)
target_link_libraries(cataclysm-bn-tiles-common PUBLIC TracyClient)
target_include_directories(cataclysm-bn-tiles-common SYSTEM PUBLIC ${tracy_SOURCE_DIR}/public)
target_compile_definitions(cataclysm-bn-tiles-common PUBLIC USE_TRACY)
endif ()

if (RELEASE)
install(TARGETS cataclysm-tiles RUNTIME)
install(TARGETS cataclysm-bn-tiles RUNTIME)
endif ()

set_target_properties( cataclysm-tiles PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" )
set_target_properties( cataclysm-bn-tiles PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" )
endif ()

# Build curses version if requested
if (CURSES)
add_library(cataclysm-common OBJECT
add_library(cataclysm-bn-common OBJECT
${CATACLYSM_BN_SOURCES}
${CATACLYSM_BN_HEADERS})
target_include_directories(cataclysm-common INTERFACE ${CMAKE_SOURCE_DIR}/src)
target_include_directories(cataclysm-bn-common INTERFACE ${CMAKE_SOURCE_DIR}/src)

if (NOT "${CMAKE_EXPORT_COMPILE_COMMANDS}")
target_precompile_headers(cataclysm-common PRIVATE
target_precompile_headers(cataclysm-bn-common PRIVATE
${CMAKE_SOURCE_DIR}/pch/main-pch.hpp)
endif ()

if (WIN32)
add_executable(cataclysm
add_executable(cataclysm-bn
${MAIN_CPP}
${MESSAGES_CPP}
${RESOURCE_RC})
else ()
add_executable(cataclysm
add_executable(cataclysm-bn
${MAIN_CPP}
${MESSAGES_CPP})
endif ()

if (LUA)
target_compile_definitions(cataclysm-common PUBLIC LUA)
target_compile_definitions(cataclysm-bn-common PUBLIC LUA)
if (UNIX)
target_compile_definitions(cataclysm-common PUBLIC LUA_USE_LINUX)
target_compile_definitions(cataclysm-bn-common PUBLIC LUA_USE_LINUX)
elseif (APPLE)
target_compile_definitions(cataclysm-common PUBLIC LUA_USE_MACOSX)
target_compile_definitions(cataclysm-bn-common PUBLIC LUA_USE_MACOSX)
endif()
target_link_libraries(cataclysm-common PUBLIC libsol)
target_link_libraries(cataclysm-bn-common PUBLIC libsol)
endif ()

add_dependencies(cataclysm-common get_version)
target_link_libraries(cataclysm PRIVATE cataclysm-common)
add_dependencies(cataclysm-bn-common get_version)
target_link_libraries(cataclysm-bn PRIVATE cataclysm-bn-common)

target_include_directories(cataclysm-common PUBLIC ${CURSES_INCLUDE_DIR})
target_link_libraries(cataclysm-common PUBLIC ${CURSES_LIBRARIES})
target_include_directories(cataclysm-bn-common PUBLIC ${CURSES_INCLUDE_DIR})
target_link_libraries(cataclysm-bn-common PUBLIC ${CURSES_LIBRARIES})

if (CMAKE_USE_PTHREADS_INIT)
target_compile_options(cataclysm-common PUBLIC "-pthread")
target_compile_options(cataclysm-bn-common PUBLIC "-pthread")
endif ()

if (CMAKE_THREAD_LIBS_INIT)
target_link_libraries(cataclysm-common PUBLIC ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(cataclysm-bn-common PUBLIC ${CMAKE_THREAD_LIBS_INIT})
endif ()

if (WIN32)
# Global settings for Windows targets (at end)
target_link_libraries(cataclysm-common PUBLIC gdi32.lib)
target_link_libraries(cataclysm-common PUBLIC winmm.lib)
target_link_libraries(cataclysm-common PUBLIC imm32.lib)
target_link_libraries(cataclysm-common PUBLIC ole32.lib)
target_link_libraries(cataclysm-common PUBLIC oleaut32.lib)
target_link_libraries(cataclysm-common PUBLIC version.lib)
target_link_libraries(cataclysm-bn-common PUBLIC gdi32.lib)
target_link_libraries(cataclysm-bn-common PUBLIC winmm.lib)
target_link_libraries(cataclysm-bn-common PUBLIC imm32.lib)
target_link_libraries(cataclysm-bn-common PUBLIC ole32.lib)
target_link_libraries(cataclysm-bn-common PUBLIC oleaut32.lib)
target_link_libraries(cataclysm-bn-common PUBLIC version.lib)
if (BACKTRACE)
target_link_libraries(cataclysm-common PUBLIC dbghelp.lib)
target_link_libraries(cataclysm-bn-common PUBLIC dbghelp.lib)
endif ()
elseif (APPLE)
target_link_libraries(cataclysm-common PUBLIC "-framework CoreFoundation")
target_link_libraries(cataclysm-bn-common PUBLIC "-framework CoreFoundation")
endif ()

if (LIBBACKTRACE)
target_link_libraries(cataclysm-common PUBLIC backtrace)
target_link_libraries(cataclysm-bn-common PUBLIC backtrace)
endif ()

if (USE_TRACY)
target_link_libraries(cataclysm-common PUBLIC TracyClient)
target_include_directories(cataclysm-common SYSTEM PUBLIC ${tracy_SOURCE_DIR}/public)
target_compile_definitions(cataclysm-common PUBLIC USE_TRACY)
target_link_libraries(cataclysm-bn-common PUBLIC TracyClient)
target_include_directories(cataclysm-bn-common SYSTEM PUBLIC ${tracy_SOURCE_DIR}/public)
target_compile_definitions(cataclysm-bn-common PUBLIC USE_TRACY)
endif ()

if (RELEASE)
install(TARGETS cataclysm RUNTIME)
install(TARGETS cataclysm-bn RUNTIME)
endif ()
endif ()

Expand Down
Loading

0 comments on commit 0d766dc

Please sign in to comment.