From 20e253ba511bd7d6f5ebd99c18cd5da0d22b3b70 Mon Sep 17 00:00:00 2001 From: maballan Date: Tue, 7 Feb 2023 14:31:35 +0000 Subject: [PATCH 1/4] Add targets to buildTransitive folder in the nuget package --- p4api.net/p4api.net.core.nuspec | 3 +-- p4api.net/p4api.net.lib.nuspec | 3 +-- p4api.net/p4api.net.x64.nuspec | 3 +-- p4api.net/p4api.net.x86.nuspec | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/p4api.net/p4api.net.core.nuspec b/p4api.net/p4api.net.core.nuspec index 2eeaea6..116f345 100644 --- a/p4api.net/p4api.net.core.nuspec +++ b/p4api.net/p4api.net.core.nuspec @@ -35,7 +35,6 @@ + - - diff --git a/p4api.net/p4api.net.lib.nuspec b/p4api.net/p4api.net.lib.nuspec index fec0d8b..13448fd 100644 --- a/p4api.net/p4api.net.lib.nuspec +++ b/p4api.net/p4api.net.lib.nuspec @@ -35,7 +35,6 @@ + - - diff --git a/p4api.net/p4api.net.x64.nuspec b/p4api.net/p4api.net.x64.nuspec index 3de2cfd..65cd3bd 100644 --- a/p4api.net/p4api.net.x64.nuspec +++ b/p4api.net/p4api.net.x64.nuspec @@ -35,7 +35,6 @@ + - - diff --git a/p4api.net/p4api.net.x86.nuspec b/p4api.net/p4api.net.x86.nuspec index abca079..9b4d06d 100644 --- a/p4api.net/p4api.net.x86.nuspec +++ b/p4api.net/p4api.net.x86.nuspec @@ -35,7 +35,6 @@ + - - From 55631b847485a6f6dd8d08830f5c09e19d75abd6 Mon Sep 17 00:00:00 2001 From: maballan Date: Tue, 7 Feb 2023 14:37:34 +0000 Subject: [PATCH 2/4] Add /guard:cf and /DYNAMICBASE when building with VC++ --- p4bridge/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/p4bridge/CMakeLists.txt b/p4bridge/CMakeLists.txt index 50e1bfe..ad76c43 100644 --- a/p4bridge/CMakeLists.txt +++ b/p4bridge/CMakeLists.txt @@ -22,6 +22,11 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") string(COMPARE EQUAL "${MSVC_CXX_ARCHITECTURE_ID}" "X86" _is_x86) link_directories( "../p4api$<${_is_x86}:_x86>_$,debug,release>/lib" ) include_directories( "../p4api$<${_is_x86}:_x86>_$,debug,release>/include/p4" ) + if (MSVC AND (MSVC_VERSION GREATER 1900)) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /guard:cf") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf /DYNAMICBASE") + endif() endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") @@ -44,7 +49,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") find_library(Foundation_lib Foundation ) find_library(CoreServices_lib CoreServices ) find_library(CoreGraphics_lib CoreGraphics ) - find_library(Security_lib Security ) + find_library(Security_lib Security ) set(PlatformLibs ${Foundation_lib} ${CoreServices_lib} ${CoreGraphics_lib} ${Security_lib}) link_directories( "../p4api/lib" ) include_directories("../p4api/include/p4") From 2b1a7dc0301e75594076931f3839874b32980b24 Mon Sep 17 00:00:00 2001 From: maballan Date: Tue, 7 Feb 2023 15:09:23 +0000 Subject: [PATCH 3/4] Fix incorrect CXX flags extension --- p4bridge/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p4bridge/CMakeLists.txt b/p4bridge/CMakeLists.txt index ad76c43..7b0f23f 100644 --- a/p4bridge/CMakeLists.txt +++ b/p4bridge/CMakeLists.txt @@ -24,7 +24,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") include_directories( "../p4api$<${_is_x86}:_x86>_$,debug,release>/include/p4" ) if (MSVC AND (MSVC_VERSION GREATER 1900)) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf") - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /guard:cf") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /guard:cf") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf /DYNAMICBASE") endif() endif() From ffba4b77546425e6352dab76d709124d8413f65b Mon Sep 17 00:00:00 2001 From: maballan Date: Tue, 7 Feb 2023 15:15:35 +0000 Subject: [PATCH 4/4] Correct Cmake linker flags variable --- p4bridge/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p4bridge/CMakeLists.txt b/p4bridge/CMakeLists.txt index 7b0f23f..5dc8594 100644 --- a/p4bridge/CMakeLists.txt +++ b/p4bridge/CMakeLists.txt @@ -25,7 +25,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") if (MSVC AND (MSVC_VERSION GREATER 1900)) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /guard:cf") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf /DYNAMICBASE") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /guard:cf /DYNAMICBASE") endif() endif()