[CMake] Use COMPILE_DEFINITIONS target property for setting BUILDING_* defines
authorparoga@webkit.org <paroga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Sep 2013 13:23:25 +0000 (13:23 +0000)
committerparoga@webkit.org <paroga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Sep 2013 13:23:25 +0000 (13:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121672

Reviewed by Gyuyoung Kim.

Since the scope of add_definitions() is always a whole file, we need to use
target properties instead to set definitions only for specific targets.

Source/JavaScriptCore:

* CMakeLists.txt:

Source/WebCore:

* CMakeLists.txt:

Source/WebKit:

* CMakeLists.txt:

Source/WTF:

* wtf/CMakeLists.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156159 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/WTF/ChangeLog
Source/WTF/wtf/CMakeLists.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog

index f020c3f769af0af2bf3ed55c5748a0ca5bde418b..635466b6b176d13e3d1bf26b183996675ed62353 100644 (file)
@@ -664,9 +664,10 @@ add_subdirectory(shell)
 
 WEBKIT_WRAP_SOURCELIST(${JavaScriptCore_SOURCES})
 include_directories(${JavaScriptCore_INCLUDE_DIRECTORIES})
-add_definitions(-DBUILDING_JavaScriptCore -DSTATICALLY_LINKED_WITH_WTF)
+add_definitions(-DSTATICALLY_LINKED_WITH_WTF)
 add_library(JavaScriptCore ${JavaScriptCore_LIBRARY_TYPE} ${JavaScriptCore_HEADERS} ${JavaScriptCore_SOURCES})
 target_link_libraries(JavaScriptCore ${JavaScriptCore_LIBRARIES})
+set_target_properties(JavaScriptCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_JavaScriptCore")
 set_target_properties(JavaScriptCore PROPERTIES FOLDER "JavaScriptCore")
 set_target_properties(JavaScriptCore PROPERTIES LINK_INTERFACE_LIBRARIES "")
 
index 3a3af06129bbcc32bf37bd86f966d0a8a51462f6..d08da71bfa1caa31938ded98787d8f5f2eea63bb 100644 (file)
@@ -1,3 +1,15 @@
+2013-09-20  Patrick Gansterer  <paroga@webkit.org>
+
+        [CMake] Use COMPILE_DEFINITIONS target property for setting BUILDING_* defines
+        https://bugs.webkit.org/show_bug.cgi?id=121672
+
+        Reviewed by Gyuyoung Kim.
+
+        Since the scope of add_definitions() is always a whole file, we need to use
+        target properties instead to set definitions only for specific targets.
+
+        * CMakeLists.txt:
+
 2013-09-19  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r156120.
index c32d0928c54a4721f389ee04ce78e511e17b4388..6fd85044245060b4beea45d5e8eac3bf0f1671ff 100644 (file)
@@ -1,3 +1,15 @@
+2013-09-20  Patrick Gansterer  <paroga@webkit.org>
+
+        [CMake] Use COMPILE_DEFINITIONS target property for setting BUILDING_* defines
+        https://bugs.webkit.org/show_bug.cgi?id=121672
+
+        Reviewed by Gyuyoung Kim.
+
+        Since the scope of add_definitions() is always a whole file, we need to use
+        target properties instead to set definitions only for specific targets.
+
+        * wtf/CMakeLists.txt:
+
 2013-09-20  Patrick Gansterer  <paroga@webkit.org>
 
         Remove duplicated secondsPerDay variables
index 88cc1d1bcf17838df0462ccee5a552e7069ee6ff..3fa190f1bb3ed6353c2100075e3d5d2294b1854d 100644 (file)
@@ -262,9 +262,9 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
 WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
 include_directories(${WTF_INCLUDE_DIRECTORIES})
-add_definitions(-DBUILDING_WTF)
 add_library(WTF STATIC ${WTF_HEADERS} ${WTF_SOURCES})
 target_link_libraries(WTF ${WTF_LIBRARIES})
+set_target_properties(WTF PROPERTIES COMPILE_DEFINITIONS "BUILDING_WTF")
 set_target_properties(WTF PROPERTIES FOLDER "JavaScriptCore")
 
 if (WTF_OUTPUT_NAME)
index 0a51fc86e0491d7d968e34d2142dbb3c80890ad2..b21d3e0ff3bcbdcf47921c07030688a5798362d5 100644 (file)
@@ -3214,10 +3214,10 @@ list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/WebKitVersion.h)
 WEBKIT_WRAP_SOURCELIST(${WebCore_IDL_FILES} ${WebCore_SOURCES})
 WEBKIT_WRAP_SOURCELIST(${WebCoreTestSupport_IDL_FILES} ${WebCoreTestSupport_SOURCES})
 
-add_definitions(-DBUILDING_WebCore)
 include_directories(${WebCore_INCLUDE_DIRECTORIES} ${WebCoreTestSupport_INCLUDE_DIRECTORIES})
 
 add_library(WebCore ${WebCore_LIBRARY_TYPE} ${WebCore_SOURCES})
+set_target_properties(WebCore PROPERTIES COMPILE_DEFINITIONS "BUILDING_WebCore")
 set_target_properties(WebCore PROPERTIES FOLDER "WebCore")
 set_target_properties(WebCore PROPERTIES LINK_INTERFACE_LIBRARIES "")
 
index ff80d3c7e383576c4091771efcd70e3433392b73..dba4e504eb902682acdd4a26b07084f0dbafa4c5 100644 (file)
@@ -1,3 +1,15 @@
+2013-09-20  Patrick Gansterer  <paroga@webkit.org>
+
+        [CMake] Use COMPILE_DEFINITIONS target property for setting BUILDING_* defines
+        https://bugs.webkit.org/show_bug.cgi?id=121672
+
+        Reviewed by Gyuyoung Kim.
+
+        Since the scope of add_definitions() is always a whole file, we need to use
+        target properties instead to set definitions only for specific targets.
+
+        * CMakeLists.txt:
+
 2013-09-18  Antonio Gomes  <a1.gomes@sisa.samsung.com>
 
         Make "autoscroll for drag'n drop" a setting
index ea11e22bcf67c66f0012a46daf6e35c86c9e5998..c4ec83cee19e17e0f0e5c26bd7dadb9f561a198f 100644 (file)
@@ -86,11 +86,11 @@ set(WebKit_LIBRARIES
 
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
-add_definitions(-DBUILDING_WebKit)
 include_directories(${WebKit_INCLUDE_DIRECTORIES})
 add_library(WebKit ${WebKit_LIBRARY_TYPE} ${WebKit_SOURCES})
 add_dependencies(WebKit WebCore)
 target_link_libraries(WebKit ${WebKit_LIBRARIES})
+set_target_properties(WebKit PROPERTIES COMPILE_DEFINITIONS "BUILDING_WebKit")
 set_target_properties(WebKit PROPERTIES FOLDER "WebKit")
 set_target_properties(WebKit PROPERTIES LINK_INTERFACE_LIBRARIES "")
 
index 3621da5fc4fe3fe145c9083534f1ed296341c8ae..509082ce0d62042e56ad3edb9802e0a9b25f82ce 100644 (file)
@@ -1,3 +1,15 @@
+2013-09-20  Patrick Gansterer  <paroga@webkit.org>
+
+        [CMake] Use COMPILE_DEFINITIONS target property for setting BUILDING_* defines
+        https://bugs.webkit.org/show_bug.cgi?id=121672
+
+        Reviewed by Gyuyoung Kim.
+
+        Since the scope of add_definitions() is always a whole file, we need to use
+        target properties instead to set definitions only for specific targets.
+
+        * CMakeLists.txt:
+
 2013-09-19  Bear Travis  <betravis@adobe.com>
 
         CSS_SHAPES not supported on AppleWin port