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

CMake support? #16

Closed
pierre-aimi opened this issue Mar 3, 2023 · 4 comments
Closed

CMake support? #16

pierre-aimi opened this issue Mar 3, 2023 · 4 comments

Comments

@pierre-aimi
Copy link
Contributor

Would you consider a CMakeLists.txt file in your repo to offer CMake compilation support?

I just used this one to compile on Windows, and it should work without modification on Linux/MacOS I think.

cmake_minimum_required(VERSION 3.1 FATAL_ERROR)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED on)

project(xxd LANGUAGES C CXX)

file(GLOB SOURCES
    "src/*.c"
)

set(EXE xxd)

add_executable(${EXE} ${SOURCES}

On Windows you need to set up a MSVC environment in a command prompt - e.g. for VS2022 I ran "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"

then it's just

mkdir build
cd build
cmake .. -G Ninja && ninja

Having CMake support would allow us to better integrate xxd

@ckormanyos
Copy link
Owner

ckormanyos commented Mar 3, 2023

Sure I’d be very happy to support a CMake build. I’ll be absent for the next three weeks or so, which means this will probably wait until then. But when I return, let’s try to get a CMake build running and commited and I’d also like it in a few Cl jobs. Thanks for this suggestion

@pierre-aimi
Copy link
Contributor Author

Ok great! Ping me when you are back

@ckormanyos
Copy link
Owner

Hi @pierre-aimi I have returned to development and just approved CI in your PR, #17

@ckormanyos
Copy link
Owner

ckormanyos commented Mar 14, 2023

Hello @pierre-aimi this is now fixed by #17 and merged to main. Thank you for adding this feature.

If anything elas is missing/needed/helpful, please feel free to re-open this or another PR any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants