Skip to content

Commit 161ba98

Browse files
committed
Use CMAKE_C[XX]_STANDARD
1 parent 487336f commit 161ba98

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,14 @@ option(LLAMA_BUILD_EXAMPLES "llama: build examples" ${LLAMA_STANDALONE})
6868
# Compile flags
6969
#
7070

71+
set(CMAKE_CXX_STANDARD 11)
7172
set(CMAKE_CXX_STANDARD_REQUIRED true)
73+
set(CMAKE_C_STANDARD 11)
7274
set(CMAKE_C_STANDARD_REQUIRED true)
7375
set(THREADS_PREFER_PTHREAD_FLAG ON)
7476
find_package(Threads REQUIRED)
7577

7678
if (NOT MSVC)
77-
add_compile_options(
78-
"$<$<COMPILE_LANGUAGE:C>:-std=c11>"
79-
"$<$<COMPILE_LANGUAGE:CXX>:-std=c++11>"
80-
)
81-
8279
if (LLAMA_SANITIZE_THREAD)
8380
add_compile_options(-fsanitize=thread)
8481
link_libraries(-fsanitize=thread)

0 commit comments

Comments
 (0)