diff --git a/CMakeLists.txt b/CMakeLists.txt index 0192c5dec..a33f65ac2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -480,7 +480,7 @@ elseif(WIN32) ${PROJECT_SOURCE_DIR}/glew32.dll ${PROJECT_SOURCE_DIR}/libcurl-x64.dll ${PROJECT_SOURCE_DIR}/libfreetype.dll - ${PROJECT_SOURCE_DIR}/liblunasvg.a + ${PROJECT_SOURCE_DIR}/liblunasvg.dll ${PROJECT_SOURCE_DIR}/libpugixml.dll ${PROJECT_SOURCE_DIR}/libSDL2main.a ${PROJECT_SOURCE_DIR}/librlottie.dll diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index a4bbd01e7..085391144 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -139,6 +139,7 @@ if(WIN32) ../libcrypto-1_1-x64.dll ../libcurl-x64.dll ../libssl-1_1-x64.dll + ../lunasvg.dll ../MSVCP140.dll ../pugixml.dll ../rlottie.dll @@ -160,6 +161,7 @@ if(WIN32) ../libcrypto-1_1-x64.dll ../libcurl-x64.dll ../libfreetype.dll + ../liblunasvg.dll ../libpugixml.dll ../librlottie.dll ../libssl-1_1-x64.dll diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 446ed701f..da66e0b73 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -6,41 +6,57 @@ # CMake configuration for bundled dependencies built in-tree. # -if (CMAKE_BUILD_TYPE MATCHES Profiling) - set (CMAKE_BUILD_TYPE Debug) -elseif(NOT CMAKE_BUILD_TYPE MATCHES Debug) +# This makes it possible to set options in subprojects. +set (CMAKE_POLICY_DEFAULT_CMP0077 NEW) + +if (WIN32) + # On Windows the build type needs to match the main binary. + if (CMAKE_BUILD_TYPE MATCHES Profiling) + set (CMAKE_BUILD_TYPE Release) + elseif(NOT CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_BUILD_TYPE Release) + endif() +else() + # Always build with optimizations enabled and without debug info. set (CMAKE_BUILD_TYPE Release) endif() -# Disabled threading support for rlottie as this functionality actually leads to far worse +unset(CMAKE_CXX_FLAGS) +unset(CMAKE_EXE_LINKER_FLAGS) + +if(WIN32) + if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) + # Disable DLL interface warnings for LunaSVG. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251") + else() + # Strip the DLL files when building with MinGW. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s") + endif() + if (WIN32) + set(BUILD_SHARED_LIBS ON) + else() + set(BUILD_SHARED_LIBS OFF) + endif() +endif() + +add_subdirectory(lunasvg EXCLUDE_FROM_ALL) + +# Disable threading support for rlottie as this functionality actually leads to far worse # performance. As well there is a bug on Windows that makes rlottie hang forever on application # shutdown if compiled using MinGW with threading support enabled. option(LOTTIE_THREAD OFF) option(LOTTIE_MODULE OFF) -# Only use the compiler and linker flags defined by LunaSVG and rlottie. -unset(CMAKE_CXX_FLAGS) -unset(CMAKE_EXE_LINKER_FLAGS) - -add_subdirectory(lunasvg) - -# On Windows, rlottie is built as a DLL file. -if (WIN32) - set(BUILD_SHARED_LIBS ON) -else() - set(BUILD_SHARED_LIBS OFF) -endif() - if(EMSCRIPTEN) set(CMAKE_CXX_FLAGS -pthread) endif() # rlottie generates a lot of annoying compiler warnings that we don't need to show. if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) - set(CMAKE_CXX_FLAGS "/wd4244 /wd4251 /wd4267 /wd4530 /wd4996") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244 /wd4267 /wd4530 /wd4996") else() - set(CMAKE_CXX_FLAGS "-w") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") endif() add_subdirectory(rlottie EXCLUDE_FROM_ALL)