mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
squash - Don't set CMAKE_CXX_FLAGS and let CMAKE_MSVC_RUNTIME_LIBRARY do it for us
This commit is contained in:
parent
1ae3f90ad0
commit
965dc94899
1 changed files with 6 additions and 9 deletions
|
@ -5,17 +5,20 @@ if(EXT_PLATFORM_STRING)
|
|||
endif()
|
||||
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(Luau LANGUAGES CXX C)
|
||||
|
||||
option(LUAU_BUILD_CLI "Build CLI" ON)
|
||||
option(LUAU_BUILD_TESTS "Build tests" ON)
|
||||
option(LUAU_BUILD_WEB "Build Web module" OFF)
|
||||
option(LUAU_WERROR "Warnings as errors" OFF)
|
||||
option(LUAU_STATIC_CRT "Link with the static CRT (/MT)" OFF)
|
||||
|
||||
if(MSVC)
|
||||
option(LUAU_STATIC_CRT "Link with the static CRT (/MT)" OFF)
|
||||
if(LUAU_STATIC_CRT)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
endif()
|
||||
|
||||
project(Luau LANGUAGES CXX C)
|
||||
add_library(Luau.Ast STATIC)
|
||||
add_library(Luau.Compiler STATIC)
|
||||
add_library(Luau.Analysis STATIC)
|
||||
|
@ -64,12 +67,6 @@ set(LUAU_OPTIONS)
|
|||
if(MSVC)
|
||||
list(APPEND LUAU_OPTIONS /D_CRT_SECURE_NO_WARNINGS) # We need to use the portable CRT functions.
|
||||
list(APPEND LUAU_OPTIONS /MP) # Distribute single project compilation across multiple cores
|
||||
|
||||
if(LUAU_STATIC_CRT)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
||||
endif()
|
||||
else()
|
||||
list(APPEND LUAU_OPTIONS -Wall) # All warnings
|
||||
endif()
|
||||
|
|
Loading…
Add table
Reference in a new issue