Skip to content

Commit 2f3321c

Browse files
committed
splitting compiler/platform-specific flags into corresponding files
1 parent de3d4ae commit 2f3321c

File tree

6 files changed

+50
-0
lines changed

6 files changed

+50
-0
lines changed

cmake/compiler/Clang.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include(compiler/GCC)

cmake/compiler/GNU.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
target_compile_options(${TARGET_NAME} PRIVATE
2+
-Werror=return-type
3+
-Wunused-variable
4+
-Wno-switch
5+
-Wno-narrowing
6+
-Wno-char-subscripts
7+
$<$<CONFIG:Debug>:-Og>
8+
$<$<NOT:$<CONFIG:Debug>>:-O3>
9+
)
10+
11+
target_compile_definitions(${TARGET_NAME} PUBLIC
12+
# bounds checking in STL containers
13+
$<$<CONFIG:Debug>:_GLIBCXX_ASSERTIONS>
14+
)

cmake/compiler/MSVC.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
target_compile_options(${TARGET_NAME} PRIVATE
2+
/MP
3+
/std:c++17
4+
$<$<CONFIG:Debug>:/Z7>
5+
)
6+
7+
target_link_libraries(${TARGET_NAME}
8+
# pyconfig.py forces linking against pythonXY.lib on MSVC
9+
$<$<CONFIG:Debug>:/DEBUG>
10+
)

cmake/platform/Darwin.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
target_link_options(${TARGET_NAME} PRIVATE
2+
LINKER:-undefined,dynamic_lookup
3+
)
4+
5+
target_compile_options(${TARGET_NAME} PRIVATE
6+
# optimization currently causes a clang segfault on OS X 10.9 when
7+
# compiling layer2/RepCylBond.cpp
8+
-fno-strict-aliasing
9+
)
10+
11+
target_compile_definitions(${TARGET_NAME} PUBLIC
12+
PYMOL_CURVE_VALIDATE
13+
)

cmake/platform/Linux.cmake

Whitespace-only changes.

cmake/platform/Windows.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
target_compile_definitions(${TARGET_NAME} PUBLIC
2+
WIN32
3+
)
4+
5+
target_link_directories(${TARGET_NAME} PUBLIC
6+
${Python_LIBRARY_DIRS}
7+
)
8+
9+
target_link_libraries(${TARGET_NAME}
10+
${Python_LIBRARIES}
11+
)
12+

0 commit comments

Comments
 (0)