abishekvashok / cmatrix

Terminal based "The Matrix" like implementation
GNU General Public License v3.0
3.99k stars 412 forks source link

Build failed. Should we add -D_XOPEN_SOURCE_EXTENDED in CMakeLists.txt? #167

Open shengyang998 opened 1 year ago

shengyang998 commented 1 year ago

Build failed on macOS 13.1.

After adding -D_XOPEN_SOURCE_EXTENDED, the build is succeeded. FYI: https://stackoverflow.com/questions/5378778/what-does-d-xopen-source-do-mean

abishekvashok commented 1 year ago

Yes please :)

illegitimate-egg commented 1 year ago

Where does one put this in CMakeLists.txt?

abishekvashok commented 1 year ago

Yes

illegitimate-egg commented 1 year ago

I guess I should clarify what I meant. I don't use cmake personally. I was wondering where I should put the -D_XOPEN_SOURCE_EXTENDED flag in the CMakeLists.txt file

abishekvashok commented 1 year ago

We need to something like:

  set(CMAKE_C_FLAGS "-D_XOPEN_SOURCE=700")

please see https://cmake.org/cmake/help/latest/guide/tutorial/index.html for more information about cmake :)