comparison Resources/Orthanc/CMake/Compiler.cmake @ 155:6673a963ddf0

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Mar 2024 15:08:48 +0100
parents 98f22123512a
children c4b908970ae4
comparison
equal deleted inserted replaced
154:ae1bd3d15f81 155:6673a963ddf0
1 # Orthanc - A Lightweight, RESTful DICOM Store 1 # Orthanc - A Lightweight, RESTful DICOM Store
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics 2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
3 # Department, University Hospital of Liege, Belgium 3 # Department, University Hospital of Liege, Belgium
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium 4 # Copyright (C) 2017-2024 Osimis S.A., Belgium
5 # Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium 5 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
6 # 6 #
7 # This program is free software: you can redistribute it and/or 7 # This program is free software: you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public License 8 # modify it under the terms of the GNU Lesser General Public License
9 # as published by the Free Software Foundation, either version 3 of 9 # as published by the Free Software Foundation, either version 3 of
10 # the License, or (at your option) any later version. 10 # the License, or (at your option) any later version.
41 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") 41 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
42 # Cache the environment variables "LSB_CC" and "LSB_CXX" for further 42 # Cache the environment variables "LSB_CC" and "LSB_CXX" for further
43 # use by "ExternalProject" in CMake 43 # use by "ExternalProject" in CMake
44 SET(CMAKE_LSB_CC $ENV{LSB_CC} CACHE STRING "") 44 SET(CMAKE_LSB_CC $ENV{LSB_CC} CACHE STRING "")
45 SET(CMAKE_LSB_CXX $ENV{LSB_CXX} CACHE STRING "") 45 SET(CMAKE_LSB_CXX $ENV{LSB_CXX} CACHE STRING "")
46
47 # This is necessary to build "Orthanc mainline - Framework LSB
48 # Release" on "buildbot-worker-debian11"
49 set(LSB_PTHREAD_NONSHARED "${LSB_PATH}/lib64-${LSB_TARGET_VERSION}/libpthread_nonshared.a")
50 if (EXISTS ${LSB_PTHREAD_NONSHARED})
51 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LSB_PTHREAD_NONSHARED}")
52 endif()
46 endif() 53 endif()
47 54
48 55
49 if (CMAKE_COMPILER_IS_GNUCXX) 56 if (CMAKE_COMPILER_IS_GNUCXX)
50 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-long-long") 57 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-long-long")
128 NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" AND 135 NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" AND
129 NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") 136 NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
130 # The "--no-undefined" linker flag makes the shared libraries 137 # The "--no-undefined" linker flag makes the shared libraries
131 # (plugins ModalityWorklists and ServeFolders) fail to compile on 138 # (plugins ModalityWorklists and ServeFolders) fail to compile on
132 # OpenBSD, and make the PostgreSQL plugin complain about missing 139 # OpenBSD, and make the PostgreSQL plugin complain about missing
133 # "environ" global variable in FreeBSD. Furthermore, on Linux 140 # "environ" global variable in FreeBSD.
134 # Standard Base running on Debian 12, the "-Wl,--no-undefined" 141 #
135 # breaks the compilation (added after Orthanc 1.12.2). 142 # TODO - Furthermore, on Linux Standard Base running on Debian 12,
143 # the "-Wl,--no-undefined" seems to break the compilation (added
144 # after Orthanc 1.12.2). This is disabled for now.
136 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined") 145 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
137 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") 146 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
138 endif() 147 endif()
139 148
140 # Remove the "-rdynamic" option 149 # Remove the "-rdynamic" option