Skip to content

Commit 67723e9

Browse files
committed
Move MYSQL_ADD_PLUGIN outside of IF(OQGRAPH_OK) condition,
otherwise the plugin does not get compiled if cmake is called multiple times.
1 parent 673efd0 commit 67723e9

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

storage/oqgraph/CMakeLists.txt

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,36 @@ CHECK_CXX_SOURCE_COMPILES(
3737
int main() { return 0; }
3838
" OQGRAPH_OK)
3939
ENDIF()
40-
41-
IF(OQGRAPH_OK)
42-
ADD_DEFINITIONS(-DHAVE_OQGRAPH)
43-
IF(MSVC)
44-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" PARENT_SCOPE)
45-
# Fix problem with judy not finding inttypes.h on Windows:
46-
ADD_DEFINITIONS(-DJU_WIN)
47-
ELSE(MSVC)
48-
# Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being
49-
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
50-
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
51-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive" PARENT_SCOPE)
52-
ENDIF(MSVC)
53-
54-
ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1)
55-
MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc
56-
oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc
57-
STORAGE_ENGINE
58-
MODULE_ONLY
59-
RECOMPILE_FOR_EMBEDDED
60-
COMPONENT oqgraph-engine
61-
LINK_LIBRARIES ${Judy_LIBRARIES})
62-
ELSE(OQGRAPH_OK)
63-
MESSAGE(STATUS "Requisites for OQGraph not met. OQGraph will not be compiled")
64-
ENDIF(OQGRAPH_OK)
6540
ENDFUNCTION()
6641

6742
IF(NOT DEFINED OQGRAPH_OK)
6843
CHECK_OQGRAPH()
44+
IF (NOT OQGRAPH_OK)
45+
MESSAGE(STATUS "Requisites for OQGraph not met. OQGraph will not be compiled")
46+
ENDIF()
47+
ENDIF()
48+
49+
IF(NOT OQGRAPH_OK)
50+
RETURN()
6951
ENDIF()
52+
53+
ADD_DEFINITIONS(-DHAVE_OQGRAPH)
54+
IF(MSVC)
55+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
56+
# Fix problem with judy not finding inttypes.h on Windows:
57+
ADD_DEFINITIONS(-DJU_WIN)
58+
ELSE(MSVC)
59+
# Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being
60+
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
61+
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
62+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing -fpermissive" PARENT_SCOPE)
63+
ENDIF(MSVC)
64+
65+
ADD_DEFINITIONS(-DBOOST_NO_RTTI=1 -DBOOST_NO_TYPEID=1 -DBOOST_DISABLE_ASSERTS=1)
66+
MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc graphcore-graph.cc
67+
oqgraph_shim.cc oqgraph_thunk.cc oqgraph_judy.cc
68+
STORAGE_ENGINE
69+
MODULE_ONLY
70+
RECOMPILE_FOR_EMBEDDED
71+
COMPONENT oqgraph-engine
72+
LINK_LIBRARIES ${Judy_LIBRARIES})

0 commit comments

Comments
 (0)