mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add a build option to link with the static CRT
This commit is contained in:
parent
e51ff38d19
commit
1ae3f90ad0
1 changed files with 10 additions and 0 deletions
|
@ -12,6 +12,10 @@ option(LUAU_BUILD_TESTS "Build tests" ON)
|
||||||
option(LUAU_BUILD_WEB "Build Web module" OFF)
|
option(LUAU_BUILD_WEB "Build Web module" OFF)
|
||||||
option(LUAU_WERROR "Warnings as errors" OFF)
|
option(LUAU_WERROR "Warnings as errors" OFF)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
option(LUAU_STATIC_CRT "Link with the static CRT (/MT)" OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_library(Luau.Ast STATIC)
|
add_library(Luau.Ast STATIC)
|
||||||
add_library(Luau.Compiler STATIC)
|
add_library(Luau.Compiler STATIC)
|
||||||
add_library(Luau.Analysis STATIC)
|
add_library(Luau.Analysis STATIC)
|
||||||
|
@ -60,6 +64,12 @@ set(LUAU_OPTIONS)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
list(APPEND LUAU_OPTIONS /D_CRT_SECURE_NO_WARNINGS) # We need to use the portable CRT functions.
|
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
|
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()
|
else()
|
||||||
list(APPEND LUAU_OPTIONS -Wall) # All warnings
|
list(APPEND LUAU_OPTIONS -Wall) # All warnings
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Add table
Reference in a new issue