Skip to content

Commit

Permalink
use MSVC_STATIC support
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreguillot committed Aug 4, 2020
1 parent 1127b60 commit 210a1a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
14 changes: 0 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@ if(UNIX AND NOT APPLE)
set(FAUST_LIBS "stdc++" CACHE STRING "FAUST LIBRARIES" FORCE)
endif()

## For Windows use static runtime instead of default dynamic runtime
if(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "/MT" CACHE STRING "FORCE CXX FLAGS" FORCE)
set(CMAKE_C_FLAGS_RELEASE "/MT" CACHE STRING "FORCE C FLAGS" FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "/MTd" CACHE STRING "FORCE CXX FLAGS" FORCE)
set(CMAKE_C_FLAGS_DEBUG "/MTd" CACHE STRING "FORCE C FLAGS" FORCE)
set(CompilerFlags
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
endif()

include(FaustLib.cmake)
## Create Faust~
message(STATUS "faustgen~ external")
Expand Down
20 changes: 6 additions & 14 deletions FaustLib.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
## Create Faust Lib
message(STATUS "Faust Library")

## For Windows use static runtime instead of default dynamic runtime
if(MSVC)
set(CompilerFlags
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
endif()

## Save the llvm directory and change it for subdirectory
if(DEFINED LLVM_DIR)
Expand All @@ -18,11 +9,12 @@ if(DEFINED LLVM_DIR)
endif()

## Hardcoded targets for faust
set(INCLUDE_STATIC ON CACHE STRING "Include static library" FORCE)
set(INCLUDE_EXECUTABLE OFF CACHE STRING "Include runtime executable" FORCE)
set(INCLUDE_DYNAMIC OFF CACHE STRING "Include dynamic library" FORCE)
set(INCLUDE_OSC OFF CACHE STRING "Include Faust OSC library" FORCE)
set(INCLUDE_HTTP OFF CACHE STRING "Include Faust HTTPD library" FORCE)
set(MSVC_STATIC ON CACHE STRING "Use static runtimes with MSVC" FORCE)
set(INCLUDE_STATIC ON CACHE STRING "Include static library" FORCE)
set(INCLUDE_EXECUTABLE OFF CACHE STRING "Include runtime executable" FORCE)
set(INCLUDE_DYNAMIC OFF CACHE STRING "Include dynamic library" FORCE)
set(INCLUDE_OSC OFF CACHE STRING "Include Faust OSC library" FORCE)
set(INCLUDE_HTTP OFF CACHE STRING "Include Faust HTTPD library" FORCE)

## Hardcoded backends for faust
set(ASMJS_BACKEND OFF CACHE STRING "Include ASMJS backend" FORCE)
Expand Down

0 comments on commit 210a1a9

Please sign in to comment.