From 7bb13e6272da63df0d0e4b2faaaad604095db855 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Mon, 18 Jan 2021 08:39:39 +0100 Subject: [PATCH] Win32-refactorings --- CMakeLists.txt | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b553ef9e..7f8f96948 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,6 @@ OPTION( BUILD_SHARED_LIBS "Build package with shared libraries." ON ) - OPTION( ASSIMP_BUILD_FRAMEWORK "Build package as Mac OS X Framework bundle." OFF @@ -133,9 +132,22 @@ OPTION ( ASSIMP_IGNORE_GIT_HASH ) IF ( WIN32 ) - OPTION ( ASSIMP_BUILD_ASSIMP_VIEW - "If the Assimp view tool is built. (requires DirectX)" - OFF ) + # Use subset of Windows.h + ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN ) + + OPTION ( ASSIMP_BUILD_ASSIMP_VIEW + "If the Assimp view tool is built. (requires DirectX)" + OFF ) + + IF(MSVC) + OPTION( ASSIMP_INSTALL_PDB + "Install MSVC debug files." + ON ) + IF(NOT (MSVC_VERSION LESS 1900)) + # Multibyte character set is deprecated since at least MSVC2015 (possibly earlier) + ADD_DEFINITIONS( -DUNICODE -D_UNICODE ) + ENDIF() + ENDIF() ENDIF() IF (IOS AND NOT ASSIMP_HUNTER_ENABLED) @@ -145,21 +157,6 @@ IF (IOS AND NOT ASSIMP_HUNTER_ENABLED) ADD_DEFINITIONS(-DENABLE_BITCODE) ENDIF () -# Use subset of Windows.h -if (WIN32) - ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN ) -endif() - -IF(MSVC) - OPTION( ASSIMP_INSTALL_PDB - "Install MSVC debug files." - ON - ) - IF(NOT (MSVC_VERSION LESS 1900)) - # Multibyte character set is deprecated since at least MSVC2015 (possibly earlier) - ADD_DEFINITIONS( -DUNICODE -D_UNICODE ) - ENDIF() -ENDIF() IF (ASSIMP_BUILD_FRAMEWORK) SET (BUILD_SHARED_LIBS ON)