diff --git a/src/BuildFiles/Manifests/common.manifest b/src/BuildFiles/Manifests/common.manifest
new file mode 100644
index 00000000..2e279a09
--- /dev/null
+++ b/src/BuildFiles/Manifests/common.manifest
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
diff --git a/src/BuildFiles/Manifests/x64_admin.manifest b/src/BuildFiles/Manifests/x64_admin.manifest
deleted file mode 100644
index 58caa97d..00000000
--- a/src/BuildFiles/Manifests/x64_admin.manifest
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
diff --git a/src/BuildFiles/Manifests/x64_user.manifest b/src/BuildFiles/Manifests/x64_user.manifest
deleted file mode 100644
index 2c19b412..00000000
--- a/src/BuildFiles/Manifests/x64_user.manifest
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
diff --git a/src/BuildFiles/Manifests/x86_admin.manifest b/src/BuildFiles/Manifests/x86_admin.manifest
deleted file mode 100644
index 7feaa3c2..00000000
--- a/src/BuildFiles/Manifests/x86_admin.manifest
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
diff --git a/src/BuildFiles/Manifests/x86_user.manifest b/src/BuildFiles/Manifests/x86_user.manifest
deleted file mode 100644
index 61ee3699..00000000
--- a/src/BuildFiles/Manifests/x86_user.manifest
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6758c2c8..4448c185 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -50,10 +50,7 @@ else()
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(COMPILER_ARCHITECTURE "x64")
add_definitions(-DCPU_64)
-else()
- set(COMPILER_ARCHITECTURE "x86")
endif()
add_definitions(-D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64)
diff --git a/src/vpnbridge/CMakeLists.txt b/src/vpnbridge/CMakeLists.txt
index daa2985e..fbb28522 100644
--- a/src/vpnbridge/CMakeLists.txt
+++ b/src/vpnbridge/CMakeLists.txt
@@ -2,7 +2,11 @@ set(COMPONENT_NAME "Bridge")
set(COMPONENT_INTERNAL_NAME "vpnbridge")
if(WIN32)
- add_executable(vpnbridge WIN32 vpnbridge.c)
+ add_executable(vpnbridge WIN32
+ "vpnbridge.c"
+
+ "${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
+ )
set_target_properties(vpnbridge
PROPERTIES
@@ -14,12 +18,6 @@ if(WIN32)
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
target_sources(vpnbridge PRIVATE "vpnbridge.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
-
- if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
- target_sources(vpnbridge PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
- else()
- target_sources(vpnbridge PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_user.manifest")
- endif()
else()
add_executable(vpnbridge vpnbridge.c)
endif()
diff --git a/src/vpnclient/CMakeLists.txt b/src/vpnclient/CMakeLists.txt
index 41f4f04c..a9998f24 100644
--- a/src/vpnclient/CMakeLists.txt
+++ b/src/vpnclient/CMakeLists.txt
@@ -2,7 +2,12 @@ set(COMPONENT_NAME "Client")
set(COMPONENT_INTERNAL_NAME "vpnclient")
if(WIN32)
- add_executable(vpnclient WIN32 vpncsvc.c vpncsvc.h)
+ add_executable(vpnclient WIN32
+ "vpncsvc.c"
+ "vpncsvc.h"
+
+ "${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
+ )
set_target_properties(vpnclient
PROPERTIES
@@ -14,12 +19,6 @@ if(WIN32)
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
target_sources(vpnclient PRIVATE "vpnclient.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
-
- if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
- target_sources(vpnclient PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
- else()
- target_sources(vpnclient PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_user.manifest")
- endif()
else()
add_executable(vpnclient vpncsvc.c vpncsvc.h)
endif()
diff --git a/src/vpncmd/CMakeLists.txt b/src/vpncmd/CMakeLists.txt
index c17e9ac2..51bfba57 100644
--- a/src/vpncmd/CMakeLists.txt
+++ b/src/vpncmd/CMakeLists.txt
@@ -20,13 +20,13 @@ if(WIN32)
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
- target_sources(vpncmd PRIVATE "vpncmd.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
- if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
- target_sources(vpncmd PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
- else()
- target_sources(vpncmd PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_user.manifest")
- endif()
+ target_sources(vpncmd PRIVATE
+ "vpncmd.rc"
+ "ver.rc"
+
+ "${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
+ )
endif()
target_link_libraries(vpncmd cedar mayaqua)
diff --git a/src/vpncmgr/CMakeLists.txt b/src/vpncmgr/CMakeLists.txt
index 7a9af191..72142f17 100644
--- a/src/vpncmgr/CMakeLists.txt
+++ b/src/vpncmgr/CMakeLists.txt
@@ -5,7 +5,12 @@ endif()
set(COMPONENT_NAME "Client Manager")
set(COMPONENT_INTERNAL_NAME "vpncmgr")
-add_executable(vpncmgr WIN32 vpncmgr.c vpncmgr.rc)
+add_executable(vpncmgr WIN32
+ "vpncmgr.c"
+ "vpncmgr.rc"
+
+ "${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
+)
get_filename_component(COMPONENT_FILE_NAME vpncmgr NAME)
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
@@ -13,12 +18,6 @@ set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
target_sources(vpncmgr PRIVATE "vpncmgr.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
-if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
- target_sources(vpncmgr PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
-else()
- target_sources(vpncmgr PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_user.manifest")
-endif()
-
set_target_properties(vpncmgr
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
diff --git a/src/vpndrvinst/CMakeLists.txt b/src/vpndrvinst/CMakeLists.txt
index 19b7f98b..13c7f3c9 100644
--- a/src/vpndrvinst/CMakeLists.txt
+++ b/src/vpndrvinst/CMakeLists.txt
@@ -15,6 +15,8 @@ add_executable(vpndrvinst
Driver.h
Str.c
Str.h
+
+ "${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
)
get_filename_component(COMPONENT_FILE_NAME vpndrvinst NAME)
@@ -28,15 +30,10 @@ if(MSVC)
set_target_properties(vpndrvinst PROPERTIES LINK_FLAGS "/manifestuac:level='requireAdministrator'")
endif()
+target_link_options(vpndrvinst PRIVATE "/MANIFESTUAC:level='requireAdministrator'")
# Hide console while keeping main() as entry point
target_link_options(vpndrvinst PRIVATE "/SUBSYSTEM:WINDOWS" "/ENTRY:mainCRTStartup")
-if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
- target_sources(vpndrvinst PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_admin.manifest")
-else()
- target_sources(vpndrvinst PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_admin.manifest")
-endif()
-
set_target_properties(vpndrvinst
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${TOP_DIRECTORY}/src/bin/hamcore"
diff --git a/src/vpnserver/CMakeLists.txt b/src/vpnserver/CMakeLists.txt
index 0b3e692c..3ae08ced 100644
--- a/src/vpnserver/CMakeLists.txt
+++ b/src/vpnserver/CMakeLists.txt
@@ -2,7 +2,11 @@ set(COMPONENT_NAME "Server")
set(COMPONENT_INTERNAL_NAME "vpnserver")
if(WIN32)
- add_executable(vpnserver WIN32 vpnserver.c)
+ add_executable(vpnserver WIN32
+ "vpnserver.c"
+
+ "${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
+ )
set_target_properties(vpnserver
PROPERTIES
@@ -14,12 +18,6 @@ if(WIN32)
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
target_sources(vpnserver PRIVATE "vpnserver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
-
- if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
- target_sources(vpnserver PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
- else()
- target_sources(vpnserver PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_user.manifest")
- endif()
else()
add_executable(vpnserver vpnserver.c)
endif()
diff --git a/src/vpnsetup/CMakeLists.txt b/src/vpnsetup/CMakeLists.txt
index 2e6b595c..dd29dd01 100644
--- a/src/vpnsetup/CMakeLists.txt
+++ b/src/vpnsetup/CMakeLists.txt
@@ -5,7 +5,12 @@ endif()
set(COMPONENT_NAME "Setup")
set(COMPONENT_INTERNAL_NAME "vpnsetup")
-add_executable(vpnsetup WIN32 vpnsetup.c vpnsetup.rc)
+add_executable(vpnsetup WIN32
+ "vpnsetup.c"
+ "vpnsetup.rc"
+
+ "${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
+)
get_filename_component(COMPONENT_FILE_NAME vpnsetup NAME)
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
@@ -13,12 +18,6 @@ set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
target_sources(vpnsetup PRIVATE "vpnsetup.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
-if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
- target_sources(vpnsetup PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
-else()
- target_sources(vpnsetup PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_user.manifest")
-endif()
-
set_target_properties(vpnsetup
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
diff --git a/src/vpnsmgr/CMakeLists.txt b/src/vpnsmgr/CMakeLists.txt
index 9c1054fa..1ffef518 100644
--- a/src/vpnsmgr/CMakeLists.txt
+++ b/src/vpnsmgr/CMakeLists.txt
@@ -5,7 +5,12 @@ endif()
set(COMPONENT_NAME "Server Manager")
set(COMPONENT_INTERNAL_NAME "vpnsmgr")
-add_executable(vpnsmgr WIN32 vpnsmgr.c vpnsmgr.rc)
+add_executable(vpnsmgr WIN32
+ "vpnsmgr.c"
+ "vpnsmgr.rc"
+
+ "${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
+)
get_filename_component(COMPONENT_FILE_NAME vpnsmgr NAME)
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
@@ -13,12 +18,6 @@ set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
target_sources(vpnsmgr PRIVATE "vpnsmgr.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
-if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
- target_sources(vpnsmgr PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
-else()
- target_sources(vpnsmgr PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_user.manifest")
-endif()
-
set_target_properties(vpnsmgr
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
diff --git a/src/vpntest/CMakeLists.txt b/src/vpntest/CMakeLists.txt
index 9d03a6c6..7d13f2f6 100644
--- a/src/vpntest/CMakeLists.txt
+++ b/src/vpntest/CMakeLists.txt
@@ -20,13 +20,13 @@ if(WIN32)
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
- target_sources(vpntest PRIVATE "vpntest.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
- if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
- target_sources(vpntest PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest")
- else()
- target_sources(vpntest PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_user.manifest")
- endif()
+ target_sources(vpntest PRIVATE
+ "vpntest.rc"
+ "ver.rc"
+
+ "${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
+ )
endif()
target_link_libraries(vpntest cedar mayaqua)