Skip to content

Allow build and run in repo folder in CMake#52976

Merged
kevingranade merged 1 commit intoCleverRaven:masterfrom
BrettDong:cmake
Nov 24, 2021
Merged

Allow build and run in repo folder in CMake#52976
kevingranade merged 1 commit intoCleverRaven:masterfrom
BrettDong:cmake

Conversation

@BrettDong
Copy link
Copy Markdown
Member

Summary

Build "Allow build and run in repo folder in CMake"

Purpose of change

When compiling a -O2 build, DATA_DIR_PREFIX macro is defined in CMake build script and there is no way to configure this behaviour. It makes running the game in repo impossible, because C++ code sets internal prefix path to <base_path>/share/cataclysm-dda when the macro is defined, and only a few sub directories can be manually override via launch parameters.

Describe the solution

Add USE_PREFIX_DATA_DIR CMake option defaults to true that controls the behaviour of defining DATA_DIR_PREFIX macro in Release build.

Describe alternatives you've considered

Testing

Additional context

@BrettDong BrettDong added the Code: Build Issues regarding different builds and build environments label Nov 23, 2021
@kevingranade kevingranade merged commit 256ef33 into CleverRaven:master Nov 24, 2021
@BrettDong BrettDong deleted the cmake branch November 24, 2021 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code: Build Issues regarding different builds and build environments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants