aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@qt.io>2024-04-10 10:02:57 +0300
committerIikka Eklund <iikka.eklund@qt.io>2024-04-12 11:29:44 +0300
commita962b314041cbd2a9d9eb34dc12b36cd66a9b53f (patch)
treef28bd4ce33936703cc85b321f990131eba46aa69
parent4da766b1e190537546a74450bca60df6420fb29d (diff)
Move BUILD_SHARED_LIBS from build scripts to top level CMake file
In practice it makes no sense to build the License Service or the CIP API library as shared. Move the BUILD_SHARED_LIBS option from the build scripts to the top level CMakeLists.txt so when building without the provided build scripts this option is not forgotten. Pick-to: 3.0 Change-Id: I268748c149489109d26bcb412c69d5b41fd0d137 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
-rw-r--r--CMakeLists.txt3
-rwxr-xr-xbuild_unix.sh4
-rw-r--r--build_windows.bat2
3 files changed, 5 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ec484d..997247e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,6 +24,8 @@ set(USER_WORK_DIR_TEST ${CMAKE_CURRENT_LIST_DIR}/tests/)
ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-D_UNICODE)
+
+option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(BUILD_SERVICE_LIB "Build the license service library" ON)
option(BUILD_CLIENT_LIB "Build the license client library" ON)
option(BUILD_BINARIES "Build the license tools and service binary" ON)
@@ -44,7 +46,6 @@ if (BUILD_BINARIES)
endif ()
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
- set(BUILD_SHARED_LIBS OFF)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
if (BUILD_BINARIES)
list(APPEND targetSrc ${CMAKE_CURRENT_LIST_DIR}/src/daemons/windowsdaemon.cpp)
diff --git a/build_unix.sh b/build_unix.sh
index 57d237b..7543444 100755
--- a/build_unix.sh
+++ b/build_unix.sh
@@ -58,9 +58,9 @@ function build {
# build
if ( ${DEBUG} ) then
- cmake .. -DDEBUG=True -DBUILD_SHARED_LIBS=OFF
+ cmake .. -DDEBUG=True
else
- cmake .. -DBUILD_SHARED_LIBS=OFF -DCONFIG=Release
+ cmake .. -DCONFIG=Release
fi
if [ $? != 0 ]; then
diff --git a/build_windows.bat b/build_windows.bat
index 288e12e..62ec5a2 100644
--- a/build_windows.bat
+++ b/build_windows.bat
@@ -16,7 +16,7 @@ if "%~1" neq "" (
mkdir build
cd build
-cmake -DBUILD_SHARED_LIBS=OFF -DCONFIG=Release .. -G "%GENERATOR%"
+cmake -DCONFIG=Release .. -G "%GENERATOR%"
IF %ERRORLEVEL% NEQ 0 (
echo Error: cmake failed with error code %ERRORLEVEL%.
exit /b %ERRORLEVEL%