changeset 5260:dd9443ac2dbf

trying to fully disable precompiled headers for visual studio
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Apr 2023 14:32:59 +0200
parents 0d1704d8cc65
children f66b8d70917e
files OrthancServer/CMakeLists.txt
diffstat 1 files changed, 0 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/CMakeLists.txt	Wed Apr 12 13:32:08 2023 +0200
+++ b/OrthancServer/CMakeLists.txt	Wed Apr 12 14:32:59 2023 +0200
@@ -74,7 +74,6 @@
   set(ENABLE_PROTOBUF_COMPILER ON)
 endif()
 
-include(${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/CMake/VisualStudioPrecompiledHeaders.cmake)
 include(${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/CMake/OrthancFrameworkConfiguration.cmake)
 
 # To export the proper symbols in the sample plugins
@@ -331,33 +330,6 @@
   )
 
 
-# Setup precompiled headers for Microsoft Visual Studio
-
-# WARNING: There must be NO MORE "add_definitions()", "include()" or
-# "include_directories()" below, otherwise the generated precompiled
-# headers might get broken!
-
-if (MSVC)
-  set(TMP
-    ${ORTHANC_CORE_SOURCES_INTERNAL}
-    ${ORTHANC_DICOM_SOURCES_INTERNAL}
-    )
-  
-  ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
-    "PrecompiledHeaders.h" "${CMAKE_SOURCE_DIR}/../OrthancFramework/Sources/PrecompiledHeaders.cpp"
-    TMP ORTHANC_CORE_PCH)
-
-  ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
-    "PrecompiledHeadersServer.h" "${CMAKE_SOURCE_DIR}/Sources/PrecompiledHeadersServer.cpp"
-    ORTHANC_SERVER_SOURCES ORTHANC_SERVER_PCH)
-
-  ADD_VISUAL_STUDIO_PRECOMPILED_HEADERS(
-    "PrecompiledHeadersUnitTests.h" "${CMAKE_SOURCE_DIR}/UnitTestsSources/PrecompiledHeadersUnitTests.cpp"
-    ORTHANC_SERVER_UNIT_TESTS ORTHANC_UNIT_TESTS_PCH)
-endif()
-
-
-
 #####################################################################
 ## Build the core of Orthanc
 #####################################################################
@@ -371,19 +343,11 @@
 # content of the "OrthancFramework" folder
 add_library(CoreLibrary
   STATIC
-  ${ORTHANC_CORE_PCH}
   ${ORTHANC_CORE_SOURCES}
   ${ORTHANC_DICOM_SOURCES}
   ${AUTOGENERATED_SOURCES}
   )
 
-if (MSVC)
-  set_target_properties(
-    CoreLibrary
-    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1"
-    )
-endif()
-
 add_dependencies(CoreLibrary AutogeneratedTarget)
 
 if (LIBICU_LIBRARIES)
@@ -421,17 +385,9 @@
 
 add_library(ServerLibrary
   STATIC
-  ${ORTHANC_SERVER_PCH}
   ${ORTHANC_SERVER_SOURCES}
   )
 
-if (MSVC)
-  set_target_properties(
-    ServerLibrary
-    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1"
-    )
-endif()
-
 # Ensure autogenerated code is built before building ServerLibrary
 add_dependencies(ServerLibrary CoreLibrary OrthancDatabaseProtobuf)
 
@@ -464,19 +420,11 @@
 
 add_executable(UnitTests
   ${GOOGLE_TEST_SOURCES}
-  ${ORTHANC_UNIT_TESTS_PCH}
   ${ORTHANC_FRAMEWORK_UNIT_TESTS}
   ${ORTHANC_SERVER_UNIT_TESTS}
   ${BOOST_EXTENDED_SOURCES}
   )
 
-if (MSVC)
-  set_target_properties(
-    UnitTests
-    PROPERTIES COMPILE_DEFINITIONS "ORTHANC_USE_PRECOMPILED_HEADERS=1"
-    )
-endif()
-
 target_link_libraries(UnitTests
   ServerLibrary
   CoreLibrary