Skip to content

Commit

Permalink
Cleanup CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Oct 8, 2022
1 parent 4a732b2 commit 29b041f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 86 deletions.
17 changes: 7 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
cmake_minimum_required (VERSION 3.0)
project(whisper.cpp VERSION 0.1.0)
project(whisper.cpp VERSION 1.0.0)

set(CMAKE_EXPORT_COMPILE_COMMANDS "on")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(WHISPER_STANDALONE ON)
include(cmake/GitVars.cmake)
include(cmake/BuildTypes.cmake)
else()
set(WHISPER_STANDALONE OFF)
endif()
Expand All @@ -22,7 +20,7 @@ option(WHISPER_SANITIZE_THREAD "whisper: enable thread sanitizer" OFF)
option(WHISPER_SANITIZE_ADDRESS "whisper: enable address sanitizer" OFF)
option(WHISPER_SANITIZE_UNDEFINED "whisper: enable undefined sanitizer" OFF)

option(WHISPER_BUILD_TESTS "whisper: build tests" ${WHISPER_STANDALONE})
option(WHISPER_BUILD_TESTS "whisper: build tests" ${WHISPER_STANDALONE})

option(WHISPER_SUPPORT_SDL2 "whisper: support for libSDL2" OFF)

Expand Down Expand Up @@ -55,7 +53,6 @@ find_package(Threads REQUIRED)

if (WHISPER_SUPPORT_SDL2)
# SDL2

find_package(SDL2 REQUIRED)

string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
Expand All @@ -64,7 +61,7 @@ if (WHISPER_SUPPORT_SDL2)
message(STATUS "SDL2_LIBRARIES = ${SDL2_LIBRARIES}")
endif()

# main
# compiler flags

if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
Expand All @@ -87,8 +84,6 @@ if (WHISPER_ALL_WARNINGS)
endif()
endif()

# compiler flags

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=vla")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-math-errno -ffinite-math-only -funsafe-math-optimizations")

Expand All @@ -101,11 +96,11 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx -mavx2 -mfma -mf16c")
endif()

# whisper
# whisper - this is the main library of the project

set(TARGET whisper)

add_library(${TARGET} SHARED
add_library(${TARGET}
ggml.c
whisper.cpp
)
Expand Down Expand Up @@ -135,6 +130,8 @@ install(TARGETS ${TARGET}
ARCHIVE DESTINATION lib/static
)

# programs, examples and tests

if (WHISPER_STANDALONE)
# main
set(TARGET main)
Expand Down
54 changes: 0 additions & 54 deletions cmake/BuildTypes.cmake

This file was deleted.

22 changes: 0 additions & 22 deletions cmake/GitVars.cmake

This file was deleted.

0 comments on commit 29b041f

Please sign in to comment.