Giter Club home page Giter Club logo

Comments (8)

Saibamen avatar Saibamen commented on April 27, 2024 1

Please create Pull Request

from devilution.

crackedmind avatar crackedmind commented on April 27, 2024 1

Also, not really a fan of using CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to set the option globally and prefer to set it on each target as necessary, but it's fine here I guess?

because, i had some troubles with def file and vc++ linker

@OvermindDL1

It's generally very bad form to use something like DEVILUTION_SRC and instead should just list the source files in the add_* calls directly.

why? cmake authors use the same https://gitlab.kitware.com/cmake/cmake/blob/master/Source/CMakeLists.txt#L105

from devilution.

OvermindDL1 avatar OvermindDL1 commented on April 27, 2024

Good start. :-)

A few notes about it:

  • Should add the version information, homepage (this git repo?), etc... to the project call. Might also be good to explicitly list LANGUAGES CXX to make it explicit what is in use, though this is optional as the default value is built-in as LANGUAGES CXX C ASM (though could set it to that).
  • It's generally very bad form to use something like DEVILUTION_SRC and instead should just list the source files in the add_* calls directly.
  • Should also use target_include_directories to add the include directories as well (even if it is just the source directory).
  • add_library generally should use a namespaced alias as well, though in this specific reverse engineering case it's not really needed, but it is still good form.
  • Traditionally variables should not be used in the target field either (the ${PROJECT_NAME} bits) as explicit names is always preferred over implicit so you know what exactly is being created here instead of needing to go look up at the project definition to find out.
  • Oh, and when things like the source files are moved to the add_executable and so forth things (as well as the add_library) each file listed should be on it's own line, indented over (I prefer a tab so I can set the displayed tab width to whatever I want for the display I'm on, but it doesn't really matter, though as always "Tabs for Indentation, Spaces for alignment" and all), as it increases readability.

:-)

from devilution.

OvermindDL1 avatar OvermindDL1 commented on April 27, 2024

Also, not really a fan of using CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to set the option globally and prefer to set it on each target as necessary, but it's fine here I guess? Though I'm unsure that the executable itself needs it set anyway, or even the libraries depending on how they are programmed?

from devilution.

OvermindDL1 avatar OvermindDL1 commented on April 27, 2024

why?

It's just considered poor form nowadays as it separates concerns that don't need to be separated. Using a variable implies the source files are used in multiple targets instead of just one. They are entirely fine to use if the file lists will be shared however, but if only a single target uses them then they shouldn't. See CGold.

from devilution.

 avatar commented on April 27, 2024

Does this work with the latest commit? If so, what are the advantages of the project being CMake compatible?

from devilution.

mewmew avatar mewmew commented on April 27, 2024

Unless anyone wishes to work on integrating CMake into Devilution, I suggest we close this issue as most users would be building DevilutionX which already supports CMake builds. Devilution is only ever used to verify binary accuracy and thus requires the original build environment.

from devilution.

AJenbo avatar AJenbo commented on April 27, 2024

Agreed, the only reason we also build with other compilers is to avoid tainting the code with things that is to specific to Windows 95 workstations.

from devilution.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.