-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
From 8669ffdd5e3a6e50d89e21ca1762a98a65166708 Mon Sep 17 00:00:00 2001 | ||
From 0bda676cd813b99f4213ac9cb31c06857db63af0 Mon Sep 17 00:00:00 2001 | ||
From: Isuru Fernando <[email protected]> | ||
Date: Mon, 25 Mar 2024 14:02:11 -0500 | ||
Subject: [PATCH] Do not override CXXFLAGS for the libraries | ||
|
||
--- | ||
CMakeLists.txt | 13 +++++++++---- | ||
1 file changed, 9 insertions(+), 4 deletions(-) | ||
CMakeLists.txt | 15 +++++++++++---- | ||
1 file changed, 11 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index b06ac4575..5068bc47e 100644 | ||
index b06ac4575..75e01bbef 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -266,7 +266,7 @@ ENDIF(OPENMM_BUILD_C_AND_FORTRAN_WRAPPERS) | ||
|
@@ -20,14 +20,15 @@ index b06ac4575..5068bc47e 100644 | |
IF (CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
IF (NOT ANDROID) | ||
SET(EXTRA_LINK_FLAGS "${EXTRA_LINK_FLAGS} -Wl,--no-as-needed -lrt") | ||
@@ -278,13 +278,18 @@ ENDIF (MSVC) | ||
@@ -278,13 +278,20 @@ ENDIF (MSVC) | ||
|
||
IF(OPENMM_BUILD_SHARED_LIB) | ||
ADD_LIBRARY(${SHARED_TARGET} SHARED ${SOURCE_FILES} ${SOURCE_INCLUDE_FILES} ${API_ABS_INCLUDE_FILES}) | ||
- SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES LINK_FLAGS "${EXTRA_LINK_FLAGS}" COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -DOPENMM_BUILDING_SHARED_LIBRARY -DLEPTON_BUILDING_SHARED_LIBRARY -DPTHREAD_BUILDING_SHARED_LIBRARY" SOVERSION "${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}") | ||
+ SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES SOVERSION "${OPENMM_MAJOR_VERSION}.${OPENMM_MINOR_VERSION}") | ||
+ TARGET_LINK_OPTIONS(${SHARED_TARGET} PRIVATE ${EXTRA_LINK_FLAGS}) | ||
+ SET(EXTRA_COMPILE_FLAGS_SHARED "${EXTRA_COMPILE_FLAGS} -DOPENMM_BUILDING_SHARED_LIBRARY -DLEPTON_BUILDING_SHARED_LIBRARY -DPTHREAD_BUILDING_SHARED_LIBRARY") | ||
+ SEPARATE_ARGUMENTS(EXTRA_COMPILE_FLAGS_SHARED) | ||
+ TARGET_COMPILE_OPTIONS(${SHARED_TARGET} PRIVATE ${EXTRA_COMPILE_FLAGS_SHARED}) | ||
ENDIF(OPENMM_BUILD_SHARED_LIB) | ||
|
||
|
@@ -36,12 +37,13 @@ index b06ac4575..5068bc47e 100644 | |
SET(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -DOPENMM_USE_STATIC_LIBRARIES -DLEPTON_USE_STATIC_LIBRARIES -DPTW32_STATIC_LIB") | ||
- SET_TARGET_PROPERTIES(${STATIC_TARGET} PROPERTIES LINK_FLAGS "${EXTRA_LINK_FLAGS}" COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -DOPENMM_BUILDING_STATIC_LIBRARY -DLEPTON_BUILDING_STATIC_LIBRARY -DPTHREAD_BUILDING_STATIC_LIBRARY") | ||
+ SET(EXTRA_COMPILE_FLAGS_STATIC "${EXTRA_COMPILE_FLAGS} -DOPENMM_BUILDING_STATIC_LIBRARY -DLEPTON_BUILDING_STATIC_LIBRARY -DPTHREAD_BUILDING_STATIC_LIBRARY") | ||
+ SEPARATE_ARGUMENTS(EXTRA_COMPILE_FLAGS_STATIC) | ||
+ TARGET_LINK_OPTIONS(${STATIC_TARGET} PRIVATE ${EXTRA_LINK_FLAGS}) | ||
+ TARGET_COMPILE_OPTIONS(${STATIC_TARGET} PRIVATE ${EXTRA_COMPILE_FLAGS_STATIC}) | ||
ENDIF(OPENMM_BUILD_STATIC_LIB) | ||
|
||
IF(OPENMM_BUILD_C_AND_FORTRAN_WRAPPERS) | ||
@@ -454,7 +459,7 @@ ELSE (EXECUTABLE_OUTPUT_PATH) | ||
@@ -454,7 +461,7 @@ ELSE (EXECUTABLE_OUTPUT_PATH) | ||
SET (TEST_PATH .) | ||
ENDIF (EXECUTABLE_OUTPUT_PATH) | ||
|
||
|