summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorViktor Szakats <vszakats@users.noreply.github.com>2018-05-30 12:08:26 +0000
committerViktor Szakats <vszakats@users.noreply.github.com>2018-05-30 12:08:26 +0000
commitebd213270a017a6830928ee2e1f4a9cabc799898 (patch)
tree752f53af3bd1b4b2f83d760f8d819f3698fc7b23 /CMakeLists.txt
parente40ab75e9b179573847ce7f061f579ddce51804e (diff)
downloadgnurl-ebd213270a017a6830928ee2e1f4a9cabc799898.tar.gz
gnurl-ebd213270a017a6830928ee2e1f4a9cabc799898.tar.bz2
gnurl-ebd213270a017a6830928ee2e1f4a9cabc799898.zip
curl.rc: embed manifest for correct Windows version detection
* enable it in `src/Makefile.m32` * enable it in `winbuild/MakefileBuild.vc` if a custom manifest is _not_ enabled via the existing `EMBED_MANIFEST` option * enable it for all Windows CMake builds (also disable the built-in minimal manifest, added by CMake by default.) For other build systems, add the `-DCURL_EMBED_MANIFEST` option to the list of RC (Resource Compiler) flags to enable the manifest included in `src/curl.rc`. This may require to disable whatever automatic or other means in which way another manifest is added to `curl.exe`. Notice that Borland C doesn't support this method due to a long-pending resource compiler bug. Watcom C may also not handle it correctly when the `-zm` `wrc` option is used (this option may be unnecessary though) and regardless of options in certain earlier revisions of the 2.0 beta version. Closes https://github.com/curl/curl/pull/1221 Fixes https://github.com/curl/curl/issues/2591
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b85e1f58d..e8cdcc555 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1107,12 +1107,18 @@ include(CMake/OtherTests.cmake)
add_definitions(-DHAVE_CONFIG_H)
-# For windows, all compilers used by cmake should support large files
+# For Windows, all compilers used by CMake should support large files
if(WIN32)
set(USE_WIN32_LARGE_FILES ON)
+
+ # Use the manifest embedded in the Windows Resource
+ set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -DCURL_EMBED_MANIFEST")
endif(WIN32)
if(MSVC)
+ # Disable default manifest added by CMake
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
+
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")