diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d1cbf9..ee79351 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,11 +8,27 @@ set(SOURCE sources/main.cpp) set(LIBS ${CMAKE_SOURCE_DIR}/libs/) set(INCLUDE ${CMAKE_SOURCE_DIR}/include/) set(TESTS ${CMAKE_SOURCE_DIR}/tests) +set(CMAKE_C_COMPILER "clang") +set(CMAKE_CXX_COMPILER "clang++") +find_program(CMAKE_C_COMPILER clang) +find_program(CLANG_CXX_COMPILER clang++) find_package(CURL REQUIRED) find_path(IXWEBSOCKET_INCLUDE_DIR ixwebsocket) find_library(IXWEBSOCKET_LIBRARIES ixwebsocket) +if(NOT CMAKE_C_COMPILER OR NOT CLANG_CXX_COMPILER) + message(STATUS "clang not found") + set(CMAKE_C_COMPILER gcc) + set(CMAKE_CXX_COMPILER g++) + find_program(CMAKE_C_COMPILER gcc) + find_program(CLANG_CXX_COMPILER g++) + if(NOT CMAKE_C_COMPILER OR NOT CLANG_CXX_COMPILER) + message(FATAL_ERROR "gcc not found") + endif() +endif() +message(STATUS "current compiler: ${CMAKE_C_COMPILER}") + if(NOT IXWEBSOCKET_INCLUDE_DIR OR NOT IXWEBSOCKET_LIBRARIES) message(FATAL_ERROR "ixwebsocket not found") endif() diff --git a/README.md b/README.md index e3f55e0..a7582a1 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,5 @@ cmake .. && make -j$(nproc) - [ ] Full api support - [ ] Fixes for known bugs - [ ] Windows support -- [ ] Sharding \ No newline at end of file +- [ ] Sharding +- [ ] Tests \ No newline at end of file